summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
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
commit7d02cf3c9c23727be1e837ce3e2a6cc7ecaf1636 (patch)
tree55529d204c6f6539a6f42d40457693279a0f8dff /llvm/lib/Transforms
parenta9590d1c0d0f99702a16cf387cf53f28803c962f (diff)
downloadbcm5719-llvm-7d02cf3c9c23727be1e837ce3e2a6cc7ecaf1636.tar.gz
bcm5719-llvm-7d02cf3c9c23727be1e837ce3e2a6cc7ecaf1636.zip
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. llvm-svn: 49006
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Utils/LowerInvoke.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/LowerInvoke.cpp b/llvm/lib/Transforms/Utils/LowerInvoke.cpp
index 7f0ef85d75f..f546c332729 100644
--- a/llvm/lib/Transforms/Utils/LowerInvoke.cpp
+++ b/llvm/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
OpenPOWER on IntegriCloud