diff options
author | Chris Lattner <sabre@nondot.org> | 2009-08-08 22:41:53 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-08-08 22:41:53 +0000 |
commit | 892e18239308f8a02a4c83758616be84a459c19d (patch) | |
tree | 84b7cceebedea3e4afd191e06686054be73baf22 /lib/Target/TargetLoweringObjectFile.cpp | |
parent | 0aac30195c8f3f7066d4d069693e5d91f054f081 (diff) |
1. Make MCSection an abstract class.
2. Move section switch printing to MCSection virtual method which takes a
TAI. This eliminates textual formatting stuff from TLOF.
3. Eliminate SwitchToSectionDirective, getSectionFlagsAsString, and
TLOFELF::AtIsCommentChar.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78510 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/TargetLoweringObjectFile.cpp')
-rw-r--r-- | lib/Target/TargetLoweringObjectFile.cpp | 100 |
1 files changed, 0 insertions, 100 deletions
diff --git a/lib/Target/TargetLoweringObjectFile.cpp b/lib/Target/TargetLoweringObjectFile.cpp index bd3b37668d..e41e7a958c 100644 --- a/lib/Target/TargetLoweringObjectFile.cpp +++ b/lib/Target/TargetLoweringObjectFile.cpp @@ -404,91 +404,6 @@ getExplicitSectionGlobal(const GlobalValue *GV, SectionKind Kind, return getELFSection(GV->getSection().c_str(), false, Kind); } - - - -void TargetLoweringObjectFileELF:: -getSectionFlagsAsString(SectionKind Kind, SmallVectorImpl<char> &Str, - const TargetAsmInfo &TAI) const { - // Handle the weird solaris syntax if desired. - if (TAI.usesSunStyleELFSectionSwitchSyntax() && - !Kind.isMergeableConst() && !Kind.isMergeableCString()) { - // FIXME: Inefficient. - std::string Res; - if (!Kind.isMetadata()) - Res += ",#alloc"; - if (Kind.isText()) - Res += ",#execinstr"; - if (Kind.isWriteable()) - Res += ",#write"; - if (Kind.isThreadLocal()) - Res += ",#tls"; - Str.append(Res.begin(), Res.end()); - return; - } - - Str.push_back(','); - Str.push_back('"'); - - if (!Kind.isMetadata()) - Str.push_back('a'); - if (Kind.isText()) - Str.push_back('x'); - if (Kind.isWriteable()) - Str.push_back('w'); - if (Kind.isMergeable1ByteCString() || - Kind.isMergeable2ByteCString() || - Kind.isMergeable4ByteCString() || - Kind.isMergeableConst4() || - Kind.isMergeableConst8() || - Kind.isMergeableConst16()) - Str.push_back('M'); - if (Kind.isMergeable1ByteCString() || - Kind.isMergeable2ByteCString() || - Kind.isMergeable4ByteCString()) - Str.push_back('S'); - if (Kind.isThreadLocal()) - Str.push_back('T'); - - Str.push_back('"'); - Str.push_back(','); - - // If comment string is '@', e.g. as on ARM - use '%' instead - if (AtIsCommentChar) - Str.push_back('%'); - else - Str.push_back('@'); - - const char *KindStr; - if (Kind.isBSS() || Kind.isThreadBSS()) - KindStr = "nobits"; - else - KindStr = "progbits"; - - Str.append(KindStr, KindStr+strlen(KindStr)); - - if (Kind.isMergeable1ByteCString()) { - Str.push_back(','); - Str.push_back('1'); - } else if (Kind.isMergeable2ByteCString()) { - Str.push_back(','); - Str.push_back('2'); - } else if (Kind.isMergeable4ByteCString()) { - Str.push_back(','); - Str.push_back('4'); - } else if (Kind.isMergeableConst4()) { - Str.push_back(','); - Str.push_back('4'); - } else if (Kind.isMergeableConst8()) { - Str.push_back(','); - Str.push_back('8'); - } else if (Kind.isMergeableConst16()) { - Str.push_back(','); - Str.push_back('1'); - Str.push_back('6'); - } -} - static const char *getSectionPrefixForUniqueGlobal(SectionKind Kind) { if (Kind.isText()) return ".gnu.linkonce.t."; @@ -865,21 +780,6 @@ getExplicitSectionGlobal(const GlobalValue *GV, SectionKind Kind, return getCOFFSection(GV->getSection().c_str(), false, Kind); } - -void TargetLoweringObjectFileCOFF:: -getSectionFlagsAsString(SectionKind Kind, SmallVectorImpl<char> &Str, - const TargetAsmInfo &TAI) const { - // FIXME: Inefficient. - std::string Res = ",\""; - if (Kind.isText()) - Res += 'x'; - if (Kind.isWriteable()) - Res += 'w'; - Res += "\""; - - Str.append(Res.begin(), Res.end()); -} - static const char *getCOFFSectionPrefixForUniqueGlobal(SectionKind Kind) { if (Kind.isText()) return ".text$linkonce"; |