[all-commits] [llvm/llvm-project] 162553: [Kaleidoscope] Update code snippets in text to mat...

Dhruv Chawla via All-commits all-commits at lists.llvm.org
Tue Jan 31 10:01:33 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1625530d765557378e3e34f54f02883a402ff472
      https://github.com/llvm/llvm-project/commit/1625530d765557378e3e34f54f02883a402ff472
  Author: Dhruv Chawla <dhruv263.dc at gmail.com>
  Date:   2023-01-31 (Tue, 31 Jan 2023)

  Changed paths:
    M llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl02.rst
    M llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl03.rst
    M llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl04.rst
    M llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl05.rst
    M llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl06.rst
    M llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl07.rst
    M llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl08.rst
    M llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl09.rst
    M llvm/examples/Kaleidoscope/Chapter9/toy.cpp

  Log Message:
  -----------
  [Kaleidoscope] Update code snippets in text to match full code listings

There were quite a few places in the tutorial where the snippets were not up to date with the full code listings given. I have updated all of the ones I could find, which mostly involves changing `.` to `->` when accessing through a `std::unique_ptr`, changing `while (1)` to `while (true)`, and other such small changes.

There are still however a few places where I am not sure what to do, such as:
- Chapter 4: `ParseTopLevelExpr()` in chapter 3 sets the ProtoTypeAST
             name to "", however it is referred to as "__anon_expr"
             in chapter 4. Would it be required to mention this change
             in chapter 4?
- Chapter 9: The code snippets refer to the top level expression as
             "main", however the full code listing refers to it as
             "__anon_expr". I think given the context of the chapter
             it makes sense to refer to it as "main", so I have
             updated the code listing to reflect that.
- Chapter 9: In chapter 9 the diff given for `HandleTopLevelExpression()`
             deletes code that is not mentioned anywhere else, so I am
             not sure what is to be done there.
- Miscellaneous: I don't think this is very important, however the
                 casing used for the first word of error messages
                 tends to vary between upper and lower case between
                 chapters and I do not know if it is worth reconciling
                 these differences.

Reviewed By: xgupta

Differential Revision: https://reviews.llvm.org/D142323




More information about the All-commits mailing list