[LLVMdev] print machine code using llvm c++ api
James.Molloy at arm.com
Thu Oct 14 02:36:25 CDT 2010
Look for the function addPassesToEmitFile, in LLVMTargetMachine. This is
called directly from llc.cpp if I recall correctly, and will emit a
string representation of the assembler code.
If you want pure ELF, look for addPassesToEmitMachineCode (old version)
or addPassesToEmitMC (new version).
> -----Original Message-----
> From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu]
> On Behalf Of KULBHUSHAN PACHAURI
> Sent: 14 October 2010 05:35
> To: llvmdev at cs.uiuc.edu
> Subject: [LLVMdev] print machine code using llvm c++ api
> I know using llc i can print machine code (-print-machineinstrs).
> How can i print machine code using llvm c++ api.. i looked into llc
> code but not able to find it..
> Thanks & Regards,
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
More information about the LLVMdev