<div dir="ltr">Hi All,<div><br></div><div>As some of you have noticed, Kaleidoscope has had some issues since we removed the legacy JIT last year. The tutorial code had been relying on the behavior of the legacy JIT, and the switch to MCJIT caused many simple use-cases to break (e.g. repeat calls to functions). Kaleidoscope Chapter 4, which introduces JIT support, had been largely fixed by taking some of the code from Andy Kaylor's Kaleidoscope/MCJIT tutorials, but this added a lot of engineering detail to what was supposed to be a beginner's tutorial. The later chapters were never updated.</div><div><br></div><div>The attached patch fixes this situation by updating all of the Kaleidoscope tutorials to use a new, custom, ORC-based JIT: KaleidoscopeJIT. By using this instead of MCJIT, all of the original Kaleidoscope functionality is restored, and we actually do a better job of behaving like a REPL (for example, functions can be redefined). Assuming this patch is accepted, in the near future I hope to add one or two new chapters to Kaleidoscope that involve modifying the KaleidoscopeJIT to support lazy compilation (This will mostly involve merging code from the Kaleidoscope/Orc tutorials).</div><div><br></div><div>Most of this patch is concerned with the switch to KaleidoscopeJIT and corresponding updates to the documentation. In particular, Chapter 4 has been substantially updated. There is also a little bit of C++11 modernization and general cleanup.</div><div><br></div><div>All comments welcome. If anyone would like to road-test the new tutorials I'd be particularly interested to hear feedback on that. </div><div><br></div><div>Cheers,</div><div>Lang.</div><div><br></div></div>