Open Quuxplusone opened 3 years ago
New here, but from what I found the hello pass uses the old pass manager.
Providing
-enable-new-pm=0
along with what you have should get you what you want.
$ ./bin/clang -emit-llvm sample.c -c -o sample.bc
$ ./bin/opt -load lib/LLVMHello.so -hello -enable-new-pm=0 < sample.bc >
/dev/null
Hello: foo
Hello: main
It may be worth it to update the
https://llvm.org/docs/WritingAnLLVMPass.html#running-a-pass-with-opt section
with this flag, or add an additional banner aside from the one at the top of
the page. Not sure what the process is but I'd be happy to do this.
~ Matt
I didn't root cause the issue. However, the current 'main' branch Passes seems broken.
To reproduce, git clone current main branch. Build it, and create any sample C program. Like:
int foo() { return 0; }
int main() { foo(); return 0; }
and then run:
This will happen for any Pass we create too, and that's how I noticed it.
This works fine, if instead of the main branch, we download and build for example the latest release candidate llvm-project-llvmorg-12.0.0-rc3.tar.gz source.
The expected behavior would be:
Thank you.