Move some code from doInitialization to runOnFunction

This has no observable behavior change, it just makes the state
insertion pass look a little more like normal passes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261420 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Majnemer 2016-02-20 07:34:21 +00:00
parent f150810c18
commit 92a8732c27

View File

@ -114,9 +114,6 @@ INITIALIZE_PASS(WinEHStatePass, "x86-winehstate",
bool WinEHStatePass::doInitialization(Module &M) {
TheModule = &M;
FrameEscape = Intrinsic::getDeclaration(TheModule, Intrinsic::localescape);
FrameRecover = Intrinsic::getDeclaration(TheModule, Intrinsic::localrecover);
FrameAddress = Intrinsic::getDeclaration(TheModule, Intrinsic::frameaddress);
return false;
}
@ -162,6 +159,10 @@ bool WinEHStatePass::runOnFunction(Function &F) {
if (!HasPads)
return false;
FrameEscape = Intrinsic::getDeclaration(TheModule, Intrinsic::localescape);
FrameRecover = Intrinsic::getDeclaration(TheModule, Intrinsic::localrecover);
FrameAddress = Intrinsic::getDeclaration(TheModule, Intrinsic::frameaddress);
// Disable frame pointer elimination in this function.
// FIXME: Do the nested handlers need to keep the parent ebp in ebp, or can we
// use an arbitrary register?