[llvm-commits] [llvm] r77143 - /llvm/trunk/lib/Target/TargetAsmInfo.cpp

Chris Lattner sabre at nondot.org
Sun Jul 26 00:18:12 PDT 2009


Author: lattner
Date: Sun Jul 26 02:17:39 2009
New Revision: 77143

URL: http://llvm.org/viewvc/llvm-project?rev=77143&view=rev
Log:
simplify SectionFlagsForGlobal, even though I want to kill it.

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

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

==============================================================================
--- llvm/trunk/lib/Target/TargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/TargetAsmInfo.cpp Sun Jul 26 02:17:39 2009
@@ -199,11 +199,10 @@
   return false;
 }
 
-static unsigned SectionFlagsForGlobal(const GlobalValue *GV,
-                                      SectionKind Kind) {
+static unsigned SectionFlagsForGlobal(SectionKind Kind) {
   // Decode flags from global and section kind.
   unsigned Flags = SectionFlags::None;
-  if (GV->isWeakForLinker())
+  if (Kind.isWeak())
     Flags |= SectionFlags::Linkonce;
   if (Kind.isBSS() || Kind.isThreadBSS())
     Flags |= SectionFlags::BSS;
@@ -328,7 +327,7 @@
       return TS;
     
     // Honour section already set, if any.
-    unsigned Flags = SectionFlagsForGlobal(GV, Kind);
+    unsigned Flags = SectionFlagsForGlobal(Kind);
 
     // This is an explicitly named section.
     Flags |= SectionFlags::Named;
@@ -343,9 +342,9 @@
 
   // If this global is linkonce/weak and the target handles this by emitting it
   // into a 'uniqued' section name, create and return the section now.
-  if (GV->isWeakForLinker()) {
+  if (Kind.isWeak()) {
     if (const char *Prefix = getSectionPrefixForUniqueGlobal(Kind)) {
-      unsigned Flags = SectionFlagsForGlobal(GV, Kind);
+      unsigned Flags = SectionFlagsForGlobal(Kind);
 
       // FIXME: Use mangler interface (PR4584).
       std::string Name = Prefix+GV->getNameStr();





More information about the llvm-commits mailing list