[llvm-commits] [llvm] r167130 - /llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp

Hans Wennborg hans at hanshq.net
Wed Oct 31 08:31:09 PDT 2012


Author: hans
Date: Wed Oct 31 10:31:09 2012
New Revision: 167130

URL: http://llvm.org/viewvc/llvm-project?rev=167130&view=rev
Log:
Address Duncan's comments on r167121.

Modified:
    llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp

Modified: llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp?rev=167130&r1=167129&r2=167130&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp Wed Oct 31 10:31:09 2012
@@ -3201,7 +3201,7 @@
 }
 
 /// 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 @@
 /// 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 @@
       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 @@
 
 /// 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,





More information about the llvm-commits mailing list