[llvm-dev] Can I dump LLVM IR after each pass in Clang BackendUtil.cpp

Zhengyang Liu via llvm-dev llvm-dev at lists.llvm.org
Sun Jun 12 06:11:21 PDT 2016


It solved my question, thank you.


Best regards,

Zhengyang.


________________________________
From: Martin J. O'Riordan <martin.oriordan at movidius.com>
Sent: Sunday, June 12, 2016 9:01 PM
To: 'Zhengyang Liu'
Subject: RE: [llvm-dev] Can I dump LLVM IR after each pass in Clang BackendUtil.cpp

I think that:

   -mllvm -print-after-all

does that you need.  It is "very" verbose though and you might prefer to use:

   -mllvm -print-after=<selected-passes>

Use '-mllvm -help' or '-mllvm --help-hidden' to see all the options.

        MartinO

-----Original Message-----
From: llvm-dev [mailto:llvm-dev-bounces at lists.llvm.org] On Behalf Of Zhengyang Liu via llvm-dev
Sent: 12 June 2016 13:39
To: llvm-dev at lists.llvm.org
Subject: [llvm-dev] Can I dump LLVM IR after each pass in Clang BackendUtil.cpp

Dear llvm-dev,

I am trying to debug some passes , these passes are added to
legacy::PassManager(MPM) in Clang's lib/CodeGen/BackendUtil.cpp  :


//******
void EmitAssemblyHelper::CreatePasses() {
//******
   if (CodeGenOpts.MemSafety) {
     //
     // Add passes that record information about run-time checks.
     //
     MPM->add (createCommonMSCInfoPass());
     MPM->add (createSAFECodeMSCInfoPass());
//******

Could I dump the output LLVM IR after each pass in PassManager MPM?

Best regards,
Zhengyang.
_______________________________________________
LLVM Developers mailing list
llvm-dev at lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev

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


More information about the llvm-dev mailing list