aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
diff options
context:
space:
mode:
authorNikita Popov <npopov@redhat.com>2024-06-24 16:36:46 +0200
committerNikita Popov <npopov@redhat.com>2024-06-24 16:36:46 +0200
commit6258b5f610d51d37a79456d660b12c2d8e98500b (patch)
treeeb179810c03ace389f4724192922ed1094e85854 /llvm/lib/Bitcode/Reader/BitcodeReader.cpp
parent824113f7b1fe79e9e5258323a0fdfbf960ab315a (diff)
downloadllvm-6258b5f610d51d37a79456d660b12c2d8e98500b.zip
llvm-6258b5f610d51d37a79456d660b12c2d8e98500b.tar.gz
llvm-6258b5f610d51d37a79456d660b12c2d8e98500b.tar.bz2
[BitcodeReader] Use poison instead of undef for invalid instructions
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r--llvm/lib/Bitcode/Reader/BitcodeReader.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
index 6c6c5d5..05c9697 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -3228,7 +3228,7 @@ Error BitcodeReader::parseConstants() {
V = ConstantFP::get(
CurTy, APFloat(APFloat::PPCDoubleDouble(), APInt(128, Record)));
else
- V = UndefValue::get(CurTy);
+ V = PoisonValue::get(CurTy);
break;
}
@@ -3251,7 +3251,7 @@ Error BitcodeReader::parseConstants() {
V = BitcodeConstant::create(
Alloc, CurTy, BitcodeConstant::ConstantVectorOpcode, Elts);
} else {
- V = UndefValue::get(CurTy);
+ V = PoisonValue::get(CurTy);
}
break;
}
@@ -3332,7 +3332,7 @@ Error BitcodeReader::parseConstants() {
return error("Invalid unary op constexpr record");
int Opc = getDecodedUnaryOpcode(Record[0], CurTy);
if (Opc < 0) {
- V = UndefValue::get(CurTy); // Unknown unop.
+ V = PoisonValue::get(CurTy); // Unknown unop.
} else {
V = BitcodeConstant::create(Alloc, CurTy, Opc, (unsigned)Record[1]);
}
@@ -3343,7 +3343,7 @@ Error BitcodeReader::parseConstants() {
return error("Invalid binary op constexpr record");
int Opc = getDecodedBinaryOpcode(Record[0], CurTy);
if (Opc < 0) {
- V = UndefValue::get(CurTy); // Unknown binop.
+ V = PoisonValue::get(CurTy); // Unknown binop.
} else {
uint8_t Flags = 0;
if (Record.size() >= 4) {
@@ -3373,7 +3373,7 @@ Error BitcodeReader::parseConstants() {
return error("Invalid cast constexpr record");
int Opc = getDecodedCastOpcode(Record[0]);
if (Opc < 0) {
- V = UndefValue::get(CurTy); // Unknown cast.
+ V = PoisonValue::get(CurTy); // Unknown cast.
} else {
unsigned OpTyID = Record[1];
Type *OpTy = getTypeByID(OpTyID);