[llvm-dev] [ORC] Dump assembly from OrcJit

Caballero, Diego via llvm-dev llvm-dev at lists.llvm.org
Thu Aug 15 15:44:37 PDT 2019


Hi all,

Is there a way to dump the generated assembly from OrcJit? I found this thread about MCJIT but nothing specific about OrcJit: http://lists.llvm.org/pipermail/llvm-dev/2014-June/074145.html
I'm also aware of the alternative approach below, but I'm not sure if the output will be the same as the assembly generated by OrcJit. Probably not.

    std::string outStr;
    {
      llvm::legacy::PassManager pm;
      llvm::raw_string_ostream stream(outStr);
      llvm::buffer_ostream pstream(stream);
      targetMachine->addPassesToEmitFile(pm, pstream, nullptr,
                                         llvm::TargetMachine::CGFT_AssemblyFile);
      pm.run(*m);
    }
    llvm::errs() << "Assembly:\n" << outStr << "\n";

Thanks!
Diego

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190815/06647b5f/attachment.html>


More information about the llvm-dev mailing list