<div dir="ltr">Hi All,<div style>Looking at the code of MemDepPrinter.cpp, I saw the </div><div style><span style="color:rgb(0,0,0);white-space:pre-wrap"><br></span></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<span style="color:rgb(0,0,0);white-space:pre-wrap"><font face="arial, helvetica, sans-serif">char MemDepPrinter::ID = 0;<br></font></span><font face="arial, helvetica, sans-serif">INITIALIZE_PASS_BEGIN(MemDepPrinter, "print-memdeps",<br>
</font><font face="arial, helvetica, sans-serif"> "Print MemDeps of function", false, true)<br></font><font face="arial, helvetica, sans-serif">INITIALIZE_PASS_DEPENDENCY(MemoryDependenceAnalysis)<br>
</font><font face="arial, helvetica, sans-serif">INITIALIZE_PASS_END(MemDepPrinter, "print-memdeps",<br></font><font face="arial, helvetica, sans-serif"> "Print MemDeps of function", false, true)</font></blockquote>
<pre style="word-wrap:break-word"><font face="arial, helvetica, sans-serif" style="color:rgb(0,0,0);white-space:pre-wrap">What's the purpose of the </font><font color="#000000" face="arial, helvetica, sans-serif"><span style="white-space:pre-wrap">INITIALIZE_PASS_* macros? What's the difference between using </span><span style="white-space:pre-wrap">static RegisterPass...?</span></font></pre>
<pre style="word-wrap:break-word"><font color="#000000" face="arial, helvetica, sans-serif"><span style="white-space:pre-wrap">When I try to use these macros in user-defined passes. The compiler complains,</span></font></pre>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><font color="#000000" face="arial, helvetica, sans-serif"><span style="white-space:pre-wrap">error: ‘initializeXXXPass’ was not declared in this scope<br>
</span></font><font color="#000000" face="arial, helvetica, sans-serif"><span style="white-space:pre-wrap">error: ‘void llvm::initializeXXXPass(llvm::PassRegistry&)’ should have been declared inside ‘llvm’</span></font></blockquote>
Is it because they should only be used by internal LLVM passes?<div><br>I couldn't find related hints from the documentation.<div><br></div><div>Thanks!<br>ryan<br></div></div></div>