Git Product home page Git Product logo

Comments (1)

LuoRongLuoRong avatar LuoRongLuoRong commented on July 22, 2024

I found the problem. I didn't follow your instruction completely.
I changed /skeleton/CMakefile.txt. The line target_compile_features(SkeletonPass PRIVATE cxx_range_for cxx_auto_type) should not be omitted.
Then I run commands as follows:

(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!

from llvm-pass-skeleton.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.