diff options
author | Hans Wennborg <hans@hanshq.net> | 2012-10-31 15:31:09 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2012-10-31 15:31:09 +0000 |
commit | daf4cfc8d890c7f17241ff7127b64c13ed2cb4d4 (patch) | |
tree | 21d9a363f7491aafe6f64267035591e75ae8d136 /lib/Transforms/Utils | |
parent | 72465ea23d010507d3746adc126d719005981e05 (diff) | |
download | external_llvm-daf4cfc8d890c7f17241ff7127b64c13ed2cb4d4.zip external_llvm-daf4cfc8d890c7f17241ff7127b64c13ed2cb4d4.tar.gz external_llvm-daf4cfc8d890c7f17241ff7127b64c13ed2cb4d4.tar.bz2 |
Address Duncan's comments on r167121.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167130 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils')
-rw-r--r-- | lib/Transforms/Utils/SimplifyCFG.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Transforms/Utils/SimplifyCFG.cpp b/lib/Transforms/Utils/SimplifyCFG.cpp index 861c47c..a477aa5 100644 --- a/lib/Transforms/Utils/SimplifyCFG.cpp +++ b/lib/Transforms/Utils/SimplifyCFG.cpp @@ -3201,7 +3201,7 @@ static bool ValidLookupTableConstant(Constant *C) { } /// LookupConstant - If V is a Constant, return it. Otherwise, try to look up -/// its constant value in ConstantPool, returning NULL if it's not there. +/// its constant value in ConstantPool, returning 0 if it's not there. static Constant *LookupConstant(Value *V, const SmallDenseMap<Value*, Constant*>& ConstantPool) { if (Constant *C = dyn_cast<Constant>(V)) @@ -3212,7 +3212,7 @@ static Constant *LookupConstant(Value *V, /// ConstantFold - Try to fold instruction I into a constant. This works for /// simple instructions such as binary operations where both operands are /// constant or can be replaced by constants from the ConstantPool. Returns the -/// resulting constant on success, NULL otherwise. +/// resulting constant on success, 0 otherwise. static Constant *ConstantFold(Instruction *I, const SmallDenseMap<Value*, Constant*>& ConstantPool) { if (BinaryOperator *BO = dyn_cast<BinaryOperator>(I)) { @@ -3243,6 +3243,7 @@ static Constant *ConstantFold(Instruction *I, return LookupConstant(Select->getTrueValue(), ConstantPool); if (A->isNullValue()) return LookupConstant(Select->getFalseValue(), ConstantPool); + return 0; } if (CastInst *Cast = dyn_cast<CastInst>(I)) { @@ -3257,7 +3258,7 @@ static Constant *ConstantFold(Instruction *I, /// GetCaseResults - Try to determine the resulting constant values in phi nodes /// at the common destination basic block, *CommonDest, for one of the case -/// destionations CaseDest corresponding to value CaseVal (NULL for the default +/// destionations CaseDest corresponding to value CaseVal (0 for the default /// case), of a switch instruction SI. static bool GetCaseResults(SwitchInst *SI, ConstantInt *CaseVal, |