mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 04:38:24 +00:00
[WinEH] Handle a landingpad, resume, and cleanup all rolled into a BB
This happens a lot with simple cleanups after SimplifyCFG. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235117 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -1582,11 +1582,10 @@ void WinEHPrepare::findCleanupHandlers(LandingPadActions &Actions,
|
||||
InsertValueInst *Insert1 = nullptr;
|
||||
InsertValueInst *Insert2 = nullptr;
|
||||
Value *ResumeVal = Resume->getOperand(0);
|
||||
// If there is only one landingpad, we may use the lpad directly with no
|
||||
// insertions.
|
||||
if (isa<LandingPadInst>(ResumeVal))
|
||||
return;
|
||||
if (!isa<PHINode>(ResumeVal)) {
|
||||
// If the resume value isn't a phi or landingpad value, it should be a
|
||||
// series of insertions. Identify them so we can avoid them when scanning
|
||||
// for cleanups.
|
||||
if (!isa<PHINode>(ResumeVal) && !isa<LandingPadInst>(ResumeVal)) {
|
||||
Insert2 = dyn_cast<InsertValueInst>(ResumeVal);
|
||||
if (!Insert2)
|
||||
return createCleanupHandler(Actions, CleanupHandlerMap, BB);
|
||||
@ -1702,7 +1701,6 @@ void WinEHPrepare::findCleanupHandlers(LandingPadActions &Actions,
|
||||
return;
|
||||
BB = Branch->getSuccessor(0);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// This is a public function, declared in WinEHFuncInfo.h and is also
|
||||
|
Reference in New Issue
Block a user