summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-07-15 18:37:51 +0000
committerDan Gohman <gohman@apple.com>2008-07-15 18:37:51 +0000
commit9c578eb22348f38be8399b483250c0c53c7f13f3 (patch)
tree6ea6001632b42b25b96cbbbe74191fe08e5f1efd /lib
parent4093d8301021c9dde8d3577903366cfb8b5d82d0 (diff)
downloadllvm-9c578eb22348f38be8399b483250c0c53c7f13f3.tar.gz
llvm-9c578eb22348f38be8399b483250c0c53c7f13f3.tar.bz2
llvm-9c578eb22348f38be8399b483250c0c53c7f13f3.tar.xz
TargetAsmInfo::SectionForGlobal showed up in a profile. Simplify it a little.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53639 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Target/TargetAsmInfo.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/Target/TargetAsmInfo.cpp b/lib/Target/TargetAsmInfo.cpp
index 237b96de1a..2be9440f3b 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.