<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="">Got it. Thank you. I tried using the new pass manager from the new tutorial as well but was having an issue where the ‘helloworld’ pass would only work if I manually removed all the metadata from my hello.ll file to where the only thing in it was the function. Otherwise, it would run silently and not print out any function names. Any solution to that?<div class=""><br class=""><div class=""></div><div><br class=""><blockquote type="cite" class=""><div class="">On Feb 10, 2021, at 2:11 PM, Arthur Eubanks <<a href="mailto:aeubanks@google.com" class="">aeubanks@google.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html; charset=utf-8" class=""><div dir="ltr" class="">That's due to the recent transition to the new pass manager. Adding -enable-new-pm=0 to the opt command should work.<div class=""><br class=""></div><div class="">I'll update the documentation to explicitly say that the legacy pass manager is no longer the default in big red letters.</div></div><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Feb 10, 2021 at 1:49 PM Joshua R Hilke 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:1px solid rgb(204,204,204);padding-left:1ex"><div style="overflow-wrap: break-word;" class="">I’m just trying to run the hello world example from the LLVM Writing a Pass Tutorial (<a href="https://llvm.org/docs/WritingAnLLVMPass.html" target="_blank" class="">https://llvm.org/docs/WritingAnLLVMPass.html</a>), but whenever I run:<div class=""><br class=""></div><div class="">$BUILD_DIR/bin/clang -c -emit-llvm hello.c<br class=""><div class=""><br class=""></div><div class="">$BUILD_DIR/bin/opt -load $BUILD_DIR/lib/LLVMHello.so -hello < hello.bc > /dev/null</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">I get the following error:</div><div class=""><br class=""></div><div class="">bin/opt: unknown pass name ‘hello’</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Which seems odd because if I run:</div><div class=""><br class=""></div><div class="">$BUILD_DIR/bin/opt -load $BUILD_DIR/lib/LLVMHello.so --help | grep hello</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">I get:</div><div class=""><br class=""></div><div class="">--hello <span style="white-space:pre-wrap" class="">         </span>- Hello World Pass</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">To build LLVM I’m running the following commands from my build directory:</div><div class=""><br class=""></div><div class="">cmake -G Ninja -DLLVM_ENABLE_PROJECTS=‘clang’ ../llvm</div><div class=""><br class=""></div><div class="">cmake --build . </div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Just to clarify, I’m not writing my own pass. Just trying to run the ‘hello’ pass that comes default when building LLVM</div><div class=""><br class=""></div></div></div>_______________________________________________<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></blockquote></div><br class=""></div></body></html>