archivesOfToyLang/tshunhue/遞歸下降分析器/LLVM
2026-11-22 23:19:50 +08:00
..
a-精簡版.ll initial commit 2026-11-22 23:19:50 +08:00
a-精簡版.o initial commit 2026-11-22 23:19:50 +08:00
a-精簡版.s initial commit 2026-11-22 23:19:50 +08:00
a.cpp initial commit 2026-11-22 23:19:50 +08:00
a.ll initial commit 2026-11-22 23:19:50 +08:00
a.o initial commit 2026-11-22 23:19:50 +08:00
a.out initial commit 2026-11-22 23:19:50 +08:00
b.out initial commit 2026-11-22 23:19:50 +08:00
README initial commit 2026-11-22 23:19:50 +08:00

=========
Converting LLVM IR to an executable file
=========
clang++ -S -emit-llvm a.cpp // get llvm ir
llc a.ll -filetype=obj // get .o file
g++ -o a.out a.o // converting to executable file
./a.out
echo $? // get the return value of a.out

=========
See also
=========
http://llvmlite.pydata.org/en/latest/
https://mapping-high-level-constructs-to-llvm-ir.readthedocs.io/en/latest/