[llvm-dev] Opt can't find 'hello' pass

Fāng-ruì Sòng via llvm-dev llvm-dev at lists.llvm.org
Wed Feb 10 14:41:51 PST 2021


https://llvm.org/docs/WritingAnLLVMPass.html is mostly  about the
legacy pass manager.
A big revamp is needed to make it new PM ready:)

On Wed, Feb 10, 2021 at 2:12 PM Arthur Eubanks via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
>
> 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
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev



-- 
宋方睿


More information about the llvm-dev mailing list