aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r--llvm/lib/Bitcode/Reader/BitcodeReader.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
index b9604af..be39b88 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -3999,6 +3999,25 @@ std::error_code BitcodeReader::parseFunctionBody(Function *F) {
InstructionList.push_back(I);
break;
}
+ case bitc::FUNC_CODE_INST_CLEANUPENDPAD: { // CLEANUPENDPADINST: [val] or [val,bb#]
+ if (Record.size() != 1 && Record.size() != 2)
+ return error("Invalid record");
+ unsigned Idx = 0;
+ Value *CleanupPad = getValue(Record, Idx++, NextValueNo,
+ Type::getTokenTy(Context), OC_CleanupPad);
+ if (!CleanupPad)
+ return error("Invalid record");
+
+ BasicBlock *BB = nullptr;
+ if (Record.size() == 2) {
+ BB = getBasicBlock(Record[Idx++]);
+ if (!BB)
+ return error("Invalid record");
+ }
+ I = CleanupEndPadInst::Create(cast<CleanupPadInst>(CleanupPad), BB);
+ InstructionList.push_back(I);
+ break;
+ }
case bitc::FUNC_CODE_INST_SWITCH: { // SWITCH: [opty, op0, op1, ...]
// Check magic
if ((Record[0] >> 16) == SWITCH_INST_MAGIC) {