diff options
author | Chris Lattner <sabre@nondot.org> | 2009-07-21 21:29:08 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-07-21 21:29:08 +0000 |
commit | 7886ae9e3ca7ec20eceb213523a6788d368cfc73 (patch) | |
tree | 56f7c61fb8c7340092a0870c6d0b0a3ae8df9fbd | |
parent | 42b6418cc0ed26123a7b838182d41aa940481c04 (diff) |
inline a trivial method into its only call site and fix indentation of cases
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76654 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/Target/ELFTargetAsmInfo.h | 1 | ||||
-rw-r--r-- | lib/Target/ELFTargetAsmInfo.cpp | 37 |
2 files changed, 16 insertions, 22 deletions
diff --git a/include/llvm/Target/ELFTargetAsmInfo.h b/include/llvm/Target/ELFTargetAsmInfo.h index 79f167a12a..ecde4ee830 100644 --- a/include/llvm/Target/ELFTargetAsmInfo.h +++ b/include/llvm/Target/ELFTargetAsmInfo.h @@ -28,7 +28,6 @@ namespace llvm { SectionKind::Kind SectionKindForGlobal(const GlobalValue *GV) const; virtual const Section* SelectSectionForGlobal(const GlobalValue *GV) const; virtual std::string printSectionFlags(unsigned flags) const; - const Section* MergeableConstSection(const GlobalVariable *GV) const; const Section* MergeableConstSection(const Type *Ty) const; const Section* MergeableStringSection(const GlobalVariable *GV) const; virtual const Section* diff --git a/lib/Target/ELFTargetAsmInfo.cpp b/lib/Target/ELFTargetAsmInfo.cpp index e528aebf9a..bd2dd0a064 100644 --- a/lib/Target/ELFTargetAsmInfo.cpp +++ b/lib/Target/ELFTargetAsmInfo.cpp @@ -97,34 +97,34 @@ ELFTargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV) const { return getNamedSection(Name.c_str(), Flags); } else { switch (Kind) { - case SectionKind::Data: - case SectionKind::SmallData: + case SectionKind::Data: + case SectionKind::SmallData: return DataSection; - case SectionKind::DataRel: + case SectionKind::DataRel: return DataRelSection; - case SectionKind::DataRelLocal: + case SectionKind::DataRelLocal: return DataRelLocalSection; - case SectionKind::DataRelRO: + case SectionKind::DataRelRO: return DataRelROSection; - case SectionKind::DataRelROLocal: + case SectionKind::DataRelROLocal: return DataRelROLocalSection; - case SectionKind::BSS: - case SectionKind::SmallBSS: + case SectionKind::BSS: + case SectionKind::SmallBSS: // ELF targets usually have BSS sections return getBSSSection_(); - case SectionKind::ROData: - case SectionKind::SmallROData: + case SectionKind::ROData: + case SectionKind::SmallROData: return getReadOnlySection(); - case SectionKind::RODataMergeStr: + case SectionKind::RODataMergeStr: return MergeableStringSection(GVar); - case SectionKind::RODataMergeConst: - return MergeableConstSection(GVar); - case SectionKind::ThreadData: + case SectionKind::RODataMergeConst: + return MergeableConstSection(GVar->getInitializer()->getType()); + case SectionKind::ThreadData: // ELF targets usually support TLS stuff return TLSDataSection; - case SectionKind::ThreadBSS: + case SectionKind::ThreadBSS: return TLSBSSSection; - default: + default: llvm_unreachable("Unsuported section kind for global"); } } @@ -141,11 +141,6 @@ ELFTargetAsmInfo::SelectSectionForMachineConst(const Type *Ty) const { } const Section* -ELFTargetAsmInfo::MergeableConstSection(const GlobalVariable *GV) const { - return MergeableConstSection(GV->getInitializer()->getType()); -} - -const Section* ELFTargetAsmInfo::MergeableConstSection(const Type *Ty) const { const TargetData *TD = TM.getTargetData(); |