diff options
author | Chris Lattner <sabre@nondot.org> | 2009-07-24 17:02:17 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-07-24 17:02:17 +0000 |
commit | 9b6370d230195e4cff3e3fd648eeb8803fa5b311 (patch) | |
tree | 6a181b34d86ee39debfed05c779ebc24f48c52ae /llvm/lib/Target/TargetAsmInfo.cpp | |
parent | b6974c86f5b4ca6ae08d79a1d27bba3fcfc34154 (diff) | |
download | bcm5719-llvm-9b6370d230195e4cff3e3fd648eeb8803fa5b311.tar.gz bcm5719-llvm-9b6370d230195e4cff3e3fd648eeb8803fa5b311.zip |
move ELF-specific code into ELFTargetAsmInfo.
llvm-svn: 76976
Diffstat (limited to 'llvm/lib/Target/TargetAsmInfo.cpp')
-rw-r--r-- | llvm/lib/Target/TargetAsmInfo.cpp | 26 |
1 files changed, 1 insertions, 25 deletions
diff --git a/llvm/lib/Target/TargetAsmInfo.cpp b/llvm/lib/Target/TargetAsmInfo.cpp index b3eaadc8e1a..985f41533e3 100644 --- a/llvm/lib/Target/TargetAsmInfo.cpp +++ b/llvm/lib/Target/TargetAsmInfo.cpp @@ -224,30 +224,6 @@ static unsigned SectionFlagsForGlobal(const GlobalValue *GV, return Flags; } -static unsigned GetSectionFlagsForNamedELFSection(const char *Name) { - unsigned Flags = 0; - // Some lame default implementation based on some magic section names. - if (strncmp(Name, ".gnu.linkonce.b.", 16) == 0 || - strncmp(Name, ".llvm.linkonce.b.", 17) == 0 || - strncmp(Name, ".gnu.linkonce.sb.", 17) == 0 || - strncmp(Name, ".llvm.linkonce.sb.", 18) == 0) - Flags |= SectionFlags::BSS; - else if (strcmp(Name, ".tdata") == 0 || - strncmp(Name, ".tdata.", 7) == 0 || - strncmp(Name, ".gnu.linkonce.td.", 17) == 0 || - strncmp(Name, ".llvm.linkonce.td.", 18) == 0) - Flags |= SectionFlags::TLS; - else if (strcmp(Name, ".tbss") == 0 || - strncmp(Name, ".tbss.", 6) == 0 || - strncmp(Name, ".gnu.linkonce.tb.", 17) == 0 || - strncmp(Name, ".llvm.linkonce.tb.", 18) == 0) - Flags |= SectionFlags::BSS | SectionFlags::TLS; - - return Flags; -} - - - SectionKind::Kind TargetAsmInfo::SectionKindForGlobal(const GlobalValue *GV) const { // Early exit - functions should be always in text sections. @@ -298,7 +274,7 @@ const Section *TargetAsmInfo::SectionForGlobal(const GlobalValue *GV) const { // If the target has magic semantics for certain section names, make sure to // pick up the flags. This allows the user to write things with attribute // section and still get the appropriate section flags printed. - Flags |= GetSectionFlagsForNamedELFSection(GV->getSection().c_str()); + Flags |= getFlagsForNamedSection(GV->getSection().c_str()); return getNamedSection(GV->getSection().c_str(), Flags); } |