[PATCH] D26208: [Kaleidoscope] Fix incorrect build command in Chapter 2.

Ismail Badawi via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 1 11:42:25 PDT 2016


ibadawi created this revision.
ibadawi added a reviewer: lhames.
ibadawi added a subscriber: llvm-commits.

https://reviews.llvm.org/rL281945 made the Chapter 2 code use llvm::make_unique. The code was previously standalone, but it now needs to point to the llvm headers in order to build.


https://reviews.llvm.org/D26208

Files:
  docs/tutorial/LangImpl02.rst
  docs/tutorial/LangImpl03.rst


Index: docs/tutorial/LangImpl03.rst
===================================================================
--- docs/tutorial/LangImpl03.rst
+++ docs/tutorial/LangImpl03.rst
@@ -546,10 +546,7 @@
 =================
 
 Here is the complete code listing for our running example, enhanced with
-the LLVM code generator. Because this uses the LLVM libraries, we need
-to link them in. To do this, we use the
-`llvm-config <http://llvm.org/cmds/llvm-config.html>`_ tool to inform
-our makefile/command line about which options to use:
+the LLVM code generator. As before, to build this example, use:
 
 .. code-block:: bash
 
Index: docs/tutorial/LangImpl02.rst
===================================================================
--- docs/tutorial/LangImpl02.rst
+++ docs/tutorial/LangImpl02.rst
@@ -714,17 +714,17 @@
 Full Code Listing
 =================
 
-Here is the complete code listing for this and the previous chapter.
-Note that it is fully self-contained: you don't need LLVM or any
-external libraries at all for this. (Besides the C and C++ standard
-libraries, of course.) To build this, just compile with:
+Here is the complete code listing for this and the previous chapter. Because
+this example uses the LLVM libraries, we need to link them in in order to build
+it. To do this, use the :doc:`llvm-config </CommandGuide/llvm-config>` tool to
+inform our makefile/command line about which options to use:
 
 .. code-block:: bash
 
     # Compile
-    clang++ -g -O3 toy.cpp
+    clang++ -g -O3 toy.cpp `llvm-config --cxxflags --ldflags --system-libs --libs core` -o toy
     # Run
-    ./a.out
+    ./toy
 
 Here is the code:
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26208.76610.patch
Type: text/x-patch
Size: 1635 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161101/6d8f26db/attachment.bin>


More information about the llvm-commits mailing list