[llvm-commits] [llvm] r97049 - /llvm/trunk/lib/Analysis/ScalarEvolution.cpp
Dan Gohman
gohman at apple.com
Wed Feb 24 11:31:47 PST 2010
Author: djg
Date: Wed Feb 24 13:31:47 2010
New Revision: 97049
URL: http://llvm.org/viewvc/llvm-project?rev=97049&view=rev
Log:
ConstantFoldInstOperands can theoretically return null if it
didn't fold anything.
Modified:
llvm/trunk/lib/Analysis/ScalarEvolution.cpp
Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=97049&r1=97048&r2=97049&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Wed Feb 24 13:31:47 2010
@@ -4226,14 +4226,15 @@
}
}
- Constant *C;
+ Constant *C = 0;
if (const CmpInst *CI = dyn_cast<CmpInst>(I))
C = ConstantFoldCompareInstOperands(CI->getPredicate(),
Operands[0], Operands[1], TD);
else
C = ConstantFoldInstOperands(I->getOpcode(), I->getType(),
&Operands[0], Operands.size(), TD);
- return getSCEV(C);
+ if (C)
+ return getSCEV(C);
}
}
More information about the llvm-commits
mailing list