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 | 5645bade1bcde40a768b7daa43d8e0878243aae1 (patch) | |
tree | a6d5eac3733cdb125baa15eb3c36c9ce07c8e8f8 /llvm/lib/MC/MCELFStreamer.cpp | |
parent | b01a3bec88f240b4e2b39424f6aa78c6bd7b8f8a (diff) | |
download | bcm5719-llvm-5645bade1bcde40a768b7daa43d8e0878243aae1.tar.gz bcm5719-llvm-5645bade1bcde40a768b7daa43d8e0878243aae1.zip |
Move .ident handling to MCStreamer.
No functionality change, but exposes the API so that codegen can use it too.
Patch by Katya Romanova.
llvm-svn: 192757
Diffstat (limited to 'llvm/lib/MC/MCELFStreamer.cpp')
-rw-r--r-- | llvm/lib/MC/MCELFStreamer.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/llvm/lib/MC/MCELFStreamer.cpp b/llvm/lib/MC/MCELFStreamer.cpp index c16a61d2b69..3f6c62c0625 100644 --- a/llvm/lib/MC/MCELFStreamer.cpp +++ b/llvm/lib/MC/MCELFStreamer.cpp @@ -329,7 +329,22 @@ void MCELFStreamer::EmitFileDirective(StringRef Filename) { SD.setFlags(ELF_STT_File | ELF_STB_Local | ELF_STV_Default); } -void MCELFStreamer::fixSymbolsInTLSFixups(const MCExpr *expr) { +void MCELFStreamer::EmitIdent(StringRef IdentString) { + const MCSection *Comment = getAssembler().getContext().getELFSection( + ".comment", ELF::SHT_PROGBITS, ELF::SHF_MERGE | ELF::SHF_STRINGS, + SectionKind::getReadOnly(), 1, ""); + PushSection(); + SwitchSection(Comment); + if (!SeenIdent) { + EmitIntValue(0, 1); + SeenIdent = true; + } + EmitBytes(IdentString); + EmitIntValue(0, 1); + PopSection(); +} + +void MCELFStreamer::fixSymbolsInTLSFixups(const MCExpr *expr) { switch (expr->getKind()) { case MCExpr::Target: cast<MCTargetExpr>(expr)->fixELFSymbolsInTLSFixups(getAssembler()); |