[PATCH] D45164: [MC] Change AsmParser to leverage Assembler during evaluation

Nirav Dave via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 11 13:33:39 PDT 2018


niravd added a comment.

>> That said, modulo the extra bookkeeping costs for textual assembly additional checks for incomplete assemblers, there's no real reason why MCAsmStreamer and MCObjectStreamer are separate structures and it would be good to eventually merge them.
> 
> Why? What would you replace the MCStreamer interface virtual dispatch with? Would MCStreamer become the main implementation, with every method checking `if (emitTextualAssembly) OS << ".foo";`? That doesn't seem like a clear win.

Yes. If we're going to require the assembly and object generation must be the same, we're going to need to do equivalent bookkeeping and factoring out just the bookkeeping into a merged seems unreasonable given it depends on enough details from the various ObjectStreamer subclass. Textual output would effectively be a trace emitted during a truncated object generation.

If we're okay with object generation being more permissive than textual generation for assembly files then the only potential issue is changes exposed by inline asm; I believe we do expect compilation to always be able to generate textual assembly if we can generate an object for C compilation. 
This could be resolved by disabling assembler-level information for inline assembly.


Repository:
  rL LLVM

https://reviews.llvm.org/D45164





More information about the llvm-commits mailing list