forked from OSchip/llvm-project
Fix another case where constexprs could cause a crash
llvm-svn: 5972
This commit is contained in:
parent
9244df60d3
commit
dd65d863a9
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue