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

Chris Lattner sabre at nondot.org
Thu Jul 23 21:26:19 PDT 2009


Author: lattner
Date: Thu Jul 23 23:26:19 2009
New Revision: 76946

URL: http://llvm.org/viewvc/llvm-project?rev=76946&view=rev
Log:
document SectionFlags::Named better and make it more easily greppable by
eliminating isNamed.

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

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

==============================================================================
--- llvm/trunk/include/llvm/Target/TargetAsmInfo.h (original)
+++ llvm/trunk/include/llvm/Target/TargetAsmInfo.h Thu Jul 23 23:26:19 2009
@@ -79,6 +79,9 @@
     const unsigned Linkonce   = 1 << 7;  ///< Section is linkonce
     const unsigned TypeFlags  = 0xFF;
     // Some gap for future flags
+    
+    /// Named - True if this section should be printed with ".section <name>",
+    /// false if the section name is something like ".const".
     const unsigned Named      = 1 << 23; ///< Section is named
     const unsigned EntitySize = 0xFF << 24; ///< Entity size for mergeable stuff
 
@@ -114,14 +117,13 @@
 
     std::string Name;
     unsigned Flags;
-    explicit Section(unsigned F = SectionFlags::Invalid):Flags(F) { }
+    explicit Section(unsigned F = SectionFlags::Invalid) : Flags(F) { }
 
   public:
     
-    bool isNamed() const { return Flags & SectionFlags::Named; }
     unsigned getEntitySize() const { return (Flags >> 24) & 0xFF; }
 
-    const std::string& getName() const { return Name; }
+    const std::string &getName() const { return Name; }
     unsigned getFlags() const { return Flags; }
     
     bool hasFlag(unsigned F) const { return (Flags & F) != 0; }

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

==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Thu Jul 23 23:26:19 2009
@@ -135,7 +135,7 @@
     // If section is named we need to switch into it via special '.section'
     // directive and also append funky flags. Otherwise - section name is just
     // some magic assembler directive.
-    if (NS->isNamed())
+    if (NS->hasFlag(SectionFlags::Named))
       O << TAI->getSwitchToSectionDirective()
         << CurrentSection
         << TAI->getSectionFlags(NS->getFlags());





More information about the llvm-commits mailing list