[llvm-commits] [llvm] r49110 - in /llvm/trunk: lib/CodeGen/AsmPrinter.cpp tools/lto/lto.cpp

Dale Johannesen dalej at apple.com
Wed Apr 2 13:10:53 PDT 2008


Author: johannes
Date: Wed Apr  2 15:10:52 2008
New Revision: 49110

URL: http://llvm.org/viewvc/llvm-project?rev=49110&view=rev
Log:
Make EH work with unnamed functions.  Reenable running
StripSymbols when EH is on.


Modified:
    llvm/trunk/lib/CodeGen/AsmPrinter.cpp
    llvm/trunk/tools/lto/lto.cpp

Modified: llvm/trunk/lib/CodeGen/AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter.cpp?rev=49110&r1=49109&r2=49110&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter.cpp Wed Apr  2 15:10:52 2008
@@ -198,8 +198,10 @@
 
 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) {

Modified: llvm/trunk/tools/lto/lto.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lto/lto.cpp?rev=49110&r1=49109&r2=49110&view=diff

==============================================================================
--- llvm/trunk/tools/lto/lto.cpp (original)
+++ llvm/trunk/tools/lto/lto.cpp Wed Apr  2 15:10:52 2008
@@ -303,10 +303,7 @@
   // 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());





More information about the llvm-commits mailing list