[PATCH] D52166: Fixed code snippet in Kaleidoscope tutorial to reflect final full code listing

Frank He via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 17 03:24:03 PDT 2018


n0madsky created this revision.
n0madsky added reviewers: Wilfred, lattner.
Herald added a subscriber: llvm-commits.

In section 3.4 of the Kaleidoscope Tutorial, there are some code snippets relating to PrototypeAST::codegen()

  Function *F =
    Function::Create(FT, Function::ExternalLinkage, Name, TheModule); <- note here

In the final Full code listing, this was changed to

  Function *F =
      Function::Create(FT, Function::ExternalLinkage, Name, TheModule.get()); <-

This simple patch changes the first code snippet to be consistent with the second part.


Repository:
  rL LLVM

https://reviews.llvm.org/D52166

Files:
  docs/tutorial/LangImpl03.rst


Index: docs/tutorial/LangImpl03.rst
===================================================================
--- docs/tutorial/LangImpl03.rst
+++ docs/tutorial/LangImpl03.rst
@@ -275,7 +275,7 @@
         FunctionType::get(Type::getDoubleTy(TheContext), Doubles, false);
 
       Function *F =
-        Function::Create(FT, Function::ExternalLinkage, Name, TheModule);
+        Function::Create(FT, Function::ExternalLinkage, Name, TheModule.get());
 
 This code packs a lot of power into a few lines. Note first that this
 function returns a "Function\*" instead of a "Value\*". Because a


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52166.165731.patch
Type: text/x-patch
Size: 584 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180917/b67dcac8/attachment.bin>


More information about the llvm-commits mailing list