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

Dan Gohman gohman at apple.com
Tue Jul 15 11:37:51 PDT 2008


Author: djg
Date: Tue Jul 15 13:37:51 2008
New Revision: 53639

URL: http://llvm.org/viewvc/llvm-project?rev=53639&view=rev
Log:
TargetAsmInfo::SectionForGlobal showed up in a profile. Simplify it a little.

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=53639&r1=53638&r2=53639&view=diff

==============================================================================
--- llvm/trunk/lib/Target/TargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/TargetAsmInfo.cpp Tue Jul 15 13:37:51 2008
@@ -273,15 +273,13 @@
     S = SelectSectionForGlobal(GV);
   }
 
-  std::string Name = S->Name;
+  if (!S->isNamed())
+    return S->Name;
 
   // 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 (S->isNamed())
-    Name = getSwitchToSectionDirective() + Name + PrintSectionFlags(S->Flags);
-
-  return Name;
+  return getSwitchToSectionDirective() + S->Name + PrintSectionFlags(S->Flags);
 }
 
 // Lame default implementation. Calculate the section name for global.





More information about the llvm-commits mailing list