diff options
author | David Majnemer <david.majnemer@gmail.com> | 2015-04-03 22:49:05 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2015-04-03 22:49:05 +0000 |
commit | 69132a7fb28600d47e43f4f776f6352856efb967 (patch) | |
tree | bb88146212e608f5539f5c172f30c81faab375ef /llvm/lib/CodeGen/WinEHPrepare.cpp | |
parent | 3337064a47a7fbc1e40c41975a8fe084493fd759 (diff) | |
download | bcm5719-llvm-69132a7fb28600d47e43f4f776f6352856efb967.tar.gz bcm5719-llvm-69132a7fb28600d47e43f4f776f6352856efb967.zip |
[WinEH] Fill out .xdata for catch objects
This add support for catching an exception such that an exception object
available to the catch handler will be initialized by the runtime.
llvm-svn: 234062
Diffstat (limited to 'llvm/lib/CodeGen/WinEHPrepare.cpp')
-rw-r--r-- | llvm/lib/CodeGen/WinEHPrepare.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/WinEHPrepare.cpp b/llvm/lib/CodeGen/WinEHPrepare.cpp index d12a8ed472b..9ebe8a2fc10 100644 --- a/llvm/lib/CodeGen/WinEHPrepare.cpp +++ b/llvm/lib/CodeGen/WinEHPrepare.cpp @@ -1595,7 +1595,7 @@ CleanupHandler *WinEHPrepare::findCleanupHandler(BasicBlock *StartBB, // This is a public function, declared in WinEHFuncInfo.h and is also // referenced by WinEHNumbering in FunctionLoweringInfo.cpp. void llvm::parseEHActions(const IntrinsicInst *II, - SmallVectorImpl<ActionHandler *> &Actions) { + SmallVectorImpl<ActionHandler *> &Actions) { for (unsigned I = 0, E = II->getNumArgOperands(); I != E;) { uint64_t ActionKind = cast<ConstantInt>(II->getArgOperand(I))->getZExtValue(); @@ -1609,14 +1609,14 @@ void llvm::parseEHActions(const IntrinsicInst *II, CH->setHandlerBlockOrFunc(Handler); CH->setExceptionVarIndex(EHObjIndexVal); Actions.push_back(CH); - } - else { - assert(ActionKind == 0 && "expected a cleanup or a catch action!"); + } else if (ActionKind == 0) { Constant *Handler = cast<Constant>(II->getArgOperand(I + 1)); I += 2; auto *CH = new CleanupHandler(/*BB=*/nullptr); CH->setHandlerBlockOrFunc(Handler); Actions.push_back(CH); + } else { + llvm_unreachable("Expected either a catch or cleanup handler!"); } } std::reverse(Actions.begin(), Actions.end()); |