diff options
author | Dan Gohman <gohman@apple.com> | 2009-04-18 17:56:28 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-04-18 17:56:28 +0000 |
commit | 890f92b744fb074465bc2b7006ee753a181f62a4 (patch) | |
tree | 0300a386e2f78a01341f5351e32841c9f4349db0 /include | |
parent | f34c921713111fb327623400cf8c23d322513790 (diff) | |
download | external_llvm-890f92b744fb074465bc2b7006ee753a181f62a4.zip external_llvm-890f92b744fb074465bc2b7006ee753a181f62a4.tar.gz external_llvm-890f92b744fb074465bc2b7006ee753a181f62a4.tar.bz2 |
Use more const qualifiers with SCEV interfaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69450 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Analysis/ScalarEvolutionExpander.h | 26 | ||||
-rw-r--r-- | include/llvm/Analysis/ScalarEvolutionExpressions.h | 28 |
2 files changed, 27 insertions, 27 deletions
diff --git a/include/llvm/Analysis/ScalarEvolutionExpander.h b/include/llvm/Analysis/ScalarEvolutionExpander.h index 2f660c9..b5072da 100644 --- a/include/llvm/Analysis/ScalarEvolutionExpander.h +++ b/include/llvm/Analysis/ScalarEvolutionExpander.h @@ -69,7 +69,7 @@ namespace llvm { /// addInsertedValue - Remember the specified instruction as being the /// canonical form for the specified SCEV. - void addInsertedValue(Instruction *I, SCEV *S) { + void addInsertedValue(Instruction *I, const SCEV *S) { InsertedExpressions[S] = (Value*)I; InsertedInstructions.insert(I); } @@ -90,31 +90,31 @@ namespace llvm { static Value *InsertBinop(Instruction::BinaryOps Opcode, Value *LHS, Value *RHS, Instruction *InsertPt); protected: - Value *expand(SCEV *S); + Value *expand(const SCEV *S); - Value *visitConstant(SCEVConstant *S) { + Value *visitConstant(const SCEVConstant *S) { return S->getValue(); } - Value *visitTruncateExpr(SCEVTruncateExpr *S); + Value *visitTruncateExpr(const SCEVTruncateExpr *S); - Value *visitZeroExtendExpr(SCEVZeroExtendExpr *S); + Value *visitZeroExtendExpr(const SCEVZeroExtendExpr *S); - Value *visitSignExtendExpr(SCEVSignExtendExpr *S); + Value *visitSignExtendExpr(const SCEVSignExtendExpr *S); - Value *visitAddExpr(SCEVAddExpr *S); + Value *visitAddExpr(const SCEVAddExpr *S); - Value *visitMulExpr(SCEVMulExpr *S); + Value *visitMulExpr(const SCEVMulExpr *S); - Value *visitUDivExpr(SCEVUDivExpr *S); + Value *visitUDivExpr(const SCEVUDivExpr *S); - Value *visitAddRecExpr(SCEVAddRecExpr *S); + Value *visitAddRecExpr(const SCEVAddRecExpr *S); - Value *visitSMaxExpr(SCEVSMaxExpr *S); + Value *visitSMaxExpr(const SCEVSMaxExpr *S); - Value *visitUMaxExpr(SCEVUMaxExpr *S); + Value *visitUMaxExpr(const SCEVUMaxExpr *S); - Value *visitUnknown(SCEVUnknown *S) { + Value *visitUnknown(const SCEVUnknown *S) { return S->getValue(); } }; diff --git a/include/llvm/Analysis/ScalarEvolutionExpressions.h b/include/llvm/Analysis/ScalarEvolutionExpressions.h index 61bb25a..c160eb9 100644 --- a/include/llvm/Analysis/ScalarEvolutionExpressions.h +++ b/include/llvm/Analysis/ScalarEvolutionExpressions.h @@ -552,39 +552,39 @@ namespace llvm { /// for various SCEV analysis purposes. template<typename SC, typename RetVal=void> struct SCEVVisitor { - RetVal visit(SCEV *S) { + RetVal visit(const SCEV *S) { switch (S->getSCEVType()) { case scConstant: - return ((SC*)this)->visitConstant((SCEVConstant*)S); + return ((SC*)this)->visitConstant((const SCEVConstant*)S); case scTruncate: - return ((SC*)this)->visitTruncateExpr((SCEVTruncateExpr*)S); + return ((SC*)this)->visitTruncateExpr((const SCEVTruncateExpr*)S); case scZeroExtend: - return ((SC*)this)->visitZeroExtendExpr((SCEVZeroExtendExpr*)S); + return ((SC*)this)->visitZeroExtendExpr((const SCEVZeroExtendExpr*)S); case scSignExtend: - return ((SC*)this)->visitSignExtendExpr((SCEVSignExtendExpr*)S); + return ((SC*)this)->visitSignExtendExpr((const SCEVSignExtendExpr*)S); case scAddExpr: - return ((SC*)this)->visitAddExpr((SCEVAddExpr*)S); + return ((SC*)this)->visitAddExpr((const SCEVAddExpr*)S); case scMulExpr: - return ((SC*)this)->visitMulExpr((SCEVMulExpr*)S); + return ((SC*)this)->visitMulExpr((const SCEVMulExpr*)S); case scUDivExpr: - return ((SC*)this)->visitUDivExpr((SCEVUDivExpr*)S); + return ((SC*)this)->visitUDivExpr((const SCEVUDivExpr*)S); case scAddRecExpr: - return ((SC*)this)->visitAddRecExpr((SCEVAddRecExpr*)S); + return ((SC*)this)->visitAddRecExpr((const SCEVAddRecExpr*)S); case scSMaxExpr: - return ((SC*)this)->visitSMaxExpr((SCEVSMaxExpr*)S); + return ((SC*)this)->visitSMaxExpr((const SCEVSMaxExpr*)S); case scUMaxExpr: - return ((SC*)this)->visitUMaxExpr((SCEVUMaxExpr*)S); + return ((SC*)this)->visitUMaxExpr((const SCEVUMaxExpr*)S); case scUnknown: - return ((SC*)this)->visitUnknown((SCEVUnknown*)S); + return ((SC*)this)->visitUnknown((const SCEVUnknown*)S); case scCouldNotCompute: - return ((SC*)this)->visitCouldNotCompute((SCEVCouldNotCompute*)S); + return ((SC*)this)->visitCouldNotCompute((const SCEVCouldNotCompute*)S); default: assert(0 && "Unknown SCEV type!"); abort(); } } - RetVal visitCouldNotCompute(SCEVCouldNotCompute *S) { + RetVal visitCouldNotCompute(const SCEVCouldNotCompute *S) { assert(0 && "Invalid use of SCEVCouldNotCompute!"); abort(); return RetVal(); |