From 7d02cf3c9c23727be1e837ce3e2a6cc7ecaf1636 Mon Sep 17 00:00:00 2001 From: Dale Johannesen Date: Mon, 31 Mar 2008 23:40:23 +0000 Subject: 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 --- llvm/lib/Transforms/Utils/LowerInvoke.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'llvm/lib/Transforms') 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 #include 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 -- cgit v1.2.3