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 | 607cd3b63af5af83283a6f242d721c6997e18fca (patch) | |
tree | 68ff3a8d58a70de07d0ea4c8a28991a04176d094 /llvm/lib/MC/MCSection.cpp | |
parent | 5c2764b3e9071cae6300f26fe0e4de8fb904d2c3 (diff) | |
download | bcm5719-llvm-607cd3b63af5af83283a6f242d721c6997e18fca.tar.gz bcm5719-llvm-607cd3b63af5af83283a6f242d721c6997e18fca.zip |
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.
llvm-svn: 78890
Diffstat (limited to 'llvm/lib/MC/MCSection.cpp')
-rw-r--r-- | llvm/lib/MC/MCSection.cpp | 85 |
1 files changed, 0 insertions, 85 deletions
diff --git a/llvm/lib/MC/MCSection.cpp b/llvm/lib/MC/MCSection.cpp index 8b7fcd2815c..3e837635f22 100644 --- a/llvm/lib/MC/MCSection.cpp +++ b/llvm/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 //===----------------------------------------------------------------------===// |