From 8cf62e122f2b921da227aa55fd64633a5e1ee626 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Tue, 15 Jul 2008 18:37:51 +0000 Subject: [PATCH] TargetAsmInfo::SectionForGlobal showed up in a profile. Simplify it a little. llvm-svn: 53639 --- lib/Target/TargetAsmInfo.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/Target/TargetAsmInfo.cpp b/lib/Target/TargetAsmInfo.cpp index 237b96de1ad..2be9440f3b4 100644 --- a/lib/Target/TargetAsmInfo.cpp +++ b/lib/Target/TargetAsmInfo.cpp @@ -273,15 +273,13 @@ TargetAsmInfo::SectionForGlobal(const GlobalValue *GV) const { 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.