<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 6/12/16 8:11 AM, Zhengyang Liu via
      llvm-dev wrote:<br>
    </div>
    <blockquote
cite="mid:SG2PR06MB04278F8467B499E61BD68D3BFD520@SG2PR06MB0427.apcprd06.prod.outlook.com"
      type="cite">
      <meta http-equiv="Context-Type" content="text/html;
        charset=iso-8859-1">
      <div id="divtagdefaultwrapper">
        <p>It solved my question, thank you.</p>
      </div>
    </blockquote>
    <br>
    Alternatively, you can add a BitcodeWriter (or whatever it's called)
    pass.  This pass writes the bitcode out to a file.  As it is an LLVM
    pass, you can schedule it like any other pass.<br>
    <br>
    Regards,<br>
    <br>
    John Criswell<br>
    <br>
    <blockquote
cite="mid:SG2PR06MB04278F8467B499E61BD68D3BFD520@SG2PR06MB0427.apcprd06.prod.outlook.com"
      type="cite">
      <div id="divtagdefaultwrapper">
        <p><br>
        </p>
        <p>Best regards,</p>
        <p>Zhengyang.</p>
        <br>
        <br>
        <div>
          <div>
            <hr tabindex="-1">
            <div id="x_divRplyFwdMsg" dir="ltr"><b>From:</b> Martin J.
              O'Riordan <a class="moz-txt-link-rfc2396E" href="mailto:martin.oriordan@movidius.com"><martin.oriordan@movidius.com></a><br>
              <b>Sent:</b> Sunday, June 12, 2016 9:01 PM<br>
              <b>To:</b> 'Zhengyang Liu'<br>
              <b>Subject:</b> RE: [llvm-dev] Can I dump LLVM IR after
              each pass in Clang BackendUtil.cpp
              <div> </div>
            </div>
          </div>
          <span>
            <div class="PlainText">I think that:<br>
              <br>
                 -mllvm -print-after-all<br>
              <br>
              does that you need.  It is "very" verbose though and you
              might prefer to use:<br>
              <br>
                 -mllvm -print-after=<selected-passes><br>
              <br>
              Use '-mllvm -help' or '-mllvm --help-hidden' to see all
              the options.<br>
              <br>
                      MartinO<br>
              <br>
              -----Original Message-----<br>
              From: llvm-dev [<a moz-do-not-send="true"
                href="mailto:llvm-dev-bounces@lists.llvm.org"
                title="mailto:llvm-dev-bounces@lists.llvm.org
                Ctrl+Click or tap to follow the link">mailto:llvm-dev-bounces@lists.llvm.org</a>]
              On Behalf Of Zhengyang Liu via llvm-dev<br>
              Sent: 12 June 2016 13:39<br>
              To: <a class="moz-txt-link-abbreviated" href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
              Subject: [llvm-dev] Can I dump LLVM IR after each pass in
              Clang BackendUtil.cpp<br>
              <br>
              Dear llvm-dev,<br>
              <br>
              I am trying to debug some passes , these passes are added
              to <br>
              legacy::PassManager(MPM) in Clang's
              lib/CodeGen/BackendUtil.cpp  :<br>
              <br>
              <br>
              //******<br>
              void EmitAssemblyHelper::CreatePasses() {<br>
              //******<br>
                 if (CodeGenOpts.MemSafety) {<br>
                   //<br>
                   // Add passes that record information about run-time
              checks.<br>
                   //<br>
                   MPM->add (createCommonMSCInfoPass());<br>
                   MPM->add (createSAFECodeMSCInfoPass());<br>
              //******<br>
              <br>
              Could I dump the output LLVM IR after each pass in
              PassManager MPM?<br>
              <br>
              Best regards,<br>
              Zhengyang.<br>
              _______________________________________________<br>
              LLVM Developers mailing list<br>
              <a class="moz-txt-link-abbreviated" href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
              <a moz-do-not-send="true"
                href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
              <br>
            </div>
          </span></div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>
<a class="moz-txt-link-freetext" href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a>
</pre>
    </blockquote>
    <br>
    <p><br>
    </p>
    <pre class="moz-signature" cols="72">-- 
John Criswell
Assistant Professor
Department of Computer Science, University of Rochester
<a class="moz-txt-link-freetext" href="http://www.cs.rochester.edu/u/criswell">http://www.cs.rochester.edu/u/criswell</a></pre>
  </body>
</html>