[PATCH] D72047: Add an interface emitPrefix for MCCodeEmitter

Kan Shengchen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 31 22:25:36 PST 2019


skan added a comment.

In D72047#1800290 <https://reviews.llvm.org/D72047#1800290>, @craig.topper wrote:

> Can we move the X86MCCodeEmitter definition to a header file and create a separate X86MCCodeEmitter belonging to the X86AsmBackend.cpp that that we can call the emitPrefix on? I'm not sure we want to expose the emitPrefix interface on the generic MCCodeEmitter interface.


Currently, `MCObjectStreamer` owns a `MCAssembler` ,which owns a `MCAsmBackend` and a `MCCodeEmitter`, so I don't think making `X86AsmBackend` have a `X86MCCodeEmitter` object member is a good design. Currently, I plan to call the `emitPrefix` as `OS.getAssembler().getEmitter().emitPrefix()` in X86AsmBackend.cpp, where `OS` is a `MCObjectStreamer` object.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D72047/new/

https://reviews.llvm.org/D72047





More information about the llvm-commits mailing list