Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Commit daf4cfc

Browse files
committed
Address Duncan's comments on r167121.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167130 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 72465ea commit daf4cfc

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/Transforms/Utils/SimplifyCFG.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3201,7 +3201,7 @@ static bool ValidLookupTableConstant(Constant *C) {
32013201
}
32023202

32033203
/// LookupConstant - If V is a Constant, return it. Otherwise, try to look up
3204-
/// its constant value in ConstantPool, returning NULL if it's not there.
3204+
/// its constant value in ConstantPool, returning 0 if it's not there.
32053205
static Constant *LookupConstant(Value *V,
32063206
const SmallDenseMap<Value*, Constant*>& ConstantPool) {
32073207
if (Constant *C = dyn_cast<Constant>(V))
@@ -3212,7 +3212,7 @@ static Constant *LookupConstant(Value *V,
32123212
/// ConstantFold - Try to fold instruction I into a constant. This works for
32133213
/// simple instructions such as binary operations where both operands are
32143214
/// constant or can be replaced by constants from the ConstantPool. Returns the
3215-
/// resulting constant on success, NULL otherwise.
3215+
/// resulting constant on success, 0 otherwise.
32163216
static Constant *ConstantFold(Instruction *I,
32173217
const SmallDenseMap<Value*, Constant*>& ConstantPool) {
32183218
if (BinaryOperator *BO = dyn_cast<BinaryOperator>(I)) {
@@ -3243,6 +3243,7 @@ static Constant *ConstantFold(Instruction *I,
32433243
return LookupConstant(Select->getTrueValue(), ConstantPool);
32443244
if (A->isNullValue())
32453245
return LookupConstant(Select->getFalseValue(), ConstantPool);
3246+
return 0;
32463247
}
32473248

32483249
if (CastInst *Cast = dyn_cast<CastInst>(I)) {
@@ -3257,7 +3258,7 @@ static Constant *ConstantFold(Instruction *I,
32573258

32583259
/// GetCaseResults - Try to determine the resulting constant values in phi nodes
32593260
/// at the common destination basic block, *CommonDest, for one of the case
3260-
/// destionations CaseDest corresponding to value CaseVal (NULL for the default
3261+
/// destionations CaseDest corresponding to value CaseVal (0 for the default
32613262
/// case), of a switch instruction SI.
32623263
static bool GetCaseResults(SwitchInst *SI,
32633264
ConstantInt *CaseVal,

0 commit comments

Comments
 (0)