[llvm-commits] [llvm] r76973 - in /llvm/trunk: include/llvm/Target/TargetAsmInfo.h lib/Target/TargetAsmInfo.cpp

Chris Lattner sabre at nondot.org
Fri Jul 24 09:46:50 PDT 2009


Author: lattner
Date: Fri Jul 24 11:46:50 2009
New Revision: 76973

URL: http://llvm.org/viewvc/llvm-project?rev=76973&view=rev
Log:
make SectionFlagsForGlobal a private static function instead of a public
virtual one.

Modified:
    llvm/trunk/include/llvm/Target/TargetAsmInfo.h
    llvm/trunk/lib/Target/TargetAsmInfo.cpp

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

==============================================================================
--- llvm/trunk/include/llvm/Target/TargetAsmInfo.h (original)
+++ llvm/trunk/include/llvm/Target/TargetAsmInfo.h Fri Jul 24 11:46:50 2009
@@ -595,13 +595,6 @@
     virtual SectionKind::Kind
     SectionKindForGlobal(const GlobalValue *GV) const;
 
-    /// SectionFlagsForGlobal - This hook allows the target to select proper
-    /// section flags either for given global or for section.
-// FIXME: Eliminate this.
-    virtual unsigned
-    SectionFlagsForGlobal(const GlobalValue *GV = NULL,
-                          const char* name = NULL) const;
-
     /// SectionForGlobal - This hooks returns proper section name for given
     /// global with all necessary flags and marks.
 // FIXME: Eliminate this.

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

==============================================================================
--- llvm/trunk/lib/Target/TargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/TargetAsmInfo.cpp Fri Jul 24 11:46:50 2009
@@ -188,13 +188,12 @@
   return false;
 }
 
-unsigned
-TargetAsmInfo::SectionFlagsForGlobal(const GlobalValue *GV,
-                                     const char *Name) const {
+static unsigned SectionFlagsForGlobal(const GlobalValue *GV,
+                                      SectionKind::Kind Kind,
+                                      const char *Name = 0) {
   unsigned Flags = SectionFlags::None;
 
   // Decode flags from global itself.
-  SectionKind::Kind Kind = SectionKindForGlobal(GV);
   switch (Kind) {
   case SectionKind::Text:
     Flags |= SectionFlags::Code;
@@ -292,7 +291,8 @@
   // Select section name
   if (GV->hasSection()) {
     // Honour section already set, if any.
-    unsigned Flags = SectionFlagsForGlobal(GV, GV->getSection().c_str());
+    unsigned Flags = SectionFlagsForGlobal(GV, SectionKindForGlobal(GV),
+                                           GV->getSection().c_str());
     return getNamedSection(GV->getSection().c_str(), Flags);
   }
 
@@ -303,7 +303,7 @@
           getSectionPrefixForUniqueGlobal(SectionKindForGlobal(GV))) {
       // FIXME: Use mangler interface (PR4584).
       std::string Name = Prefix+GV->getNameStr();
-      unsigned Flags = SectionFlagsForGlobal(GV);
+      unsigned Flags = SectionFlagsForGlobal(GV, SectionKindForGlobal(GV));
       return getNamedSection(Name.c_str(), Flags);
     }
   }





More information about the llvm-commits mailing list