[Bitcode] Restore bitcast expression auto-upgrade
Restore the autoupgrade from bitcast to ptrtoint+inttoptr, which was lost as part of D127729. This fixes the backwards compatibility issue noted in: https://reviews.llvm.org/D127729#inline-1236519
This commit is contained in:
@@ -1442,7 +1442,9 @@ Expected<Value *> BitcodeReader::materializeValue(unsigned StartValID,
|
||||
if (isConstExprSupported(BC->Opcode) && ConstOps.size() == Ops.size()) {
|
||||
Constant *C;
|
||||
if (Instruction::isCast(BC->Opcode)) {
|
||||
C = ConstantExpr::getCast(BC->Opcode, ConstOps[0], BC->getType());
|
||||
C = UpgradeBitCastExpr(BC->Opcode, ConstOps[0], BC->getType());
|
||||
if (!C)
|
||||
C = ConstantExpr::getCast(BC->Opcode, ConstOps[0], BC->getType());
|
||||
} else if (Instruction::isUnaryOp(BC->Opcode)) {
|
||||
C = ConstantExpr::get(BC->Opcode, ConstOps[0], BC->Flags);
|
||||
} else if (Instruction::isBinaryOp(BC->Opcode)) {
|
||||
|
||||
Reference in New Issue
Block a user