[MC][AsmParser] Hook for post assembly file processing
authorJack Carter <jack.carter@imgtec.com>
Fri, 4 Oct 2013 21:26:15 +0000 (21:26 +0000)
committerJack Carter <jack.carter@imgtec.com>
Fri, 4 Oct 2013 21:26:15 +0000 (21:26 +0000)
commit8e48edcf3dd7dea9fec58b05a6ace6fbd0260d7c
treeb5631843b607f2a9a0447dd870eed1f6095a8883
parent36ea408903e4acafcb90650d94c9aa8e7484c1f5
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191982 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/MC/MCTargetAsmParser.h
lib/MC/MCParser/AsmParser.cpp
lib/Target/Mips/AsmParser/MipsAsmFlags.h [new file with mode: 0644]
lib/Target/Mips/AsmParser/MipsAsmParser.cpp
lib/Target/Mips/MCTargetDesc/MipsELFStreamer.cpp
lib/Target/Mips/MCTargetDesc/MipsELFStreamer.h
lib/Target/Mips/MipsAsmPrinter.cpp
test/MC/Mips/mips_directives.s