mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-29 06:10:48 +00:00
[Orc] Add a Kaleidoscope/Orc tutorial demonstrating lazy-irgen.
This tutorial builds on the lazy_codegen kaleidoscope/orc tutorial by making a small set of changes (~75 lines diff) to defer ir-generation for function definitions until functions are actually referenced. llvm-svn: 228466
This commit is contained in:
parent
03d099fa2a
commit
ea9398780d
9
examples/Kaleidoscope/Orc/lazy_irgen/Makefile
Normal file
9
examples/Kaleidoscope/Orc/lazy_irgen/Makefile
Normal file
@ -0,0 +1,9 @@
|
||||
.PHONY: all
|
||||
all: toy
|
||||
|
||||
toy: toy.cpp
|
||||
clang++ -std=c++11 toy.cpp -g -O0 -rdynamic -fno-rtti `llvm-config --cppflags --ldflags --system-libs --libs core orcjit native` -o toy
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -f toy
|
16
examples/Kaleidoscope/Orc/lazy_irgen/README.txt
Normal file
16
examples/Kaleidoscope/Orc/lazy_irgen/README.txt
Normal file
@ -0,0 +1,16 @@
|
||||
//===----------------------------------------------------------------------===/
|
||||
// Kaleidoscope with Orc - Lazy IRGen Version
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
This version of Kaleidoscope with Orc demonstrates lazy IR-generation.
|
||||
Building on the lazy-codegen version of the tutorial, this version reduces the
|
||||
amount of up-front work that must be done by lazily IRgen'ing ASTs. When a
|
||||
function definition is entered, its AST is added to a map of available
|
||||
definitions. No IRGen is performed at this point and nothing is added to the JIT.
|
||||
When attempting to resolve symbol addresses, the lambda in
|
||||
KaleidoscopeJIT::getSymbolAddress will scan the AST map and generate IR on the
|
||||
fly.
|
||||
|
||||
This directory contains a Makefile that allows the code to be built in a
|
||||
standalone manner, independent of the larger LLVM build infrastructure. To build
|
||||
the program you will need to have 'clang++' and 'llvm-config' in your path.
|
1341
examples/Kaleidoscope/Orc/lazy_irgen/toy.cpp
Normal file
1341
examples/Kaleidoscope/Orc/lazy_irgen/toy.cpp
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user