This is the start of the new SjLj EH preparation pass, which will replace the
[oota-llvm.git] / lib / Target / ARM / ARMTargetMachine.cpp
index 78a6a4381a82897e8ea704c986bcc02516e23a89..a75ce264cd3c7a477e88703d51b8220c15d37ed6 100644 (file)
@@ -15,6 +15,7 @@
 #include "ARM.h"
 #include "llvm/PassManager.h"
 #include "llvm/CodeGen/Passes.h"
+#include "llvm/MC/MCAsmInfo.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/FormattedStream.h"
 #include "llvm/Support/TargetRegistry.h"
@@ -107,7 +108,8 @@ bool ARMBaseTargetMachine::addPreRegAlloc(PassManagerBase &PM,
     PM.add(createARMLoadStoreOptimizationPass(true));
   if (OptLevel != CodeGenOpt::None && Subtarget.isCortexA9())
     PM.add(createMLxExpansionPass());
-
+  if (getMCAsmInfo()->getExceptionHandlingType() == ExceptionHandling::SjLj)
+    createARMSjLjLoweringPass();
   return true;
 }