Index: llvm/include/llvm/Bitcode/LLVMBitCodes.h =================================================================== --- llvm/include/llvm/Bitcode/LLVMBitCodes.h +++ llvm/include/llvm/Bitcode/LLVMBitCodes.h @@ -392,6 +392,7 @@ // sideeffect|alignstack| // asmdialect|unwind, // asmstr,conststr] + CST_CODE_UNKNOWN_PROVENANCE = 31, // UNKNOWN_PROVENANCE }; /// CastOpcodes - These are values used in the bitcode files to encode which Index: llvm/lib/Bitcode/Reader/BitcodeReader.cpp =================================================================== --- llvm/lib/Bitcode/Reader/BitcodeReader.cpp +++ llvm/lib/Bitcode/Reader/BitcodeReader.cpp @@ -2872,6 +2872,11 @@ case bitc::CST_CODE_UNDEF: // UNDEF V = UndefValue::get(CurTy); break; + case bitc::CST_CODE_UNKNOWN_PROVENANCE: // UNKNOWN_PROVENANCE + if (!CurTy->isPointerTy()) + return error("Invalid type for a unknown_provenance"); + V = UnknownProvenance::get(cast(CurTy)); + break; case bitc::CST_CODE_POISON: // POISON V = PoisonValue::get(CurTy); break; Index: llvm/lib/Bitcode/Writer/BitcodeWriter.cpp =================================================================== --- llvm/lib/Bitcode/Writer/BitcodeWriter.cpp +++ llvm/lib/Bitcode/Writer/BitcodeWriter.cpp @@ -2511,6 +2511,8 @@ Code = bitc::CST_CODE_POISON; } else if (isa(C)) { Code = bitc::CST_CODE_UNDEF; + } else if (isa(C)) { + Code = bitc::CST_CODE_UNKNOWN_PROVENANCE; } else if (const ConstantInt *IV = dyn_cast(C)) { if (IV->getBitWidth() <= 64) { uint64_t V = IV->getSExtValue();