<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">I see. Thanks to  your help, I could proceed a lot.<div class=""><br class=""></div><div class="">I am wondering how out-of-tree LLVM pass is robust. I am building my custom pass on one machine and want to run this for other machines (e.g., Docker images).</div><div class="">I notice that LLVM IR’s OPCode is different from versions. Also it seems that type matching (e.g., if (llvm::CallInst *CI = llvm::dyn_cast<llvm::CallInst>(&I))) does not work well another machine. But I am not sure whether my guess is correct or not.</div><div class="">Do you have any idea or suggestion?</div><div class=""><br class=""></div><div class="">- Kihong</div><div class=""><div><br class=""><blockquote type="cite" class=""><div class="">2019. 6. 28. 오후 7:27, Mehdi AMINI <<a href="mailto:joker.eph@gmail.com" class="">joker.eph@gmail.com</a>> 작성:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div dir="ltr" class=""><div dir="ltr" class=""><br class=""></div><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jun 28, 2019 at 4:21 PM Kihong Heo via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">You are right. Thanks!<br class="">
I fixed that one as well as some other issues.<br class="">
I built LLVM-8 with Debug + no-rtti. But it now has the following error:<br class="">
<br class="">
Stack dump:<br class="">
0.      Program arguments: clang-8 -cc1 -triple x86_64-unknown-linux-gnu -emit-llvm -disable-free -main-file-name time-1.7.c -mrelocation-model static -mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64 -dwarf-column-info -debugger-tuning=gdb -coverage-notes-file /home/khheo/project/parametric-symexe/test/toy1/time-1.7.gcno -resource-dir /home/khheo/project/llvm-8/build/lib/clang/8.0.1 -internal-isystem /usr/local/include -internal-isystem /home/khheo/project/llvm-8/build/lib/clang/8.0.1/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -O0 -fdebug-compilation-dir /home/khheo/project/parametric-symexe/test/toy1 -ferror-limit 19 -fmessage-length 364 -fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics -load ../../trace-extractor/build/TracePass.so -o time-1.7.ll -x c /home/khheo/project/all/time-1.7.c -faddrsig<br class="">
1.      <eof> parser at end of file<br class="">
2.      Per-module optimization passes<br class="">
3.      Running pass 'Unnamed pass: implement Pass::getPassName()' on module '/home/khheo/project/all/time-1.7.c'.<br class="">
…<br class="">
<br class="">
What does "Running pass 'Unnamed pass: implement Pass::getPassName()' on module” mean?<br class=""></blockquote><div class=""><br class=""></div><div class="">It is just debugging on crashes, passes can override this method: <a href="https://github.com/llvm/llvm-project/blob/master/llvm/include/llvm/Pass.h#L96" class="">https://github.com/llvm/llvm-project/blob/master/llvm/include/llvm/Pass.h#L96</a> to provide a more readable name.</div><div class="">In practice if passes are registered it isn't needed I think.</div><div class="">In any case this is not the cause of the crash, you can try running the clang -cc1 command in a debugger.</div><div class=""><br class=""></div><div class="">-- </div><div class="">Mehdi</div><div class=""><br class=""></div><div class=""> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
<br class="">
- Kihong<br class="">
<br class="">
<br class="">
> On Jun 28, 2019, at 4:48 PM, Tim Northover <<a href="mailto:t.p.northover@gmail.com" target="_blank" class="">t.p.northover@gmail.com</a>> wrote:<br class="">
> <br class="">
> On Fri, 28 Jun 2019 at 21:18, Kihong Heo <<a href="mailto:kihong.heo@gmail.com" target="_blank" class="">kihong.heo@gmail.com</a>> wrote:<br class="">
>> When I search for this issue on Google, it seems to be relevant to “RTTI”.<br class="">
> <br class="">
> Yep, that's a typeinfo symbol.<br class="">
> <br class="">
>> But as I know LLVM is built by default -fno-rtti. I also explicitly turned off it. Here is my cmake command:<br class="">
>> <br class="">
>> $ cmake -DCMAKE_BUILD_TYPE=Debug -DLLVM_ENABLE_RTTI=OFF -DLLVM_ENABLE_PROJECTS=clang -G "Unix Makefiles"  ../llvm<br class="">
>> <br class="">
>> Any thought?<br class="">
> <br class="">
> My best guess is that your pass was built *with* RTTI (i.e. no<br class="">
> -fno-rtti) but LLVM without. A quick fix would be to switch to<br class="">
> -DLLVM_ENABLE_RTTI=ON, but longer term you may want to look into your<br class="">
> pass's build system.<br class="">
> <br class="">
> Cheers.<br class="">
> <br class="">
> tim.<br class="">
<br class="">
_______________________________________________<br class="">
LLVM Developers mailing list<br class="">
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank" class="">llvm-dev@lists.llvm.org</a><br class="">
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank" class="">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br class="">
</blockquote></div></div></div>
</div></blockquote></div><br class=""></div></body></html>