mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-31 15:53:42 +00:00
[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 '<LangImpl[0-9].html>' ./docs/tutorial/ git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307525 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9086ed9db0
commit
d6a9e4a5f3
@ -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 <LangImpl1.html>`_ tutorials and then
|
||||
`Implementing a language with LLVM <LangImpl01.html>`_ 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 <LangImpl7.html>`_ of the "Implementing a language in LLVM tutorial",
|
||||
`Chapter 7 <LangImpl07.html>`_ 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 <LangImpl1.html>`_ tutorials. We will use
|
||||
the REPL code from `Chapter 7 <LangImpl7.html>`_ of that tutorial to supply the
|
||||
`Implementing a language with LLVM <LangImpl01.html>`_ tutorials. We will use
|
||||
the REPL code from `Chapter 7 <LangImpl07.html>`_ 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
|
||||
|
@ -25,7 +25,7 @@ IRTransformLayer, to add IR optimization support to KaleidoscopeJIT.
|
||||
Optimizing Modules using the IRTransformLayer
|
||||
=============================================
|
||||
|
||||
In `Chapter 4 <LangImpl4.html>`_ of the "Implementing a language with LLVM"
|
||||
In `Chapter 4 <LangImpl04.html>`_ 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 <LangImpl4.html>`_ of the "Implementing a language with LLVM"
|
||||
`Chapter 4 <LangImpl04.html>`_ 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.
|
||||
|
||||
|
@ -10,7 +10,7 @@ Chapter 2 Introduction
|
||||
|
||||
Welcome to Chapter 2 of the "`Implementing a language with
|
||||
LLVM <index.html>`_" tutorial. This chapter shows you how to use the
|
||||
lexer, built in `Chapter 1 <LangImpl1.html>`_, to build a full
|
||||
lexer, built in `Chapter 1 <LangImpl01.html>`_, to build a full
|
||||
`parser <http://en.wikipedia.org/wiki/Parsing>`_ for our Kaleidoscope
|
||||
language. Once we have a parser, we'll define and build an `Abstract
|
||||
Syntax Tree <http://en.wikipedia.org/wiki/Abstract_syntax_tree>`_ (AST).
|
||||
|
@ -10,7 +10,7 @@ Chapter 3 Introduction
|
||||
|
||||
Welcome to Chapter 3 of the "`Implementing a language with
|
||||
LLVM <index.html>`_" tutorial. This chapter shows you how to transform
|
||||
the `Abstract Syntax Tree <LangImpl2.html>`_, built in Chapter 2, into
|
||||
the `Abstract Syntax Tree <LangImpl02.html>`_, 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 <http://en.wikipedia.org/wiki/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 <LangImpl5.html>`_ :).
|
||||
at this point. We'll fix this in `Chapter 5 <LangImpl05.html>`_ :).
|
||||
|
||||
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 <LangImpl4.html>`_ to this so we can actually start running
|
||||
support <LangImpl04.html>`_ to this so we can actually start running
|
||||
code!
|
||||
|
||||
Full Code Listing
|
||||
|
@ -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 <LangImpl5.html>`_, tackling some interesting LLVM IR issues
|
||||
constructs <LangImpl05.html>`_, tackling some interesting LLVM IR issues
|
||||
along the way.
|
||||
|
||||
Full Code Listing
|
||||
|
@ -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 <LangImpl7.html>`_ of this tutorial ("mutable variables"),
|
||||
In `Chapter 7 <LangImpl07.html>`_ 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 <LangImpl6.html>`_ to our poor innocent language.
|
||||
operators <LangImpl06.html>`_ to our poor innocent language.
|
||||
|
||||
Full Code Listing
|
||||
=================
|
||||
|
@ -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 <LangImpl2.html>`_ for details. By
|
||||
expressions. See `Chapter 2 <LangImpl02.html>`_ 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 <LangImpl7.html>`_ without having to add an "SSA construction"
|
||||
variables <LangImpl07.html>`_ 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.
|
||||
|
||||
|
@ -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 <LangImpl5.html>`_, we have to build our
|
||||
As opposed to the `C++ tutorial <LangImpl05.html>`_, 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
|
||||
|
Loading…
x
Reference in New Issue
Block a user