[PATCH] [docs] Use literalinclude for most code in the Kaleidoscope tutorial

Aron Granberg via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 18 09:44:13 PST 2018


Hi

This is my first patch submission to this list, so you'll have to tell me
if I do anything wrong somewhere.

The code in the kaleidoscope tutorial is currently inlined in the
documentation pages and is thus never compiled to ensure it still works.
Over time this code has diverged from the full code listing in small and
subtle ways (such as the FunctionPassManager being in the legacy namespace)
which makes it very hard for anyone following the tutorial to actually get
something working.

I have replaced almost all of the code blocks in the tutorial with
literalinclude blocks which include code directly from the source files
based on markers. This ensures that the code in the tutorial actually
compiles and is up to date, even when future changes are made.

I have uploaded a .patch file here: https://pastebin.com/yvEBPY2x.
This was generated using git format-patch, I am not quite sure if this is
the same format as svn diff though.

I have also uploaded a visual html diff here:
https://arongranberg.com/temp/llvm-diff/
with the changed files having URLs on the format
https://arongranberg.com/temp/llvm-diff/LangImpl0[1-8].html
Note that the html diff library gets a little confused when some lines have
been emphasized and it may emphasize more lines than are actually
emphasized or may add lots of additional spacing.

- Aron Granberg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180218/38e6360d/attachment.html>


More information about the llvm-commits mailing list