[LLVMdev] Creating a new MCStreamer object inside AsmPrinter

Ronaldo Ferreira ronaldorferreira at gmail.com
Tue Oct 7 16:12:30 PDT 2014


I would like to create a new MCStreamer object inside the AsmPrinter class,
which will be used in the AsmPrinter::EmitFunctionBody() method. This new
MCStreamer object has to use the dbgs() raw_stream instead of the default
Out stream as created in the LLVMTargetMachine::addPassesToEmitFile method.

In that method, there's a call to the default
OutStreamer.EmitInstruction(&MI) method. In my code, I need to call this
method for my new MCStreamer object.

In summary, I want to print the asm instruction created by the
EmitInstruction method to the dbgs() stream.

All the objects I need (at least I think) to create my new MCStreamer
object are the running instances for the Target of the MCInstPrinter,
MCAsmBackend and MCCodeEmitter classes. How can I retrieve these objects
inside the AsmPrinter class?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20141008/0143036f/attachment.html>

More information about the llvm-dev mailing list