In the 5th part of Kaleidoscope C++ tutorial, codegen part (5.2.5), the newly created basic blocks are not inserted right away in the parent function of the insertion point.
Inserting them right away makes it look similar to the loop construction, and, in my opinion, avoids confusion.
- docs/tutorial/LangImpl5.rst: Update the tutorial.
- examples/Kaleidoscope/Chapter5/toy.cpp,
- examples/Kaleidoscope/Chapter6/toy.cpp,
- examples/Kaleidoscope/Chapter7/toy.cpp,
- examples/Kaleidoscope/Chapter8/toy.cpp: Propagate changes to next chapters.