Make EH work with unnamed functions. Reenable running
authorDale Johannesen <dalej@apple.com>
Wed, 2 Apr 2008 20:10:52 +0000 (20:10 +0000)
committerDale Johannesen <dalej@apple.com>
Wed, 2 Apr 2008 20:10:52 +0000 (20:10 +0000)
StripSymbols when EH is on.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49110 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter.cpp
tools/lto/lto.cpp

index c00d4d197c8fc01da4894e3688038a62f7290750..65b8c436f78e9d4b2330c072f429fda249a77af0 100644 (file)
@@ -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) {
index 71bd9e6bf29b03e93215635db1af16f0860fe031..ff9ba91d4ea124c0351a9289a06360128fca1c72 100644 (file)
@@ -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());