aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-07-21 21:09:35 +0000
committerChris Lattner <sabre@nondot.org>2009-07-21 21:09:35 +0000
commit7558f11849df6023d1256e46ea5c71b84ded5686 (patch)
tree0d4c824867bde8b57c48a93cdc56bcd27e10460b
parent822ccd9974a17979d2cb9c6c118f94549055b7d4 (diff)
downloadexternal_llvm-7558f11849df6023d1256e46ea5c71b84ded5686.tar.gz
external_llvm-7558f11849df6023d1256e46ea5c71b84ded5686.tar.bz2
external_llvm-7558f11849df6023d1256e46ea5c71b84ded5686.zip
minor cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76645 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/TargetAsmInfo.cpp26
1 files changed, 10 insertions, 16 deletions
diff --git a/lib/Target/TargetAsmInfo.cpp b/lib/Target/TargetAsmInfo.cpp
index 2a2e987667..2cdaa74843 100644
--- a/lib/Target/TargetAsmInfo.cpp
+++ b/lib/Target/TargetAsmInfo.cpp
@@ -311,21 +311,16 @@ TargetAsmInfo::SectionFlagsForGlobal(const GlobalValue *GV,
return Flags;
}
-const Section*
-TargetAsmInfo::SectionForGlobal(const GlobalValue *GV) const {
- const Section* S;
+const Section *TargetAsmInfo::SectionForGlobal(const GlobalValue *GV) const {
// Select section name
if (GV->hasSection()) {
- // Honour section already set, if any
- unsigned Flags = SectionFlagsForGlobal(GV,
- GV->getSection().c_str());
- S = getNamedSection(GV->getSection().c_str(), Flags);
- } else {
- // Use default section depending on the 'type' of global
- S = SelectSectionForGlobal(GV);
+ // Honour section already set, if any.
+ unsigned Flags = SectionFlagsForGlobal(GV, GV->getSection().c_str());
+ return getNamedSection(GV->getSection().c_str(), Flags);
}
-
- return S;
+
+ // Use default section depending on the 'type' of global
+ return SelectSectionForGlobal(GV);
}
// Lame default implementation. Calculate the section name for global.
@@ -394,10 +389,9 @@ TargetAsmInfo::UniqueSectionForGlobal(const GlobalValue* GV,
return NULL;
}
-const Section*
-TargetAsmInfo::getNamedSection(const char *Name, unsigned Flags,
- bool Override) const {
- Section& S = Sections[Name];
+const Section *TargetAsmInfo::getNamedSection(const char *Name, unsigned Flags,
+ bool Override) const {
+ Section &S = Sections[Name];
// This is newly-created section, set it up properly.
if (S.Flags == SectionFlags::Invalid || Override) {