Enable exception handling if it is supported.
authorDevang Patel <dpatel@apple.com>
Wed, 30 Jan 2008 17:43:03 +0000 (17:43 +0000)
committerDevang Patel <dpatel@apple.com>
Wed, 30 Jan 2008 17:43:03 +0000 (17:43 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46560 91177308-0d34-0410-b5e6-96231b3b80d8

tools/lto/lto.cpp

index 99024589f19bbb6bfd648810793ada12d6a0c9d1..963c67ee7d9f5363539afb9023f032c964d7650e 100644 (file)
@@ -31,6 +31,7 @@
 #include "llvm/Analysis/Verifier.h"
 #include "llvm/CodeGen/FileWriters.h"
 #include "llvm/Target/SubtargetFeature.h"
+#include "llvm/Target/TargetOptions.h"
 #include "llvm/Target/TargetData.h"
 #include "llvm/Target/TargetMachine.h"
 #include "llvm/Target/TargetMachineRegistry.h"
@@ -266,7 +267,11 @@ LTO::optimize(Module *M, std::ostream &Out,
 
   if (!Target)
     return LTO_NO_TARGET;
-  
+
+  // If target supports exception handling then enable it now.
+  if (Target->getTargetAsmInfo()->doesSupportExceptionHandling())
+    ExceptionHandling = true;
+
   // Start off with a verification pass.
   Passes.add(createVerifierPass());