-
Notifications
You must be signed in to change notification settings - Fork 187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pass has no effect #30
Comments
I found the problem. I didn't follow your instruction completely. (base) fdse@ubuntu:~/luorong/LLVM/test/llvm-pass-skeleton/build$ cmake ..
-- Configuring done
-- Generating done
-- Build files have been written to: /home/fdse/luorong/LLVM/test/llvm-pass-skeleton/build
(base) fdse@ubuntu:~/luorong/LLVM/test/llvm-pass-skeleton/build$ make
Consolidate compiler generated dependencies of target SkeletonPass
[ 50%] Building CXX object skeleton/CMakeFiles/SkeletonPass.dir/Skeleton.cpp.o
[100%] Linking CXX shared module libSkeletonPass.so
[100%] Built target SkeletonPass
(base) fdse@ubuntu:~/luorong/LLVM/test/llvm-pass-skeleton/build$ cd skeleton/
(base) fdse@ubuntu:~/luorong/LLVM/test/llvm-pass-skeleton/build/skeleton$ ls
CMakeFiles cmake_install.cmake libSkeletonPass.so Makefile
(base) fdse@ubuntu:~/luorong/LLVM/test/llvm-pass-skeleton/build/skeleton$ opt -load ./libSkeletonPass.so -help | grep skeleton
--skeleton - a useless pass
(base) fdse@ubuntu:~/luorong/LLVM/test/llvm-pass-skeleton/build/skeleton$ cd ../../src
(base) fdse@ubuntu:~/luorong/LLVM/test/llvm-pass-skeleton/src$ clang++ -O0 -g -S -emit-llvm demo.cpp -o demo.ll
(base) fdse@ubuntu:~/luorong/LLVM/test/llvm-pass-skeleton/src$ ls
demo.cpp demo.ll
(base) fdse@ubuntu:~/luorong/LLVM/test/llvm-pass-skeleton/src$ opt -load ../build/skeleton/libSkeletonPass.so -skeleton demo.ll -enable-new-pm=0
WARNING: You're attempting to print out a bitcode file.
This is inadvisable as it may cause display problems. If
you REALLY want to taste LLVM bitcode first-hand, you
can force output with the `-f' option.
I saw a function called _Z5func2v!
I saw a function called _Z4funcv!
I saw a function called main! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I don't know why. I followed the instructions in the readme. But when finally I use the command
clang -flegacy-pass-manager -Xclang -load -Xclang build/skeleton/libSkeletonPass.* something.c
and get thea.out
and run it, what I get is the same as the result produced by a simple commandgcc something.c
.and here is my code structure:
/skeleton/CMakefile.txt:
/skeleton/Skeleton.cpp
/CMakeLists.txt
/src/demo.cpp
Actually, when I run
make
in/build
, I then runopt -load ./libSkeletonPass.so -help | grep skeleton
to show information of pass. BUT, I get NOTHING. It means that I don't have any pass.So, I would like to ask for help. SO MUCH THANKS!
The text was updated successfully, but these errors were encountered: