[llvm-commits] [llvm] r56572 - in /llvm/trunk: include/llvm/CodeGen/ lib/CodeGen/AsmPrinter/ lib/Target/ARM/AsmPrinter/ lib/Target/Alpha/ lib/Target/CellSPU/ lib/Target/IA64/ lib/Target/Mips/ lib/Target/PowerPC/AsmPrinter/ lib/Target/Sparc/ lib/Target/X86/AsmPrinter/

Anton Korobeynikov asl at math.spbu.ru
Wed Sep 24 15:13:08 PDT 2008


Author: asl
Date: Wed Sep 24 17:13:07 2008
New Revision: 56572

URL: http://llvm.org/viewvc/llvm-project?rev=56572&view=rev
Log:
Drop obsolete hook and change all usage to new interface

Modified:
    llvm/trunk/include/llvm/CodeGen/AsmPrinter.h
    llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
    llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
    llvm/trunk/lib/Target/Alpha/AlphaAsmPrinter.cpp
    llvm/trunk/lib/Target/CellSPU/SPUAsmPrinter.cpp
    llvm/trunk/lib/Target/IA64/IA64AsmPrinter.cpp
    llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp
    llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
    llvm/trunk/lib/Target/Sparc/SparcAsmPrinter.cpp
    llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
    llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h
    llvm/trunk/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp
    llvm/trunk/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.h

Modified: llvm/trunk/include/llvm/CodeGen/AsmPrinter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/AsmPrinter.h?rev=56572&r1=56571&r2=56572&view=diff

==============================================================================
--- llvm/trunk/include/llvm/CodeGen/AsmPrinter.h (original)
+++ llvm/trunk/include/llvm/CodeGen/AsmPrinter.h Wed Sep 24 17:13:07 2008
@@ -184,12 +184,6 @@
                                        unsigned AsmVariant, 
                                        const char *ExtraCode);
     
-    /// getSectionForFunction - Return the section that we should emit the
-    /// specified function body into.  This defaults to 'TextSection'.  This
-    /// should most likely be overridden by the target to put linkonce/weak
-    /// functions into special sections.
-    virtual std::string getSectionForFunction(const Function &F) const;
-    
     /// SetupMachineFunction - This should be called when a new MachineFunction
     /// is being processed from runOnMachineFunction.
     void SetupMachineFunction(MachineFunction &MF);

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

==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Wed Sep 24 17:13:07 2008
@@ -47,11 +47,6 @@
                     E = GCMetadataPrinters.end(); I != E; ++I)
     delete I->second;
 }
-    
-std::string AsmPrinter::getSectionForFunction(const Function &F) const {
-  return TAI->getTextSection();
-}
-
 
 /// SwitchToTextSection - Switch to the specified text section of the executable
 /// if we are not already in it!
@@ -331,7 +326,7 @@
     // function body itself, otherwise the label differences won't make sense.
     // We should also do if the section name is NULL or function is declared in
     // discardable section.
-    SwitchToTextSection(getSectionForFunction(*F).c_str(), F);
+    SwitchToTextSection(TAI->SectionForGlobal(F).c_str(), F);
   } else {
     SwitchToDataSection(JumpTableDataSection);
   }

Modified: llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp?rev=56572&r1=56571&r2=56572&view=diff

==============================================================================
--- llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp Wed Sep 24 17:13:07 2008
@@ -130,10 +130,6 @@
     bool doInitialization(Module &M);
     bool doFinalization(Module &M);
 
-    /// getSectionForFunction - Return the section that we should emit the
-    /// specified function body into.
-    virtual std::string getSectionForFunction(const Function &F) const;
-
     /// EmitMachineConstantPoolValue - Print a machine constantpool value to
     /// the .s file.
     virtual void EmitMachineConstantPoolValue(MachineConstantPoolValue *MCPV) {
@@ -179,11 +175,6 @@
 
 #include "ARMGenAsmWriter.inc"
 
-// Substitute old hook with new one temporary
-std::string ARMAsmPrinter::getSectionForFunction(const Function &F) const {
-  return TAI->SectionForGlobal(&F);
-}
-
 /// runOnMachineFunction - This uses the printInstruction()
 /// method to print assembly for each instruction.
 ///

Modified: llvm/trunk/lib/Target/Alpha/AlphaAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AlphaAsmPrinter.cpp?rev=56572&r1=56571&r2=56572&view=diff

==============================================================================
--- llvm/trunk/lib/Target/Alpha/AlphaAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/Alpha/AlphaAsmPrinter.cpp Wed Sep 24 17:13:07 2008
@@ -149,7 +149,7 @@
 
   // Print out labels for the function.
   const Function *F = MF.getFunction();
-  SwitchToTextSection(getSectionForFunction(*F).c_str(), F);
+  SwitchToTextSection(TAI->SectionForGlobal(F).c_str(), F);
 
   EmitAlignment(4, F);
   switch (F->getLinkage()) {

Modified: llvm/trunk/lib/Target/CellSPU/SPUAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUAsmPrinter.cpp?rev=56572&r1=56571&r2=56572&view=diff

==============================================================================
--- llvm/trunk/lib/Target/CellSPU/SPUAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/CellSPU/SPUAsmPrinter.cpp Wed Sep 24 17:13:07 2008
@@ -297,9 +297,6 @@
       SPUAsmPrinter::getAnalysisUsage(AU);
     }
 
-    /// getSectionForFunction - Return the section that we should emit the
-    /// specified function body into.
-    virtual std::string getSectionForFunction(const Function &F) const;
   };
 } // end of anonymous namespace
 
@@ -406,19 +403,6 @@
   printInstruction(MI);
 }
 
-
-
-std::string LinuxAsmPrinter::getSectionForFunction(const Function &F) const {
-  switch (F.getLinkage()) {
-  default: assert(0 && "Unknown linkage type!");
-  case Function::ExternalLinkage:
-  case Function::InternalLinkage: return TAI->getTextSection();
-  case Function::WeakLinkage:
-  case Function::LinkOnceLinkage:
-    return ""; // Print nothing for the time being...
-  }
-}
-
 /// runOnMachineFunction - This uses the printMachineInstruction()
 /// method to print assembly for each instruction.
 ///
@@ -434,7 +418,7 @@
   // Print out labels for the function.
   const Function *F = MF.getFunction();
 
-  SwitchToTextSection(getSectionForFunction(*F).c_str(), F);
+  SwitchToTextSection(TAI->SectionForGlobal(F).c_str(), F);
   EmitAlignment(3, F);
 
   switch (F->getLinkage()) {

Modified: llvm/trunk/lib/Target/IA64/IA64AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/IA64/IA64AsmPrinter.cpp?rev=56572&r1=56571&r2=56572&view=diff

==============================================================================
--- llvm/trunk/lib/Target/IA64/IA64AsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/IA64/IA64AsmPrinter.cpp Wed Sep 24 17:13:07 2008
@@ -106,8 +106,6 @@
       printOp(MI->getOperand(OpNo), true); // this is a br.call instruction
     }
 
-    std::string getSectionForFunction(const Function &F) const;
-
     void printMachineInstruction(const MachineInstr *MI);
     void printOp(const MachineOperand &MO, bool isBRCALLinsn= false);
     void printModuleLevelGV(const GlobalVariable* GVar);
@@ -121,12 +119,6 @@
 // Include the auto-generated portion of the assembly writer.
 #include "IA64GenAsmWriter.inc"
 
-
-// Substitute old hook with new one temporary
-std::string IA64AsmPrinter::getSectionForFunction(const Function &F) const {
-  return TAI->SectionForGlobal(&F);
-}
-
 /// runOnMachineFunction - This uses the printMachineInstruction()
 /// method to print assembly for each instruction.
 ///
@@ -138,7 +130,7 @@
   EmitConstantPool(MF.getConstantPool());
 
   const Function *F = MF.getFunction();
-  SwitchToTextSection(getSectionForFunction(*F).c_str(), F);
+  SwitchToTextSection(TAI->SectionForGlobal(F).c_str(), F);
 
   // Print out labels for the function.
   EmitAlignment(5);

Modified: llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp?rev=56572&r1=56571&r2=56572&view=diff

==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp Wed Sep 24 17:13:07 2008
@@ -59,7 +59,6 @@
       return "Mips Assembly Printer";
     }
 
-    virtual std::string getSectionForFunction(const Function &F) const;
     bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo, 
                          unsigned AsmVariant, const char *ExtraCode);
     void printOperand(const MachineInstr *MI, int opNum);
@@ -219,11 +218,6 @@
   return NULL;
 }  
 
-// Substitute old hook with new one temporary
-std::string MipsAsmPrinter::getSectionForFunction(const Function &F) const {
-  return TAI->SectionForGlobal(&F);
-}
-
 /// Emit the directives used by GAS on the start of functions
 void MipsAsmPrinter::
 emitFunctionStart(MachineFunction &MF)

Modified: llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp?rev=56572&r1=56571&r2=56572&view=diff

==============================================================================
--- llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp Wed Sep 24 17:13:07 2008
@@ -315,9 +315,6 @@
       PPCAsmPrinter::getAnalysisUsage(AU);
     }
 
-    /// getSectionForFunction - Return the section that we should emit the
-    /// specified function body into.
-    virtual std::string getSectionForFunction(const Function &F) const;
     void printModuleLevelGV(const GlobalVariable* GVar);
   };
 
@@ -347,9 +344,6 @@
       PPCAsmPrinter::getAnalysisUsage(AU);
     }
 
-    /// getSectionForFunction - Return the section that we should emit the
-    /// specified function body into.
-    virtual std::string getSectionForFunction(const Function &F) const;
     void printModuleLevelGV(const GlobalVariable* GVar);
   };
 } // end of anonymous namespace
@@ -577,7 +571,7 @@
 
   // Print out labels for the function.
   const Function *F = MF.getFunction();
-  SwitchToTextSection(getSectionForFunction(*F).c_str(), F);
+  SwitchToTextSection(TAI->SectionForGlobal(F).c_str(), F);
 
   switch (F->getLinkage()) {
   default: assert(0 && "Unknown linkage type!");
@@ -753,14 +747,6 @@
   return AsmPrinter::doFinalization(M);
 }
 
-std::string PPCLinuxAsmPrinter::getSectionForFunction(const Function &F) const {
-  return TAI->SectionForGlobal(&F);
-}
-
-std::string PPCDarwinAsmPrinter::getSectionForFunction(const Function &F) const {
-  return TAI->SectionForGlobal(&F);
-}
-
 /// runOnMachineFunction - This uses the printMachineInstruction()
 /// method to print assembly for each instruction.
 ///
@@ -773,7 +759,7 @@
 
   // Print out labels for the function.
   const Function *F = MF.getFunction();
-  SwitchToTextSection(getSectionForFunction(*F).c_str(), F);
+  SwitchToTextSection(TAI->SectionForGlobal(F).c_str(), F);
 
   switch (F->getLinkage()) {
   default: assert(0 && "Unknown linkage type!");

Modified: llvm/trunk/lib/Target/Sparc/SparcAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcAsmPrinter.cpp?rev=56572&r1=56571&r2=56572&view=diff

==============================================================================
--- llvm/trunk/lib/Target/Sparc/SparcAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/Sparc/SparcAsmPrinter.cpp Wed Sep 24 17:13:07 2008
@@ -63,7 +63,6 @@
 
     bool printInstruction(const MachineInstr *MI);  // autogenerated.
     bool runOnMachineFunction(MachineFunction &F);
-    std::string getSectionForFunction(const Function &F) const;
     bool doInitialization(Module &M);
     bool doFinalization(Module &M);
   };
@@ -81,11 +80,6 @@
   return new SparcAsmPrinter(o, tm, tm.getTargetAsmInfo());
 }
 
-// Substitute old hook with new one temporary
-std::string SparcAsmPrinter::getSectionForFunction(const Function &F) const {
-  return TAI->SectionForGlobal(&F);
-}
-
 /// runOnMachineFunction - This uses the printInstruction()
 /// method to print assembly for each instruction.
 ///
@@ -105,7 +99,7 @@
 
   // Print out the label for the function.
   const Function *F = MF.getFunction();
-  SwitchToTextSection(getSectionForFunction(*F).c_str(), F);
+  SwitchToTextSection(TAI->SectionForGlobal(F).c_str(), F);
   EmitAlignment(4, F);
   O << "\t.globl\t" << CurrentFnName << '\n';
 

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=56572&r1=56571&r2=56572&view=diff

==============================================================================
--- llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp Wed Sep 24 17:13:07 2008
@@ -146,11 +146,6 @@
   }
 }
 
-// Substitute old hook with new one temporary
-std::string X86ATTAsmPrinter::getSectionForFunction(const Function &F) const {
-  return TAI->SectionForGlobal(&F);
-}
-
 void X86ATTAsmPrinter::emitFunctionHeader(const MachineFunction &MF) {
   const Function *F = MF.getFunction();
   std::string SectionName = TAI->SectionForGlobal(F);

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

==============================================================================
--- llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h (original)
+++ llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h Wed Sep 24 17:13:07 2008
@@ -124,10 +124,6 @@
 
   bool runOnMachineFunction(MachineFunction &F);
 
-  /// getSectionForFunction - Return the section that we should emit the
-  /// specified function body into.
-  virtual std::string getSectionForFunction(const Function &F) const;
-
   void emitFunctionHeader(const MachineFunction &MF);
 
   // Necessary for Darwin to print out the apprioriate types of linker stubs

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

==============================================================================
--- llvm/trunk/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp Wed Sep 24 17:13:07 2008
@@ -117,12 +117,6 @@
   }
 }
 
-
-std::string X86IntelAsmPrinter::getSectionForFunction(const Function &F) const {
-  // Intel asm always emits functions to _text.
-  return "_text";
-}
-
 /// runOnMachineFunction - This uses the printMachineInstruction()
 /// method to print assembly for each instruction.
 ///
@@ -144,7 +138,7 @@
 
   decorateName(CurrentFnName, F);
 
-  SwitchToTextSection(getSectionForFunction(*F).c_str(), F);
+  SwitchToTextSection("_text", F);
 
   unsigned FnAlign = OptimizeForSize ? 1 : 4;
   if (!F->isDeclaration() && F->hasNote(FnAttr::OptimizeForSize))

Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.h?rev=56572&r1=56571&r2=56572&view=diff

==============================================================================
--- llvm/trunk/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.h (original)
+++ llvm/trunk/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.h Wed Sep 24 17:13:07 2008
@@ -131,10 +131,6 @@
 
   void decorateName(std::string& Name, const GlobalValue* GV);
 
-  /// getSectionForFunction - Return the section that we should emit the
-  /// specified function body into.
-  virtual std::string getSectionForFunction(const Function &F) const;
-
   virtual void EmitString(const ConstantArray *CVA) const;
 
   // Necessary for dllexport support





More information about the llvm-commits mailing list