[llvm-commits] [llvm] r54534 - in /llvm/trunk: include/llvm/Target/DarwinTargetAsmInfo.h include/llvm/Target/ELFTargetAsmInfo.h include/llvm/Target/TargetAsmInfo.h lib/Target/ARM/ARMAsmPrinter.cpp lib/Target/DarwinTargetAsmInfo.cpp lib/Target/ELFTargetAsmInfo.cpp lib/Target/Mips/MipsTargetAsmInfo.cpp lib/Target/Mips/MipsTargetAsmInfo.h lib/Target/TargetAsmInfo.cpp

Evan Cheng evan.cheng at apple.com
Fri Aug 8 10:56:50 PDT 2008


Author: evancheng
Date: Fri Aug  8 12:56:50 2008
New Revision: 54534

URL: http://llvm.org/viewvc/llvm-project?rev=54534&view=rev
Log:
Undo most of r54519.

Modified:
    llvm/trunk/include/llvm/Target/DarwinTargetAsmInfo.h
    llvm/trunk/include/llvm/Target/ELFTargetAsmInfo.h
    llvm/trunk/include/llvm/Target/TargetAsmInfo.h
    llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp
    llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp
    llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp
    llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.cpp
    llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.h
    llvm/trunk/lib/Target/TargetAsmInfo.cpp

Modified: llvm/trunk/include/llvm/Target/DarwinTargetAsmInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/DarwinTargetAsmInfo.h?rev=54534&r1=54533&r2=54534&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Target/DarwinTargetAsmInfo.h (original)
+++ llvm/trunk/include/llvm/Target/DarwinTargetAsmInfo.h Fri Aug  8 12:56:50 2008
@@ -30,8 +30,7 @@
     const Section* DataCoalSection;
 
     explicit DarwinTargetAsmInfo(const TargetMachine &TM);
-    virtual const Section* SelectSectionForGlobal(const GlobalValue *GV,
-                                                 bool NoCoalesce = false) const;
+    virtual const Section* SelectSectionForGlobal(const GlobalValue *GV) const;
     virtual std::string UniqueSectionForGlobal(const GlobalValue* GV,
                                                SectionKind::Kind kind) const;
     const Section* MergeableConstSection(const GlobalVariable *GV) const;

Modified: llvm/trunk/include/llvm/Target/ELFTargetAsmInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/ELFTargetAsmInfo.h?rev=54534&r1=54533&r2=54534&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Target/ELFTargetAsmInfo.h (original)
+++ llvm/trunk/include/llvm/Target/ELFTargetAsmInfo.h Fri Aug  8 12:56:50 2008
@@ -26,8 +26,7 @@
   struct ELFTargetAsmInfo: public virtual TargetAsmInfo {
     explicit ELFTargetAsmInfo(const TargetMachine &TM);
 
-    virtual const Section* SelectSectionForGlobal(const GlobalValue *GV,
-                                                 bool NoCoalesce = false) const;
+    virtual const Section* SelectSectionForGlobal(const GlobalValue *GV) const;
     virtual std::string PrintSectionFlags(unsigned flags) const;
     const Section* MergeableConstSection(const GlobalVariable *GV) const;
     inline const Section* MergeableConstSection(const Type *Ty) const;

Modified: llvm/trunk/include/llvm/Target/TargetAsmInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetAsmInfo.h?rev=54534&r1=54533&r2=54534&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Target/TargetAsmInfo.h (original)
+++ llvm/trunk/include/llvm/Target/TargetAsmInfo.h Fri Aug  8 12:56:50 2008
@@ -544,10 +544,8 @@
                           const char* name = NULL) const;
 
     /// SectionForGlobal - This hooks returns proper section name for given
-    /// global with all necessary flags and marks. If NoCoalesce is true,
-    /// do not use coalesced section.
-    virtual std::string SectionForGlobal(const GlobalValue *GV,
-                                         bool NoCoalesce = false) const;
+    /// global with all necessary flags and marks.
+    virtual std::string SectionForGlobal(const GlobalValue *GV) const;
 
     // Helper methods for SectionForGlobal
     virtual std::string UniqueSectionForGlobal(const GlobalValue* GV,
@@ -555,8 +553,7 @@
 
     virtual std::string PrintSectionFlags(unsigned flags) const { return ""; }
 
-    virtual const Section* SelectSectionForGlobal(const GlobalValue *GV,
-                                                 bool NoCoalesce = false) const;
+    virtual const Section* SelectSectionForGlobal(const GlobalValue *GV) const;
 
     virtual const Section* SelectSectionForMachineConst(const Type *Ty) const;
 

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

==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp Fri Aug  8 12:56:50 2008
@@ -863,8 +863,7 @@
     return;
   }
 
-  bool NoCoalesc = PCRelGVs.count(GVar);
-  std::string SectionName = TAI->SectionForGlobal(GVar, NoCoalesc);
+  std::string SectionName = TAI->SectionForGlobal(GVar);
   std::string name = Mang->getValueName(GVar);
   Constant *C = GVar->getInitializer();
   const Type *Type = C->getType();
@@ -901,7 +900,7 @@
       if (Size == 0) Size = 1;   // .comm Foo, 0 is undefined, avoid it.
 
       if (TAI->getLCOMMDirective() != NULL) {
-        if (NoCoalesc || GVar->hasInternalLinkage()) {
+        if (PCRelGVs.count(GVar) || GVar->hasInternalLinkage()) {
           O << TAI->getLCOMMDirective() << name << "," << Size;
           if (Subtarget->isTargetDarwin())
             O << "," << Align;

Modified: llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp?rev=54534&r1=54533&r2=54534&view=diff

==============================================================================
--- llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp Fri Aug  8 12:56:50 2008
@@ -51,15 +51,14 @@
 }
 
 const Section*
-DarwinTargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV,
-                                            bool NoCoalesce) const {
+DarwinTargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV) const {
   SectionKind::Kind Kind = SectionKindForGlobal(GV);
-  bool CanCoalesce = !NoCoalesce && GV->isWeakForLinker();
+  bool isWeak = GV->isWeakForLinker();
   bool isNonStatic = (DTM->getRelocationModel() != Reloc::Static);
 
   switch (Kind) {
    case SectionKind::Text:
-    if (CanCoalesce)
+    if (isWeak)
       return TextCoalSection;
     else
       return getTextSection_();
@@ -68,18 +67,18 @@
    case SectionKind::BSS:
    case SectionKind::ThreadBSS:
     if (cast<GlobalVariable>(GV)->isConstant())
-      return (CanCoalesce ? ConstDataCoalSection : ConstDataSection);
+      return (isWeak ? ConstDataCoalSection : ConstDataSection);
     else
-      return (CanCoalesce ? DataCoalSection : getDataSection_());
+      return (isWeak ? DataCoalSection : getDataSection_());
    case SectionKind::ROData:
-    return (CanCoalesce ? ConstDataCoalSection :
+    return (isWeak ? ConstDataCoalSection :
             (isNonStatic ? ConstDataSection : getReadOnlySection_()));
    case SectionKind::RODataMergeStr:
-    return (CanCoalesce ?
+    return (isWeak ?
             ConstDataCoalSection :
             MergeableStringSection(cast<GlobalVariable>(GV)));
    case SectionKind::RODataMergeConst:
-    return (CanCoalesce ?
+    return (isWeak ?
             ConstDataCoalSection:
             MergeableConstSection(cast<GlobalVariable>(GV)));
    default:

Modified: llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp?rev=54534&r1=54533&r2=54534&view=diff

==============================================================================
--- llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp Fri Aug  8 12:56:50 2008
@@ -40,8 +40,7 @@
 }
 
 const Section*
-ELFTargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV,
-                                         bool NoCoalesce) const {
+ELFTargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV) const {
   SectionKind::Kind Kind = SectionKindForGlobal(GV);
 
   if (const Function *F = dyn_cast<Function>(GV)) {

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

==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.cpp Fri Aug  8 12:56:50 2008
@@ -82,7 +82,7 @@
 }
 
 const Section* MipsTargetAsmInfo::
-SelectSectionForGlobal(const GlobalValue *GV, bool NoCoalesce) const {
+SelectSectionForGlobal(const GlobalValue *GV) const {
   SectionKind::Kind K = SectionKindForGlobal(GV);
   const GlobalVariable *GVA = dyn_cast<GlobalVariable>(GV);
 

Modified: llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.h?rev=54534&r1=54533&r2=54534&view=diff

==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.h (original)
+++ llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.h Fri Aug  8 12:56:50 2008
@@ -40,8 +40,7 @@
     SectionFlagsForGlobal(const GlobalValue *GV = NULL,
                           const char* name = NULL) const;
 
-    virtual const Section* SelectSectionForGlobal(const GlobalValue *GV,
-                                                  bool NoCoalesce) const;
+    virtual const Section* SelectSectionForGlobal(const GlobalValue *GV) const;
 
     private:
       const MipsSubtarget *Subtarget;

Modified: llvm/trunk/lib/Target/TargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetAsmInfo.cpp?rev=54534&r1=54533&r2=54534&view=diff

==============================================================================
--- llvm/trunk/lib/Target/TargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/TargetAsmInfo.cpp Fri Aug  8 12:56:50 2008
@@ -272,7 +272,7 @@
 }
 
 std::string
-TargetAsmInfo::SectionForGlobal(const GlobalValue *GV, bool NoCoalesce) const {
+TargetAsmInfo::SectionForGlobal(const GlobalValue *GV) const {
   const Section* S;
   // Select section name
   if (GV->hasSection()) {
@@ -282,7 +282,7 @@
     S = getNamedSection(GV->getSection().c_str(), Flags);
   } else {
     // Use default section depending on the 'type' of global
-    S = SelectSectionForGlobal(GV, NoCoalesce);
+    S = SelectSectionForGlobal(GV);
   }
 
   if (!S->isNamed())
@@ -295,8 +295,8 @@
 }
 
 // Lame default implementation. Calculate the section name for global.
-const Section* TargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV,
-                                                     bool NoCoalesce) const {
+const Section*
+TargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV) const {
   SectionKind::Kind Kind = SectionKindForGlobal(GV);
 
   if (GV->isWeakForLinker()) {





More information about the llvm-commits mailing list