<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></head><body dir="auto"><div dir="auto">Hi,</div><div dir="auto"><br></div><div dir="auto">Actually I copy-pasted step 5 from the article in which I found the solution, in the text of the mail so that is why dummypass appears instead of hello. I used hello instead of dummypass in my tries, but it still doesn't display nothing after recompiling the pass. The hello.c file contains several functions, so the module pass should display something (I placed a message at the verry beginning of the runOnModule funtion of the pass). I am compiling all the code once with ninja on Linux and I have seen that the hello pass is compiled as well. I have not compiled it separatelly.</div><div dir="auto"><br></div><div dir="auto">Do you have any ideas why is this?</div><div dir="auto"><br></div><div dir="auto">Thank you,</div><div dir="auto">Iulia</div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><br></div><div id="composer_signature" dir="auto"><div style="font-size:85%;color:#575757" dir="auto">Trimis de pe smartphone-ul meu Samsung Galaxy.</div></div><div><br></div><div style="font-size:100%;color:#000000" dir="auto"><!-- originalMessage --><div>-------- Mesaj original --------</div><div>De la: Andrzej Warzynski <Andrzej.Warzynski@arm.com> </div><div>Date: 17.09.2019  10:44  (GMT+02:00) </div><div>Către: Iulia Stirb <iulia_s24@yahoo.com>, via Llvm-dev <llvm-dev@lists.llvm.org>, nd <nd@arm.com> </div><div>Subiect: Re: [llvm-dev] How to debug passes </div><div><br></div></div>Hi Iulia,<br><br>You can skip step 5 - it's not required. opt will happily work with *.ll<br>as well as *.bc files. Since textual form _is_ much easier to read for<br>humans, you can generate it directly in step 4:<br><br>clang -O3 -emit-llvm -S hello.c -c -o hello.ll<br><br>Otherwise your steps look correct (assuming that when registering your<br>pass with RegisterPass<> you used 'dummypass' as the name for your<br>pass). Did you verify that hello.ll contains any functions? And have you<br>tried similar steps with the Hello pass?<br><br>-Andrzej<br><br>On 16/09/2019 14:49, Iulia Stirb via llvm-dev wrote:<br>> Hi,<br>><br>> Could you please confirm the following steps for debugging a pass?<br>><br>> 1. copy your pass into llvm/lib/Transforms/Hello/Hello.cpp<br>><br>> 2. name you pass Hello<br>><br>> 3. insert debug messages like:|<br>> |<br>> |<br>> |<br>> |    errs() << "Vis­iting func­tion " << F.get­Name();|<br>> |<br>> |<br>> ||4. get LLVM bitcode:<br>> |<br>><br>>      clang -O3 -emit-llvm hello.c -c -o hello.bc<br>><br>> |<br>><br>> |5. disassemble the bitcode:<br>><br>> |    llvm-dis hel­lo.bc|<br>><br>> 6. |run the pass on your program:<br>><br>>      opt -load lib­dum­my­pass.so -dum­my­pass hel­lo.ll|<br>> |<br>><br>><br>> The above steps did not work because the last step does not display any<br>> 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>><br>> Thank you.<br>> Kind regards,<br>> Iulia<br>><br>><br>><br>><br>> _______________________________________________<br>> LLVM Developers mailing list<br>> llvm-dev@lists.llvm.org<br>> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev<br>><br>IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.<br></body></html>