<div dir="ltr">That's due to the recent transition to the new pass manager. Adding -enable-new-pm=0 to the opt command should work.<div><br></div><div>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><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">llvm-dev@lists.llvm.org</a>> wrote:<br></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;">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">https://llvm.org/docs/WritingAnLLVMPass.html</a>), but whenever I run:<div><br></div><div>$BUILD_DIR/bin/clang -c -emit-llvm hello.c<br><div><br></div><div>$BUILD_DIR/bin/opt -load $BUILD_DIR/lib/LLVMHello.so -hello < hello.bc > /dev/null</div><div><br></div><div><br></div><div><br></div><div>I get the following error:</div><div><br></div><div>bin/opt: unknown pass name ‘hello’</div><div><br></div><div><br></div><div><br></div><div>Which seems odd because if I run:</div><div><br></div><div>$BUILD_DIR/bin/opt -load $BUILD_DIR/lib/LLVMHello.so --help | grep hello</div><div><br></div><div><br></div><div>I get:</div><div><br></div><div>--hello <span style="white-space:pre-wrap">          </span>- Hello World Pass</div><div><br></div><div><br></div><div>To build LLVM I’m running the following commands from my build directory:</div><div><br></div><div>cmake -G Ninja -DLLVM_ENABLE_PROJECTS=‘clang’ ../llvm</div><div><br></div><div>cmake --build . </div><div><br></div><div><br></div><div>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><br></div></div></div>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>