diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-10-16 01:05:45 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-10-16 01:05:45 +0000 |
commit | c7ce3e4f42219003f30382be17d966cb2dfb4e71 (patch) | |
tree | 682db2c5d6612be584c612b334e7f54af0b2094f /lib/MC/MCParser | |
parent | e5fdae03a4137267ae124a35aef11f72bb6aa13b (diff) | |
download | llvm-c7ce3e4f42219003f30382be17d966cb2dfb4e71.tar.gz llvm-c7ce3e4f42219003f30382be17d966cb2dfb4e71.tar.bz2 llvm-c7ce3e4f42219003f30382be17d966cb2dfb4e71.tar.xz |
Move .ident handling to MCStreamer.
No functionality change, but exposes the API so that codegen can use it too.
Patch by Katya Romanova.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192757 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCParser')
-rw-r--r-- | lib/MC/MCParser/ELFAsmParser.cpp | 26 |
1 files changed, 4 insertions, 22 deletions
diff --git a/lib/MC/MCParser/ELFAsmParser.cpp b/lib/MC/MCParser/ELFAsmParser.cpp index ca71173628..8807975e85 100644 --- a/lib/MC/MCParser/ELFAsmParser.cpp +++ b/lib/MC/MCParser/ELFAsmParser.cpp @@ -31,14 +31,11 @@ class ELFAsmParser : public MCAsmParserExtension { getParser().addDirectiveHandler(Directive, Handler); } - bool ParseSectionSwitch(StringRef Section, unsigned Type, - unsigned Flags, SectionKind Kind); - bool SeenIdent; + bool ParseSectionSwitch(StringRef Section, unsigned Type, unsigned Flags, + SectionKind Kind); public: - ELFAsmParser() : SeenIdent(false) { - BracketExpressionsSupported = true; - } + ELFAsmParser() { BracketExpressionsSupported = true; } virtual void Initialize(MCAsmParser &Parser) { // Call the base implementation. @@ -579,22 +576,7 @@ bool ELFAsmParser::ParseDirectiveIdent(StringRef, SMLoc) { Lex(); - const MCSection *Comment = - getContext().getELFSection(".comment", ELF::SHT_PROGBITS, - ELF::SHF_MERGE | - ELF::SHF_STRINGS, - SectionKind::getReadOnly(), - 1, ""); - - getStreamer().PushSection(); - getStreamer().SwitchSection(Comment); - if (!SeenIdent) { - getStreamer().EmitIntValue(0, 1); - SeenIdent = true; - } - getStreamer().EmitBytes(Data); - getStreamer().EmitIntValue(0, 1); - getStreamer().PopSection(); + getStreamer().EmitIdent(Data); return false; } |