<div dir="ltr"><div class="gmail_default" style="font-family:georgia,serif;font-size:large">Is there anyone who can clear my confusion ?<br><br></div><div class="gmail_default" style="font-family:georgia,serif;font-size:large">thanks ! <br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Feb 2, 2015 at 11:32 AM, Hui Zhang <span dir="ltr"><<a href="mailto:wayne.huizhang@gmail.com" target="_blank">wayne.huizhang@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"><div class="gmail_default" style="font-family:georgia,serif;font-size:large">Hello, <br><br></div><div class="gmail_default" style="font-family:georgia,serif;font-size:large">I'm a little confused about the 3th and 4th arguments in the registration function, explained here: <br><a href="http://llvm.org/releases/3.3/docs/WritingAnLLVMPass.html" target="_blank">http://llvm.org/releases/3.3/docs/WritingAnLLVMPass.html</a><br><br></div><div class="gmail_default" style="font-family:georgia,serif;font-size:large">e.g <br><pre><span>static</span> <span>RegisterPass</span><span><</span><span>Hello</span><span>></span> <span>X</span><span>(</span><span>"hello"</span><span>,</span> <span>"Hello World Pass"</span><span>,</span>
                             <span>false</span> <span>/* Only looks at CFG */</span><span>,</span>
                             <span>false</span> <span>/* Analysis Pass */</span><span>);</span></pre></div><div class="gmail_default" style="font-family:georgia,serif;font-size:large"><br>"Lastly, we <a href="http://llvm.org/releases/3.3/docs/WritingAnLLVMPass.html#writing-an-llvm-pass-registration" target="_blank"><em>register our class</em></a>
<tt><span>Hello</span></tt>, giving it a command line argument “<tt><span>hello</span></tt>”, and a name “Hello
World Pass”.  The last two arguments describe its behavior: if a pass walks CFG
without modifying it then the third argument is set to <tt><span>true</span></tt>; if a pass is
an analysis pass, for example dominator tree pass, then <tt><span>true</span></tt> is supplied as
the fourth argument."<br><br></div><div class="gmail_default" style="font-family:georgia,serif;font-size:large">In this simple "Hello" pass, it only look at all the functions and print out their name. So what's the difference between 3th and 4th argument here ??<br><br></div><div class="gmail_default" style="font-family:georgia,serif;font-size:large">And since Hello pass didn't modify the module but analized it(as I understand), shouldn't both of them be true instead of false in the example ??<br><br>thanks<span class="HOEnZb"><font color="#888888"><br clear="all"></font></span></div><span class="HOEnZb"><font color="#888888"><br>-- <br><div>Best regards<br><br><br>Hui Zhang<br></div>
</font></span></div>
</blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature">Best regards<br><br><br>Hui Zhang<br></div>
</div>