[llvm-commits] [llvm] r74090 - /llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp

Chris Lattner sabre at nondot.org
Wed Jun 24 11:17:12 PDT 2009


Author: lattner
Date: Wed Jun 24 13:17:00 2009
New Revision: 74090

URL: http://llvm.org/viewvc/llvm-project?rev=74090&view=rev
Log:
simplify personality function stub printing to use the mangler and 
decorateName like other stuff instead of special casing _.  Also, stick
it into GVStubs and let the normal stub printer print the stub instead 
of doing it manually.

Modified:
    llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp

Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp?rev=74090&r1=74089&r2=74090&view=diff

==============================================================================
--- llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp Wed Jun 24 13:17:00 2009
@@ -1134,9 +1134,8 @@
          i != e; ++i)
     O << "\t.ascii \" -export:" << i->getKeyData() << ",data\"\n";
 
-  if (!DLLExportedFns.empty()) {
+  if (!DLLExportedFns.empty())
     SwitchToDataSection(".section .drectve");
-  }
 
   for (StringSet<>::iterator i = DLLExportedFns.begin(),
          e = DLLExportedFns.end();
@@ -1162,20 +1161,21 @@
 
     // Print global value stubs.
     bool InStubSection = false;
+    // Add the (possibly multiple) personalities to the set of global value
+    // stubs.  Only referenced functions get into the Personalities list.
     if (TAI->doesSupportExceptionHandling() && MMI && !Subtarget->is64Bit()) {
-      // Add the (possibly multiple) personalities to the set of global values.
-      // Only referenced functions get into the Personalities list.
-      const std::vector<Function *>& Personalities = MMI->getPersonalities();
-      for (std::vector<Function *>::const_iterator I = Personalities.begin(),
-             E = Personalities.end(); I != E; ++I) {
-        if (!*I)
+      const std::vector<Function*> &Personalities = MMI->getPersonalities();
+      for (unsigned i = 0, e = Personalities.size(); i != e; ++i) {
+        if (Personalities[i] == 0)
           continue;
         if (!InStubSection) {
           SwitchToDataSection(
                      "\t.section __IMPORT,__pointers,non_lazy_symbol_pointers");
           InStubSection = true;
         }
-        printGVStub((*I)->getNameStart(), "_");
+        std::string Name = Mang->getValueName(Personalities[i]);
+        decorateName(Name, Personalities[i]);
+        GVStubs.insert(Name);
       }
     }
 





More information about the llvm-commits mailing list