mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
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
This commit is contained in:
parent
fe32e0c578
commit
3f2ec3925f
@ -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
Block a user