<div dir="ltr">Yes, I forgot to initialize my pass. <span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Thank you very much. </span></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><br></div><div>Best regards,</div><div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Qiuping Yi</div><div style="font-size:12.8px"><span style="font-size:12.8px">Institute Of Software</span><br style="font-size:12.8px"><span style="font-size:12.8px">Chinese Academy of Sciences</span><br></div></div></div></div></div></div></div></div></div></div>
<br><div class="gmail_quote">On Sat, Apr 14, 2018 at 12:57 AM, Alexandre Isoard <span dir="ltr"><<a href="mailto:alexandre.isoard@gmail.com" target="_blank">alexandre.isoard@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>You need to initialize your pass with:</div><div><br></div><div><span style="color:rgb(128,96,32);font-family:monospace,fixed;font-size:13px;white-space:pre-wrap;background-color:rgb(251,252,253)">INITIALIZE_PASS_BEGIN</span><span style="color:rgb(128,96,32);font-family:monospace,fixed;font-size:13px;white-space:pre-wrap;background-color:rgb(251,252,253)">(<wbr>YourPass, "your-pass", "Your Pass", /*cfgonly=*/false, /*analysis=*/false)</span><br></div><div><span style="color:rgb(128,96,32);font-family:monospace,fixed;font-size:13px;white-space:pre-wrap;background-color:rgb(251,252,253)">INITIALIZE_PASS_DEPENDENCY</span><span style="color:rgb(128,96,32);font-family:monospace,fixed;font-size:13px;white-space:pre-wrap;background-color:rgb(251,252,253)">(<wbr>PostDominatorTreeWrapperPass)</span><span style="color:rgb(128,96,32);font-family:monospace,fixed;font-size:13px;white-space:pre-wrap;background-color:rgb(251,252,253)"><br></span></div><div><span style="color:rgb(128,96,32);font-family:monospace,fixed;font-size:13px;white-space:pre-wrap;background-color:rgb(251,252,253)">INITIALIZE_PASS_END</span><span style="color:rgb(128,96,32);font-family:monospace,fixed;font-size:13px;white-space:pre-wrap;background-color:rgb(251,252,253)">(YourPass, "your-pass", "Your Pass", </span><span style="color:rgb(128,96,32);font-family:monospace,fixed;font-size:13px;white-space:pre-wrap;background-color:rgb(251,252,253)">/*cfgonly=*/false</span><span style="color:rgb(128,96,32);font-family:monospace,fixed;font-size:13px;white-space:pre-wrap;background-color:rgb(251,252,253)">, /*analysis=*/false</span><span style="color:rgb(128,96,32);font-family:monospace,fixed;font-size:13px;white-space:pre-wrap;background-color:rgb(251,252,253)">)</span><span style="color:rgb(128,96,32);font-family:monospace,fixed;font-size:13px;white-space:pre-wrap;background-color:rgb(251,252,253)"><br></span></div><div><br></div>So as to both register your pass, and have PostDominatorTreeWrapperPass (which is the Analysis pass in charge of creating the PostDominatorTree) initialized before your pass.<div><br></div><div>It also give a pretty name to YourPass: "Your Pass"</div><div>And add an option to opt to run it: "-your-pass"</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Wed, Apr 11, 2018 at 9:39 PM, Qiuping Yi via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div>Hi everyone,</div><div><br></div><div>I write a new FunctionPass which wants to use pass PostDominatorTree, so I </div><div>implement the next function:</div><div><br></div><div><div>void getAnalysisUsage(AnalysisUsage &AU) const {</div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">      AU.addRequired<PostDominatorTr<wbr>ee>(); </span><br></div><div>      AU.setPreservesAll();</div><div>}</div></div><div><br></div><div>Then I get PDT through the next statement:</div><div><br></div><div>PostDominatorTree *PDT = &getAnalysis<PostDominatorTree<wbr>>();</div><div><br></div><div>My code can be successfully compiled. However, I encounter the next error when I ran the code:</div><div><br></div><div><div><b>Pass 'Unnamed pass: implement Pass::getPassName()' is not initialized.</b></div><div><b>Verify if there is a pass dependency cycle.</b></div><div><b>Required Passes:</b></div></div><div><br></div><div>I used llvm-3.4. Any comments are welcome. Thanks!</div><br clear="all"><div><div class="m_4806224502838171072m_5038078705988975526gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><br></div><div>Best regards,</div><div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Qiuping Yi</div><div style="font-size:12.8px"><span style="font-size:12.8px">Institute Of Software</span><br style="font-size:12.8px"><span style="font-size:12.8px">Chinese Academy of Sciences</span><br></div></div></div></div></div></div></div></div></div></div>
</div>
<br></div></div>______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div class="m_4806224502838171072gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><b>Alexandre Isoard</b><br></div></div>
</font></span></div>
</blockquote></div><br></div>