LLVM Examples and Code samples. LLVM Passes. Based on llvm-project
# llvm cmake
cmake -G "Ninja" build \
-DLLVM_ENABLE_PROJECTS="llvm;compiler-rt;clang;clang-tools-extra" \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_ENABLE_ASSERTIONS=ON \
-DLLVM_CCACHE_BUILD=OFF \
-DLLVM_BUILD_TESTS=ON \
-DLLVM_INSTALL_UTILS=ON \
-B build -S llvm
Check build
commands in the Dockerfile
for more information
on installing LLVM
on local machine.
$ docker build -f DockerFile -t prodrelworks/llvm-examples:latest .
$ docker run --name llvm-examples --ulimit stack=10000000:10000000 \
--cpus=4 --memory=20g -it prodrelworks/llvm-examples:latest
- llvm::LoopInfo in the runOnModule
- Analysing CFGs with LLVM
- A tutorial on how to write a compiler using LLVM
-
Legacy Pass Example : See
folder
. -
New LLVM Pass Manager :
-
For function paraments as operands, you can get it get it via Function Argumentslist()
-
Some other differences are listed here. Even C++ one is quadratic probed.
-
Where is "emit-llvm"? ASMWritter
AsmWritter.cpp
. -
LLVM Data Structures
: -
LLVM RTTI
: -
Inspection & Traversal over
CFG
inIR
: