From: Chris Lattner Date: Tue, 21 Jul 2009 21:09:35 +0000 (+0000) Subject: minor cleanups. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c21954dff6348934bacae79002f4c5b91642c779;p=platform%2Fupstream%2Fllvm.git minor cleanups. llvm-svn: 76645 --- diff --git a/llvm/lib/Target/TargetAsmInfo.cpp b/llvm/lib/Target/TargetAsmInfo.cpp index 2a2e987..2cdaa74 100644 --- a/llvm/lib/Target/TargetAsmInfo.cpp +++ b/llvm/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) {