<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 7/10/16 2:20 PM, Yuxi Chen via
      llvm-dev wrote:<br>
    </div>
    <blockquote
      cite="mid:83E2887150EB424E8D7877B912AE1FF167C5056F@xm-mbx-07-prod"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
      <div style="direction: ltr;font-family: Tahoma;color:
        #000000;font-size: 10pt;">Hi All,
        <br>
        <br>
        If I write my own Pass and in a C++ file, how can you invoke it?<br>
        In both of them are Passes, we can use getAnalysis<>(). <br>
        I can't use use getAnalysis<>(), b/c it will throw
        assertion like "Unable to find on the fly pass " or "pass xx by
        yy can't be required".<br>
        <br>
        Any help is appreciated. <br>
      </div>
    </blockquote>
    <br>
    You need to create a PassManager object and use its add() method to
    schedule the passes that you want to run.  Take a look at the opt
    program in llvm/tools/opt for an example.<br>
    <br>
    Regards,<br>
    <br>
    John Criswell<br>
    <br>
    <blockquote
      cite="mid:83E2887150EB424E8D7877B912AE1FF167C5056F@xm-mbx-07-prod"
      type="cite">
      <div style="direction: ltr;font-family: Tahoma;color:
        #000000;font-size: 10pt;">
        <br>
        Best,<br>
        Yuxi<br>
        <br>
        <br>
      </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>