aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Utils/LowerInvoke.cpp
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2008-03-31 23:40:23 +0000
committerDale Johannesen <dalej@apple.com>2008-03-31 23:40:23 +0000
commit1544e4713be68edcf042de5aed7265dff7169d9d (patch)
tree21bb1802da1e2ff5e6c426b200ee4f75f87cb0c0 /lib/Transforms/Utils/LowerInvoke.cpp
parent1d3863fdbcc37f98d72408b59f6aef3243f36d7f (diff)
Emit exception handling info for functions which are
not marked nounwind, or for all functions when -enable-eh is set, provided the target supports Dwarf EH. llvm-gcc generates nounwind in the right places; other FEs will need to do so also. Given such a FE, -enable-eh should no longer be needed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49006 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils/LowerInvoke.cpp')
-rw-r--r--lib/Transforms/Utils/LowerInvoke.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Transforms/Utils/LowerInvoke.cpp b/lib/Transforms/Utils/LowerInvoke.cpp
index 7f0ef85d75..f546c33272 100644
--- a/lib/Transforms/Utils/LowerInvoke.cpp
+++ b/lib/Transforms/Utils/LowerInvoke.cpp
@@ -47,6 +47,9 @@
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Target/TargetLowering.h"
+#include "llvm/Target/TargetOptions.h"
+#include "llvm/Target/TargetMachine.h"
+#include "llvm/Target/TargetAsmInfo.h"
#include <csetjmp>
#include <set>
using namespace llvm;
@@ -592,6 +595,12 @@ bool LowerInvoke::insertExpensiveEHSupport(Function &F) {
}
bool LowerInvoke::runOnFunction(Function &F) {
+ // If we will be generating exception info, don't do anything here.
+ if ((ExceptionHandling || !F.doesNotThrow()) &&
+ TLI &&
+ TLI->getTargetMachine().getTargetAsmInfo()->
+ doesSupportExceptionHandling())
+ return false;
if (ExpensiveEHSupport)
return insertExpensiveEHSupport(F);
else