[LLVMdev] 2 versions of printInstruction()

Triple Yang triple.yang at gmail.com
Fri May 11 00:41:36 PDT 2012


OK, the field "bit isMCAsmWriter" of class AsmWriter in Target.td
defaults to 0 determines which version of printInstruction will be
generated.

Regards.

2012/5/11 Triple Yang <triple.yang at gmail.com>:
> Hi, LLVMers,
>
> I notice that there are two versions of printInstruction() generated
> by tablegen:
>
> (1) XXXInstPrinter::printInstruction(const MCInst *MI, raw_ostream
> &os), like for X86.
> (2) XXXAsmPrinter::printInstruction(const MachineInstr *MI,
> raw_ostream &os), like for Sparc.
>
> I guess Sparc backend directly transform MachineInstr objects into
> ostream, while X86 backend convert MachineInstr into MCInst first,
> then prints out MCInst as text.
>
> So, why does tablegen result in such differences?
>
> Best regards.
>
> --
> 杨勇勇 (Yang Yongyong)



-- 
杨勇勇 (Yang Yongyong)




More information about the llvm-dev mailing list