diff options
author | Dale Johannesen <dalej@apple.com> | 2008-04-02 20:10:52 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@apple.com> | 2008-04-02 20:10:52 +0000 |
commit | e73bcbb57b0bebe06a2e97c538b61ce2a432f07c (patch) | |
tree | cccb9e86970f781fc997c35cb9c7de93d1e1293e | |
parent | a2245affc1c04d3948f99ded7ae022d0e35779ff (diff) | |
download | external_llvm-e73bcbb57b0bebe06a2e97c538b61ce2a432f07c.zip external_llvm-e73bcbb57b0bebe06a2e97c538b61ce2a432f07c.tar.gz external_llvm-e73bcbb57b0bebe06a2e97c538b61ce2a432f07c.tar.bz2 |
Make EH work with unnamed functions. Reenable running
StripSymbols when EH is on.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49110 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/AsmPrinter.cpp | 6 | ||||
-rw-r--r-- | tools/lto/lto.cpp | 5 |
2 files changed, 5 insertions, 6 deletions
diff --git a/lib/CodeGen/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter.cpp index c00d4d1..65b8c43 100644 --- a/lib/CodeGen/AsmPrinter.cpp +++ b/lib/CodeGen/AsmPrinter.cpp @@ -198,8 +198,10 @@ bool AsmPrinter::doFinalization(Module &M) { std::string AsmPrinter::getCurrentFunctionEHName(const MachineFunction *MF) { assert(MF && "No machine function?"); - return Mang->makeNameProper(MF->getFunction()->getName() + ".eh", - TAI->getGlobalPrefix()); + std::string Name = MF->getFunction()->getName(); + if (Name.empty()) + Name = Mang->getValueName(MF->getFunction()); + return Mang->makeNameProper(Name + ".eh", TAI->getGlobalPrefix()); } void AsmPrinter::SetupMachineFunction(MachineFunction &MF) { diff --git a/tools/lto/lto.cpp b/tools/lto/lto.cpp index 71bd9e6..ff9ba91 100644 --- a/tools/lto/lto.cpp +++ b/tools/lto/lto.cpp @@ -303,10 +303,7 @@ LTO::optimize(Module *M, std::ostream &Out, // If the -s command line option was specified, strip the symbols out of the // resulting program to make it smaller. -s is a GLD option that we are // supporting. - if(!ExceptionHandling) - // FIXME : This causes multiple nameless _.eh symbols on - // darwin when EH is ON. - Passes.add(createStripSymbolsPass()); + Passes.add(createStripSymbolsPass()); // Propagate constants at call sites into the functions they call. Passes.add(createIPConstantPropagationPass()); |