That's due to the recent transition to the new pass manager. Adding
-enable-new-pm=0 to the opt command should work.
I'll update the documentation to explicitly say that the legacy pass
manager is no longer the default in big red letters.
On Wed, Feb 10, 2021 at 1:49 PM Joshua R Hilke via llvm-dev <
llvm-dev at lists.llvm.org> wrote:
> I’m just trying to run the hello world example from the LLVM Writing a
> Pass Tutorial (https://llvm.org/docs/WritingAnLLVMPass.html), but
> whenever I run:
>
> $BUILD_DIR/bin/clang -c -emit-llvm hello.c
>
> $BUILD_DIR/bin/opt -load $BUILD_DIR/lib/LLVMHello.so -hello < hello.bc
>
> /dev/null
>
>
>
> I get the following error:
>
> bin/opt: unknown pass name ‘hello’
>
>
>
> Which seems odd because if I run:
>
> $BUILD_DIR/bin/opt -load $BUILD_DIR/lib/LLVMHello.so --help | grep hello
>
>
> I get:
>
> --hello - Hello World Pass
>
>
> To build LLVM I’m running the following commands from my build directory:
>
> cmake -G Ninja -DLLVM_ENABLE_PROJECTS=‘clang’ ../llvm
>
> cmake --build .
>
>
> Just to clarify, I’m not writing my own pass. Just trying to run the
> ‘hello’ pass that comes default when building LLVM
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20210210/3a47b528/attachment.html>