llvm.org GIT mirror llvm / 707c12c
[WinEH] Don't perform state stores in cleanups Our cleanups do not support true lexical nesting of funclets which obviates the need to perform state stores. This fixes PR26361. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259161 91177308-0d34-0410-b5e6-96231b3b80d8 David Majnemer 4 years ago
4 changed file(s) with 4 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
424424 BasicBlock *FuncletEntryBB = BBColors.front();
425425 if (auto *FuncletPad =
426426 dyn_cast(FuncletEntryBB->getFirstNonPHI())) {
427 // We do not support nesting funclets within cleanuppads.
428 if (isa(FuncletPad))
429 continue;
430
427431 auto BaseStateI = FuncInfo.FuncletBaseStateMap.find(FuncletPad);
428432 if (BaseStateI != FuncInfo.FuncletBaseStateMap.end())
429433 BaseState = BaseStateI->second;
4343 to label %exit unwind label %cleanup.pad
4444 cleanup.pad:
4545 ; CHECK: cleanup.pad:
46 ; CHECK: store i32 1
4746 ; CHECK: invoke void @f(i32 0)
4847 %cleanup = cleanuppad within none []
4948 invoke void @f(i32 0)
119119 ehcleanup: ; preds = %catch.dispatch1
120120 %4 = cleanuppad within %1 []
121121 ; CHECK: ehcleanup:
122 ; CHECK: store i32 -1
123122 ; CHECK: call void @dtor()
124123 call void @dtor() #3 [ "funclet"(token %4) ]
125124 cleanupret from %4 unwind to caller
5555 ; CHECK: LBB0_[[inner:[0-9]+]]: # %ehcleanup
5656 ; CHECK: pushl %ebp
5757 ; CHECK: addl $12, %ebp
58 ; CHECK: movl $0, -[[state]](%ebp)
5958 ; CHECK: movl $2, (%esp)
6059 ; CHECK: calll _f
6160 ; CHECK: popl %ebp
6463 ; CHECK: LBB0_[[outer:[0-9]+]]: # %ehcleanup.3
6564 ; CHECK: pushl %ebp
6665 ; CHECK: addl $12, %ebp
67 ; CHECK: movl $-1, -[[state]](%ebp)
6866 ; CHECK: movl $3, (%esp)
6967 ; CHECK: calll _f
7068 ; CHECK: popl %ebp