aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-04-30 22:34:06 +0000
committerChris Lattner <sabre@nondot.org>2003-04-30 22:34:06 +0000
commit3f2ec3925fe3736d70220feb425c70bfbd5bbbad (patch)
tree5866f3b02f17d22e8782e102e27636e9a311abd2 /lib/Transforms
parentfe32e0c578abd1c13a82889217021813d6a29388 (diff)
Fix another case where constexprs could cause a crash
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5972 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/Scalar/InstructionCombining.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp
index ad4ef420e9..d00cefd37d 100644
--- a/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -197,11 +197,8 @@ static inline Value *dyn_castNotVal(Value *V) {
return BinaryOperator::getNotArgument(cast<BinaryOperator>(V));
// Constants can be considered to be not'ed values...
- if (ConstantIntegral *C = dyn_cast<ConstantIntegral>(V)) {
- Constant *NC = *ConstantIntegral::getAllOnesValue(C->getType()) ^ *C;
- assert(NC && "Couldn't constant fold an exclusive or!");
- return NC;
- }
+ if (ConstantIntegral *C = dyn_cast<ConstantIntegral>(V))
+ return *ConstantIntegral::getAllOnesValue(C->getType()) ^ *C;
return 0;
}