[llvm-commits] CVS: llvm/lib/Target/X86/X86IntelAsmPrinter.cpp X86IntelAsmPrinter.h

Jeff Cohen jeffc at jolt-lang.org
Mon May 1 20:58:59 PDT 2006



Changes in directory llvm/lib/Target/X86:

X86IntelAsmPrinter.cpp updated: 1.34 -> 1.35
X86IntelAsmPrinter.h updated: 1.18 -> 1.19
---
Log message:

De-virtualize SwitchSection.

---
Diffs of the changes:  (+2 -27)

 X86IntelAsmPrinter.cpp |   28 ++--------------------------
 X86IntelAsmPrinter.h   |    1 -
 2 files changed, 2 insertions(+), 27 deletions(-)


Index: llvm/lib/Target/X86/X86IntelAsmPrinter.cpp
diff -u llvm/lib/Target/X86/X86IntelAsmPrinter.cpp:1.34 llvm/lib/Target/X86/X86IntelAsmPrinter.cpp:1.35
--- llvm/lib/Target/X86/X86IntelAsmPrinter.cpp:1.34	Mon May  1 22:46:13 2006
+++ llvm/lib/Target/X86/X86IntelAsmPrinter.cpp	Mon May  1 22:58:45 2006
@@ -28,6 +28,7 @@
   GlobalPrefix = "_";
   PrivateGlobalPrefix = "$";
   AlignDirective = "\talign\t";
+  MLSections = true;
   ZeroDirective = "\tdb\t";
   ZeroDirectiveSuffix = " dup(0)";
   AsciiDirective = "\tdb\t";
@@ -443,36 +444,11 @@
 
 bool X86IntelAsmPrinter::doFinalization(Module &M) {
   X86SharedAsmPrinter::doFinalization(M);
-  if (CurrentSection != "")
-    O << CurrentSection << "\tends\n";
+  SwitchSection("", 0);
   O << "\tend\n";
   return false;
 }
 
-void X86IntelAsmPrinter::SwitchSection(const char *NewSection,
-                                       const GlobalValue *GV) {
-  if (*NewSection == 0)
-    return;
-  
-  std::string NS;
-  bool isData = strcmp(NewSection , ".data") == 0;
-
-  if (GV && GV->hasSection())
-    NS = GV->getSection();
-  else if (isData)
-    NS = "_data";
-  else
-    NS = "_text";
-
-  if (CurrentSection != NS) {
-    if (CurrentSection != "")
-      O << CurrentSection << "\tends\n";
-    CurrentSection = NS;
-    O << CurrentSection << (isData ? "\tsegment 'DATA'\n"
-                                   : "\tsegment 'CODE'\n");
-  }
-}
-
 void X86IntelAsmPrinter::EmitString(const ConstantArray *CVA) const {
   unsigned NumElts = CVA->getNumOperands();
   if (NumElts) {


Index: llvm/lib/Target/X86/X86IntelAsmPrinter.h
diff -u llvm/lib/Target/X86/X86IntelAsmPrinter.h:1.18 llvm/lib/Target/X86/X86IntelAsmPrinter.h:1.19
--- llvm/lib/Target/X86/X86IntelAsmPrinter.h:1.18	Mon May  1 22:46:13 2006
+++ llvm/lib/Target/X86/X86IntelAsmPrinter.h	Mon May  1 22:58:45 2006
@@ -92,7 +92,6 @@
   bool doInitialization(Module &M);
   bool doFinalization(Module &M);
 
-  virtual void SwitchSection(const char *NewSection, const GlobalValue *GV);
   virtual void EmitString(const ConstantArray *CVA) const;
 };
 






More information about the llvm-commits mailing list