[LLVMdev] AsmPrinter vs. MCAsmStreamer

Joe Matarazzo joe.matarazzo at gmail.com
Tue Nov 8 18:23:57 CST 2011


I'm writing a backend using a mid-October svn snapshot of LLVM. I'm having
a hard time figuring out the relationship between my XXXAsmPrinter and
MCAsmStreamer. Can someone explain what each is responsible for? Looking at
the existing targets, the XXXAsmPrinter implementations seem to implement
both the legacy "create a .s file" behavior, using
printInstruction/printOperand/etc as well as the newer "lower to MCInst"
behavior (EmitInstruction). Is this just a remnant of the v2.x -> v3.x
transition?

AFAICT, the MCAsmStreamer should be the interface to create the .s file
going forward. Is that true? If true, how does it fit into registering the
asmprinter as a pass? That is, if the AsmPrinter pass is used to lower to
MCInst in the XXXAsmPrinter, then what? What's the target registration for
MCInst -> .s file?

Thanks,
Joe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.cs.uiuc.edu/pipermail/llvmdev/attachments/20111108/dd928bbe/attachment.html 


More information about the LLVMdev mailing list