diff options
Diffstat (limited to 'llvm/lib/Bitcode')
-rw-r--r-- | llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp index 7abe7c0..5e5ca96 100644 --- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp @@ -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)) { |