The DWARF EH pass doesn't need the TargetMachine, only the TargetLoweringBase like...
authorBill Wendling <isanbard@gmail.com>
Mon, 20 May 2013 21:54:18 +0000 (21:54 +0000)
committerBill Wendling <isanbard@gmail.com>
Mon, 20 May 2013 21:54:18 +0000 (21:54 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182321 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/Passes.h
lib/CodeGen/DwarfEHPrepare.cpp
lib/CodeGen/Passes.cpp

index b02f63e70b9fce83cbc45996911875d2258b99ca..7ec90ae55ee030ec0c06724b77d162c9ab3908ab 100644 (file)
@@ -527,7 +527,7 @@ namespace llvm {
 
   /// createDwarfEHPass - This pass mulches exception handling code into a form
   /// adapted to code generation.  Required if using dwarf exception handling.
-  FunctionPass *createDwarfEHPass(const TargetMachine *tm);
+  FunctionPass *createDwarfEHPass(const TargetLoweringBase *tli);
 
   /// createSjLjEHPreparePass - This pass adapts exception handling code to use
   /// the GCC-style builtin setjmp/longjmp (sjlj) to handling EH control flow.
index 31c8e5948d974faf61869572b95a29ea9a2acf12..ecfe6f3f46938da411a88a297f91247c8ba38f60 100644 (file)
@@ -42,8 +42,8 @@ namespace {
 
   public:
     static char ID; // Pass identification, replacement for typeid.
-    DwarfEHPrepare(const TargetMachine *TM) :
-      FunctionPass(ID), TLI(TM->getTargetLowering()), RewindFunction(0) {
+    DwarfEHPrepare(const TargetLoweringBase *TLI) :
+      FunctionPass(ID), TLI(TLI), RewindFunction(0) {
         initializeDominatorTreePass(*PassRegistry::getPassRegistry());
       }
 
@@ -59,8 +59,8 @@ namespace {
 
 char DwarfEHPrepare::ID = 0;
 
-FunctionPass *llvm::createDwarfEHPass(const TargetMachine *tm) {
-  return new DwarfEHPrepare(tm);
+FunctionPass *llvm::createDwarfEHPass(const TargetLoweringBase *TLI) {
+  return new DwarfEHPrepare(TLI);
 }
 
 /// GetExceptionObject - Return the exception object from the value passed into
index bfbc0623f9cc4716da58f4f23f80a13ad6a531c5..1a6b62b8f37fde537a5aae64a9120e0a98a77a64 100644 (file)
@@ -401,7 +401,7 @@ void TargetPassConfig::addPassesToHandleExceptions() {
   case ExceptionHandling::DwarfCFI:
   case ExceptionHandling::ARM:
   case ExceptionHandling::Win64:
-    addPass(createDwarfEHPass(TM));
+    addPass(createDwarfEHPass(TM->getTargetLowering()));
     break;
   case ExceptionHandling::None:
     addPass(createLowerInvokePass(TM->getTargetLowering()));