<html><head></head><body><div class="ydp69adb302yahoo-style-wrap" style="font-family:verdana, helvetica, sans-serif;font-size:10px;"><div><div dir="ltr" data-setdir="false">Hi,</div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false">Could you please confirm the following steps for debugging a pass?</div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false">1. copy your pass into <span>llvm/lib/Transforms/Hello/Hello.cpp</span></div><div dir="ltr" data-setdir="false"><span></span><br></div><div dir="ltr" data-setdir="false">2. name you pass Hello</div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false"><div>3. insert debug messages like:<code class="ydpe9054552sourceCode ydpe9054552cpp ydpe9054552hljs"><br></code></div><div><code class="ydpe9054552sourceCode ydpe9054552cpp ydpe9054552hljs"><br></code></div><div><code class="ydpe9054552sourceCode ydpe9054552cpp ydpe9054552hljs"> errs() << <span class="ydpe9054552st"><span class="ydpe9054552hljs-string">"Visiting function "</span></span> << F.getName();</code></div><div><code class="ydpe9054552sourceCode ydpe9054552cpp ydpe9054552hljs"><br></code></div><code class="ydpe9054552sourceCode ydpe9054552cpp ydpe9054552hljs"></code>4. get LLVM bitcode:<div><code class="ydpe9054552sourceCode ydpe9054552cpp ydpe9054552hljs"><div dir="ltr" data-setdir="false"><span><pre> clang -O3 -emit-llvm hello.c -c -o hello.bc</pre></span></div></code></div></div><div dir="ltr" data-setdir="false"><span><pre><span><pre class="ydpe9054552sourceCode ydpe9054552cpp"><code class="ydpe9054552sourceCode ydpe9054552cpp ydpe9054552hljs"><font face="verdana, helvetica, sans-serif">5. disassemble the bitcode:</font><br><br><span><code> llvm-dis hello.bc</code></span><br><font face="verdana, helvetica, sans-serif"><br>6. </font><span><code><font face="verdana, helvetica, sans-serif">run the pass on your program:</font><br> <br> opt -load libdummypass.so -dummypass hello.ll</code></span><br></code></pre></span><br><font face="verdana, helvetica, sans-serif">The above steps did not work because the last step does not display any error message that has been added in the pass.<br><br>Could you please help to debug the pass by displaying the error messages?<br></font></pre></span></div><div class="ydp69adb302signature"><div style="font-family:verdana, helvetica, sans-serif;font-size:10px;" dir="ltr" data-setdir="false"><div dir="ltr" data-setdir="false">Thank you.<br></div><div>Kind regards,</div><div dir="ltr" data-setdir="false">Iulia<br></div><div><br></div><div><br></div><div><br></div></div></div></div></div></body></html>