forked from OSchip/llvm-project
[WinEH] Ignore filter clauses while mapping landing pad blocks.
llvm-svn: 235656
This commit is contained in:
parent
fed74298cb
commit
20ae2a311f
|
@ -1666,6 +1666,12 @@ void WinEHPrepare::mapLandingPadBlocks(LandingPadInst *LPad,
|
||||||
while (HandlersFound != NumClauses) {
|
while (HandlersFound != NumClauses) {
|
||||||
BasicBlock *NextBB = nullptr;
|
BasicBlock *NextBB = nullptr;
|
||||||
|
|
||||||
|
// Skip over filter clauses.
|
||||||
|
if (LPad->isFilter(HandlersFound)) {
|
||||||
|
++HandlersFound;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// See if the clause we're looking for is a catch-all.
|
// See if the clause we're looking for is a catch-all.
|
||||||
// If so, the catch begins immediately.
|
// If so, the catch begins immediately.
|
||||||
Constant *ExpectedSelector = LPad->getClause(HandlersFound)->stripPointerCasts();
|
Constant *ExpectedSelector = LPad->getClause(HandlersFound)->stripPointerCasts();
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
; RUN: llc -O0 -mtriple=x86_64-windows-msvc < %s | FileCheck %s
|
||||||
|
|
||||||
|
declare void @g()
|
||||||
|
define void @f() {
|
||||||
|
invoke void @g() to label %return unwind label %lpad
|
||||||
|
|
||||||
|
return:
|
||||||
|
ret void
|
||||||
|
|
||||||
|
lpad:
|
||||||
|
%ehptrs = landingpad {i8*, i32} personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*)
|
||||||
|
filter [0 x i8*] zeroinitializer
|
||||||
|
call void @__cxa_call_unexpected(i8* null)
|
||||||
|
unreachable
|
||||||
|
}
|
||||||
|
declare i32 @__C_specific_handler(...)
|
||||||
|
declare void @__cxa_call_unexpected(i8*)
|
||||||
|
|
||||||
|
; We don't emit entries for filters.
|
||||||
|
; CHECK: .seh_handlerdata
|
||||||
|
; CHECK: .long 0
|
Loading…
Reference in New Issue