[llvm] r261420 - Move some code from doInitialization to runOnFunction

David Majnemer via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 19 23:34:22 PST 2016


Author: majnemer
Date: Sat Feb 20 01:34:21 2016
New Revision: 261420

URL: http://llvm.org/viewvc/llvm-project?rev=261420&view=rev
Log:
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.

Modified:
    llvm/trunk/lib/Target/X86/X86WinEHState.cpp

Modified: llvm/trunk/lib/Target/X86/X86WinEHState.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86WinEHState.cpp?rev=261420&r1=261419&r2=261420&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86WinEHState.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86WinEHState.cpp Sat Feb 20 01:34:21 2016
@@ -114,9 +114,6 @@ INITIALIZE_PASS(WinEHStatePass, "x86-win
 
 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(Funct
   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?




More information about the llvm-commits mailing list