From: Kirill Bobyrev Date: Mon, 10 Jul 2017 09:07:23 +0000 (+0000) Subject: [docs] NFC: Fix links in the tutorial X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e436483855b99d3a4577fbfb60c38f29d0574ca6;p=platform%2Fupstream%2Fllvm.git [docs] NFC: Fix links in the tutorial r274441 introduced Chapter 10 of "Implementing a Language with LLVM" tutorial, which caused all files in the tutorial to start using two digit numbering. But many links were not changed and therefore appear to be broken. This patch addresses described issue. As a result, following command does not produce any output anymore: $ grep -nR '' ./docs/tutorial/ llvm-svn: 307525 --- diff --git a/llvm/docs/tutorial/BuildingAJIT1.rst b/llvm/docs/tutorial/BuildingAJIT1.rst index 625cbbb..88f7aa5 100644 --- a/llvm/docs/tutorial/BuildingAJIT1.rst +++ b/llvm/docs/tutorial/BuildingAJIT1.rst @@ -12,7 +12,7 @@ Welcome to Chapter 1 of the "Building an ORC-based JIT in LLVM" tutorial. This tutorial runs through the implementation of a JIT compiler using LLVM's On-Request-Compilation (ORC) APIs. It begins with a simplified version of the KaleidoscopeJIT class used in the -`Implementing a language with LLVM `_ tutorials and then +`Implementing a language with LLVM `_ tutorials and then introduces new features like optimization, lazy compilation and remote execution. @@ -41,7 +41,7 @@ The structure of the tutorial is: a remote process with reduced privileges using the JIT Remote APIs. To provide input for our JIT we will use the Kaleidoscope REPL from -`Chapter 7 `_ of the "Implementing a language in LLVM tutorial", +`Chapter 7 `_ of the "Implementing a language in LLVM tutorial", with one minor modification: We will remove the FunctionPassManager from the code for that chapter and replace it with optimization support in our JIT class in Chapter #2. @@ -91,8 +91,8 @@ KaleidoscopeJIT In the previous section we described our API, now we examine a simple implementation of it: The KaleidoscopeJIT class [1]_ that was used in the -`Implementing a language with LLVM `_ tutorials. We will use -the REPL code from `Chapter 7 `_ of that tutorial to supply the +`Implementing a language with LLVM `_ tutorials. We will use +the REPL code from `Chapter 7 `_ of that tutorial to supply the input for our JIT: Each time the user enters an expression the REPL will add a new IR module containing the code for that expression to the JIT. If the expression is a top-level expression like '1+1' or 'sin(x)', the REPL will also diff --git a/llvm/docs/tutorial/BuildingAJIT2.rst b/llvm/docs/tutorial/BuildingAJIT2.rst index 8398752..2f22bda 100644 --- a/llvm/docs/tutorial/BuildingAJIT2.rst +++ b/llvm/docs/tutorial/BuildingAJIT2.rst @@ -25,7 +25,7 @@ IRTransformLayer, to add IR optimization support to KaleidoscopeJIT. Optimizing Modules using the IRTransformLayer ============================================= -In `Chapter 4 `_ of the "Implementing a language with LLVM" +In `Chapter 4 `_ of the "Implementing a language with LLVM" tutorial series the llvm *FunctionPassManager* is introduced as a means for optimizing LLVM IR. Interested readers may read that chapter for details, but in short: to optimize a Module we create an llvm::FunctionPassManager @@ -148,7 +148,7 @@ At the bottom of our JIT we add a private method to do the actual optimization: *optimizeModule*. This function sets up a FunctionPassManager, adds some passes to it, runs it over every function in the module, and then returns the mutated module. The specific optimizations are the same ones used in -`Chapter 4 `_ of the "Implementing a language with LLVM" +`Chapter 4 `_ of the "Implementing a language with LLVM" tutorial series. Readers may visit that chapter for a more in-depth discussion of these, and of IR optimization in general. diff --git a/llvm/docs/tutorial/LangImpl02.rst b/llvm/docs/tutorial/LangImpl02.rst index 4be447e..d72c8dc 100644 --- a/llvm/docs/tutorial/LangImpl02.rst +++ b/llvm/docs/tutorial/LangImpl02.rst @@ -10,7 +10,7 @@ Chapter 2 Introduction Welcome to Chapter 2 of the "`Implementing a language with LLVM `_" tutorial. This chapter shows you how to use the -lexer, built in `Chapter 1 `_, to build a full +lexer, built in `Chapter 1 `_, to build a full `parser `_ for our Kaleidoscope language. Once we have a parser, we'll define and build an `Abstract Syntax Tree `_ (AST). diff --git a/llvm/docs/tutorial/LangImpl03.rst b/llvm/docs/tutorial/LangImpl03.rst index 1dfe101..fab2dda 100644 --- a/llvm/docs/tutorial/LangImpl03.rst +++ b/llvm/docs/tutorial/LangImpl03.rst @@ -10,7 +10,7 @@ Chapter 3 Introduction Welcome to Chapter 3 of the "`Implementing a language with LLVM `_" tutorial. This chapter shows you how to transform -the `Abstract Syntax Tree `_, built in Chapter 2, into +the `Abstract Syntax Tree `_, built in Chapter 2, into LLVM IR. This will teach you a little bit about how LLVM does things, as well as demonstrate how easy it is to use. It's much more work to build a lexer and parser than it is to generate LLVM IR code. :) @@ -362,7 +362,7 @@ end of the new basic block. Basic blocks in LLVM are an important part of functions that define the `Control Flow Graph `_. Since we don't have any control flow, our functions will only contain one block -at this point. We'll fix this in `Chapter 5 `_ :). +at this point. We'll fix this in `Chapter 5 `_ :). Next we add the function arguments to the NamedValues map (after first clearing it out) so that they're accessible to ``VariableExprAST`` nodes. @@ -540,7 +540,7 @@ functions referencing each other. This wraps up the third chapter of the Kaleidoscope tutorial. Up next, we'll describe how to `add JIT codegen and optimizer -support `_ to this so we can actually start running +support `_ to this so we can actually start running code! Full Code Listing diff --git a/llvm/docs/tutorial/LangImpl04.rst b/llvm/docs/tutorial/LangImpl04.rst index 16d7164..921c4dc 100644 --- a/llvm/docs/tutorial/LangImpl04.rst +++ b/llvm/docs/tutorial/LangImpl04.rst @@ -622,7 +622,7 @@ This completes the JIT and optimizer chapter of the Kaleidoscope tutorial. At this point, we can compile a non-Turing-complete programming language, optimize and JIT compile it in a user-driven way. Next up we'll look into `extending the language with control flow -constructs `_, tackling some interesting LLVM IR issues +constructs `_, tackling some interesting LLVM IR issues along the way. Full Code Listing diff --git a/llvm/docs/tutorial/LangImpl05.rst b/llvm/docs/tutorial/LangImpl05.rst index dcf45bc..8650892 100644 --- a/llvm/docs/tutorial/LangImpl05.rst +++ b/llvm/docs/tutorial/LangImpl05.rst @@ -269,7 +269,7 @@ Phi nodes: #. Values that are implicit in the structure of your AST, such as the Phi node in this case. -In `Chapter 7 `_ of this tutorial ("mutable variables"), +In `Chapter 7 `_ of this tutorial ("mutable variables"), we'll talk about #1 in depth. For now, just believe me that you don't need SSA construction to handle this case. For #2, you have the choice of using the techniques that we will describe for #1, or you can insert @@ -790,7 +790,7 @@ of the tutorial. In this chapter we added two control flow constructs, and used them to motivate a couple of aspects of the LLVM IR that are important for front-end implementors to know. In the next chapter of our saga, we will get a bit crazier and add `user-defined -operators `_ to our poor innocent language. +operators `_ to our poor innocent language. Full Code Listing ================= diff --git a/llvm/docs/tutorial/LangImpl06.rst b/llvm/docs/tutorial/LangImpl06.rst index c1035bc..cb8ec76 100644 --- a/llvm/docs/tutorial/LangImpl06.rst +++ b/llvm/docs/tutorial/LangImpl06.rst @@ -41,7 +41,7 @@ The point of going into user-defined operators in a tutorial like this is to show the power and flexibility of using a hand-written parser. Thus far, the parser we have been implementing uses recursive descent for most parts of the grammar and operator precedence parsing for the -expressions. See `Chapter 2 `_ for details. By +expressions. See `Chapter 2 `_ for details. By using operator precedence parsing, it is very easy to allow the programmer to introduce new operators into the grammar: the grammar is dynamically extensible as the JIT runs. @@ -734,7 +734,7 @@ side-effects, but it can't actually define and mutate a variable itself. Strikingly, variable mutation is an important feature of some languages, and it is not at all obvious how to `add support for mutable -variables `_ without having to add an "SSA construction" +variables `_ without having to add an "SSA construction" phase to your front-end. In the next chapter, we will describe how you can add variable mutation without building SSA in your front-end. diff --git a/llvm/docs/tutorial/OCamlLangImpl5.rst b/llvm/docs/tutorial/OCamlLangImpl5.rst index 6e17de4..d06bf6e 100644 --- a/llvm/docs/tutorial/OCamlLangImpl5.rst +++ b/llvm/docs/tutorial/OCamlLangImpl5.rst @@ -258,7 +258,7 @@ a truth value as a 1-bit (bool) value. let then_bb = append_block context "then" the_function in position_at_end then_bb builder; -As opposed to the `C++ tutorial `_, we have to build our +As opposed to the `C++ tutorial `_, we have to build our basic blocks bottom up since we can't have dangling BasicBlocks. We start off by saving a pointer to the first block (which might not be the entry block), which we'll need to build a conditional branch later. We