[llvm] 8df6637 - [doc] Fix Kaleidoscope tutorial chapter 3 code snippet and full listing discrepancies (#111289)

via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 7 03:43:31 PDT 2024


Author: AidinT
Date: 2024-10-07T12:43:27+02:00
New Revision: 8df6637e84c4fa08e4649079fb21a6932a6926a4

URL: https://github.com/llvm/llvm-project/commit/8df6637e84c4fa08e4649079fb21a6932a6926a4
DIFF: https://github.com/llvm/llvm-project/commit/8df6637e84c4fa08e4649079fb21a6932a6926a4.diff

LOG: [doc] Fix Kaleidoscope tutorial chapter 3 code snippet and full listing discrepancies (#111289)

Fix two discrepancies between the cited snippets and the full code.

Added: 
    

Modified: 
    llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl03.rst

Removed: 
    


################################################################################
diff  --git a/llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl03.rst b/llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl03.rst
index 2f3f688406212a..f41c5ed0ad0cdb 100644
--- a/llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl03.rst
+++ b/llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl03.rst
@@ -74,7 +74,7 @@ parser, which will be used to report errors found during code generation
 .. code-block:: c++
 
     static std::unique_ptr<LLVMContext> TheContext;
-    static std::unique_ptr<IRBuilder<>> Builder(TheContext);
+    static std::unique_ptr<IRBuilder<>> Builder;
     static std::unique_ptr<Module> TheModule;
     static std::map<std::string, Value *> NamedValues;
 
@@ -171,7 +171,7 @@ variables <LangImpl07.html#user-defined-local-variables>`_.
       case '<':
         L = Builder->CreateFCmpULT(L, R, "cmptmp");
         // Convert bool 0/1 to double 0.0 or 1.0
-        return Builder->CreateUIToFP(L, Type::getDoubleTy(TheContext),
+        return Builder->CreateUIToFP(L, Type::getDoubleTy(*TheContext),
                                      "booltmp");
       default:
         return LogErrorV("invalid binary operator");


        


More information about the llvm-commits mailing list