Index: llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpressions.h =================================================================== --- llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpressions.h +++ llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpressions.h @@ -664,18 +664,19 @@ typedef DenseMap LoopToScevMapT; - /// The SCEVApplyRewriter takes a scalar evolution expression and applies + /// The SCEVLoopAddRecRewriter takes a scalar evolution expression and applies /// the Map (Loop -> SCEV) to all AddRecExprs. - class SCEVApplyRewriter : public SCEVRewriteVisitor { + class SCEVLoopAddRecRewriter + : public SCEVRewriteVisitor { public: static const SCEV *rewrite(const SCEV *Scev, LoopToScevMapT &Map, ScalarEvolution &SE) { - SCEVApplyRewriter Rewriter(SE, Map); + SCEVLoopAddRecRewriter Rewriter(SE, Map); return Rewriter.visit(Scev); } - SCEVApplyRewriter(ScalarEvolution &SE, LoopToScevMapT &M) - : SCEVRewriteVisitor(SE), Map(M) {} + SCEVLoopAddRecRewriter(ScalarEvolution &SE, LoopToScevMapT &M) + : SCEVRewriteVisitor(SE), Map(M) {} const SCEV *visitAddRecExpr(const SCEVAddRecExpr *Expr) { SmallVector Operands; @@ -688,7 +689,7 @@ if (0 == Map.count(L)) return Res; - const SCEVAddRecExpr *Rec = (const SCEVAddRecExpr *) Res; + const SCEVAddRecExpr *Rec = cast(Res); return Rec->evaluateAtIteration(Map[L], SE); } @@ -699,7 +700,7 @@ /// Applies the Map (Loop -> SCEV) to the given Scev. static inline const SCEV *apply(const SCEV *Scev, LoopToScevMapT &Map, ScalarEvolution &SE) { - return SCEVApplyRewriter::rewrite(Scev, Map, SE); + return SCEVLoopAddRecRewriter::rewrite(Scev, Map, SE); } }