<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">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 class="">static</span> <span class="">RegisterPass</span><span class=""><</span><span class="">Hello</span><span class="">></span> <span class="">X</span><span class="">(</span><span class="">"hello"</span><span class="">,</span> <span class="">"Hello World Pass"</span><span class="">,</span>
                             <span class="">false</span> <span class="">/* Only looks at CFG */</span><span class="">,</span>
                             <span class="">false</span> <span class="">/* Analysis Pass */</span><span class="">);</span></pre></div><div class="gmail_default" style="font-family:georgia,serif;font-size:large"><br>"Lastly, we <a class="" href="http://llvm.org/releases/3.3/docs/WritingAnLLVMPass.html#writing-an-llvm-pass-registration"><em>register our class</em></a>
<tt class=""><span class="">Hello</span></tt>, giving it a command line argument “<tt class=""><span class="">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 class=""><span class="">true</span></tt>; if a pass is
an analysis pass, for example dominator tree pass, then <tt class=""><span class="">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<br clear="all"></div><br>-- <br><div class="gmail_signature">Best regards<br><br><br>Hui Zhang<br></div>
</div>