1//===----------------------------------------------------------------------===/
2//                 Kaleidoscope with Orc - Lazy IRGen Version
3//===----------------------------------------------------------------------===//
4
5This version of Kaleidoscope with Orc demonstrates fully lazy IR-generation.
6Building on the lazy-irgen version of the tutorial, this version injects JIT
7callbacks to defer the bulk of IR-generation and code-generation of functions until
8they are first called.
9
10When a function definition is entered, a JIT callback is created and a stub
11function is built that will call the body of the function indirectly. The body of
12the function is *not* IRGen'd at this point. Instead, the function pointer for
13the indirect call is initialized to point at the JIT callback, and the compile
14action for the callback is initialized with a lambda that IRGens the body of the
15function and adds it to the JIT. The function pointer is updated by the JIT
16callback's update action to point at the newly emitted function body, so future
17calls to the stub will go straight to the body, not through the JIT.
18
19This directory contains a Makefile that allows the code to be built in a
20standalone manner, independent of the larger LLVM build infrastructure. To build
21the program you will need to have 'clang++' and 'llvm-config' in your path.
22