diff options
author | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2009-08-13 05:07:35 +0000 |
---|---|---|
committer | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2009-08-13 05:07:35 +0000 |
commit | b808588a3a5febe931896b3779d159ba90d836f7 (patch) | |
tree | e07ae309748105f8a462ce435a66f3412dce5ba6 /lib/MC/MCSection.cpp | |
parent | 62728dc14d05e9a677664b784c4f5c6e188aa11a (diff) |
Change MCSectionELF to represent a section semantically instead of
syntactically as a string, very similiar to what Chris did with MachO.
The parsing support and validation is not introduced yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78890 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCSection.cpp')
-rw-r--r-- | lib/MC/MCSection.cpp | 85 |
1 files changed, 0 insertions, 85 deletions
diff --git a/lib/MC/MCSection.cpp b/lib/MC/MCSection.cpp index 8b7fcd2815..3e837635f2 100644 --- a/lib/MC/MCSection.cpp +++ b/lib/MC/MCSection.cpp @@ -20,91 +20,6 @@ using namespace llvm; MCSection::~MCSection() { } - -//===----------------------------------------------------------------------===// -// MCSectionELF -//===----------------------------------------------------------------------===// - -MCSectionELF *MCSectionELF:: -Create(const StringRef &Name, bool IsDirective, SectionKind K, MCContext &Ctx) { - return new (Ctx) MCSectionELF(Name, IsDirective, K); -} - -void MCSectionELF::PrintSwitchToSection(const TargetAsmInfo &TAI, - raw_ostream &OS) const { - if (isDirective()) { - OS << getName() << '\n'; - return; - } - - OS << "\t.section\t" << getName(); - - // Handle the weird solaris syntax if desired. - if (TAI.usesSunStyleELFSectionSwitchSyntax() && - !getKind().isMergeableConst() && !getKind().isMergeableCString()) { - if (!getKind().isMetadata()) - OS << ",#alloc"; - if (getKind().isText()) - OS << ",#execinstr"; - if (getKind().isWriteable()) - OS << ",#write"; - if (getKind().isThreadLocal()) - OS << ",#tls"; - } else { - OS << ",\""; - - if (!getKind().isMetadata()) - OS << 'a'; - if (getKind().isText()) - OS << 'x'; - if (getKind().isWriteable()) - OS << 'w'; - if (getKind().isMergeable1ByteCString() || - getKind().isMergeable2ByteCString() || - getKind().isMergeable4ByteCString() || - getKind().isMergeableConst4() || - getKind().isMergeableConst8() || - getKind().isMergeableConst16()) - OS << 'M'; - if (getKind().isMergeable1ByteCString() || - getKind().isMergeable2ByteCString() || - getKind().isMergeable4ByteCString()) - OS << 'S'; - if (getKind().isThreadLocal()) - OS << 'T'; - - OS << "\","; - - // If comment string is '@', e.g. as on ARM - use '%' instead - if (TAI.getCommentString()[0] == '@') - OS << '%'; - else - OS << '@'; - - if (getKind().isBSS() || getKind().isThreadBSS()) - OS << "nobits"; - else - OS << "progbits"; - - if (getKind().isMergeable1ByteCString()) { - OS << ",1"; - } else if (getKind().isMergeable2ByteCString()) { - OS << ",2"; - } else if (getKind().isMergeable4ByteCString()) { - OS << ",4"; - } else if (getKind().isMergeableConst4()) { - OS << ",4"; - } else if (getKind().isMergeableConst8()) { - OS << ",8"; - } else if (getKind().isMergeableConst16()) { - OS << ",16"; - } - } - - OS << '\n'; -} - - //===----------------------------------------------------------------------===// // MCSectionCOFF //===----------------------------------------------------------------------===// |