diff options
author | Jack Carter <jack.carter@imgtec.com> | 2013-10-04 21:26:15 +0000 |
---|---|---|
committer | Jack Carter <jack.carter@imgtec.com> | 2013-10-04 21:26:15 +0000 |
commit | 721726adfc043224c9e5e0925b581d0448c6723d (patch) | |
tree | 2d825ccd82a884dc98d87461c3ed6c2171d6b806 /llvm/lib/MC/MCParser/AsmParser.cpp | |
parent | f7a8c4f3476f88683efdb071f57012dcf906305e (diff) | |
download | bcm5719-llvm-721726adfc043224c9e5e0925b581d0448c6723d.tar.gz bcm5719-llvm-721726adfc043224c9e5e0925b581d0448c6723d.zip |
[MC][AsmParser] Hook for post assembly file processing
This patch handles LLVM standalone assembler (llvm-mc) ELF flag setting based on input file
directive processing.
Mips assembly requires processing inline directives that directly and
indirectly affect the output ELF header flags. This patch handles one
".abicalls".
To process these directives we are following the model the code generator
uses by storing state in a container as we go through processing and when
we detect the end of input file processing, AsmParser is notified and we
update the ELF header flags through a MipsELFStreamer method with a call from
MCTargetAsmParser::emitEndOfAsmFile(MCStreamer &OutStreamer).
This patch will allow other targets the same functionality.
Jack
llvm-svn: 191982
Diffstat (limited to 'llvm/lib/MC/MCParser/AsmParser.cpp')
-rw-r--r-- | llvm/lib/MC/MCParser/AsmParser.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/MC/MCParser/AsmParser.cpp b/llvm/lib/MC/MCParser/AsmParser.cpp index 9854b07a6c4..53ce02c0899 100644 --- a/llvm/lib/MC/MCParser/AsmParser.cpp +++ b/llvm/lib/MC/MCParser/AsmParser.cpp @@ -673,8 +673,10 @@ bool AsmParser::Run(bool NoInitialTextSection, bool NoFinalize) { // Finalize the output stream if there are no errors and if the client wants // us to. - if (!HadError && !NoFinalize) + if (!HadError && !NoFinalize) { + getTargetParser().emitEndOfAsmFile(Out); Out.Finish(); + } return HadError; } @@ -779,7 +781,8 @@ bool AsmParser::parsePrimaryExpr(const MCExpr *&Res, SMLoc &EndLoc) { // temporary label to the streamer and refer to it. MCSymbol *Sym = Ctx.CreateTempSymbol(); Out.EmitLabel(Sym); - Res = MCSymbolRefExpr::Create(Sym, MCSymbolRefExpr::VK_None, getContext()); + Res = MCSymbolRefExpr::Create(Sym, MCSymbolRefExpr::VK_None, + getContext()); EndLoc = FirstTokenLoc; return false; } else |