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
This commit is contained in:
Rafael Espindola
2013-10-16 01:05:45 +00:00
parent e5fdae03a4
commit c7ce3e4f42
11 changed files with 61 additions and 27 deletions

View File

@@ -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());