[llvm-commits] [llvm] r76645 - /llvm/trunk/lib/Target/TargetAsmInfo.cpp
Chris Lattner
sabre at nondot.org
Tue Jul 21 14:09:35 PDT 2009
Author: lattner
Date: Tue Jul 21 16:09:35 2009
New Revision: 76645
URL: http://llvm.org/viewvc/llvm-project?rev=76645&view=rev
Log:
minor cleanups.
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=76645&r1=76644&r2=76645&view=diff
==============================================================================
--- llvm/trunk/lib/Target/TargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/TargetAsmInfo.cpp Tue Jul 21 16:09:35 2009
@@ -311,21 +311,16 @@
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 @@
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) {
More information about the llvm-commits
mailing list