summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-11-05 19:06:59 +0000
committerChris Lattner <sabre@nondot.org>2007-11-05 19:06:59 +0000
commit128eb863dfb242aac982b505a9aab06dc35be8d1 (patch)
treeb571b5ba6cdec361738bf2dc78b0b95210ec41bd /docs
parent8699a97a2ef42d349c9b81317d55ff621c459adc (diff)
downloadllvm-128eb863dfb242aac982b505a9aab06dc35be8d1.tar.gz
llvm-128eb863dfb242aac982b505a9aab06dc35be8d1.tar.bz2
llvm-128eb863dfb242aac982b505a9aab06dc35be8d1.tar.xz
add table of contents to each chapter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43723 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs')
-rw-r--r--docs/tutorial/LangImpl1.html14
-rw-r--r--docs/tutorial/LangImpl2.html24
-rw-r--r--docs/tutorial/LangImpl3.html19
-rw-r--r--docs/tutorial/LangImpl4.html25
-rw-r--r--docs/tutorial/LangImpl5.html37
-rw-r--r--docs/tutorial/LangImpl6.html19
-rw-r--r--docs/tutorial/LangImpl7.html24
7 files changed, 135 insertions, 27 deletions
diff --git a/docs/tutorial/LangImpl1.html b/docs/tutorial/LangImpl1.html
index 6325d3c289..8d96750823 100644
--- a/docs/tutorial/LangImpl1.html
+++ b/docs/tutorial/LangImpl1.html
@@ -13,6 +13,16 @@
<div class="doc_title">Kaleidoscope: The basic language, with its lexer</div>
+<ul>
+<li>Chapter 1
+ <ol>
+ <li><a href="#intro">Tutorial Introduction</a></li>
+ <li><a href="#language">The Basic Language</a></li>
+ <li><a href="#lexer">The Lexer</a></li>
+ </ol>
+</li>
+</ul>
+
<div class="doc_author">
<p>Written by <a href="mailto:sabre@nondot.org">Chris Lattner</a></p>
</div>
@@ -32,7 +42,7 @@ can extend to other languages and to play with other things.
</div>
<!-- *********************************************************************** -->
-<div class="doc_section"><a name="language">The basic language</a></div>
+<div class="doc_section"><a name="language">The Basic Language</a></div>
<!-- *********************************************************************** -->
<div class="doc_text">
@@ -99,7 +109,7 @@ a lot of fun to play with languages!</p>
</div>
<!-- *********************************************************************** -->
-<div class="doc_section"><a name="language">The Lexer</a></div>
+<div class="doc_section"><a name="lexer">The Lexer</a></div>
<!-- *********************************************************************** -->
<div class="doc_text">
diff --git a/docs/tutorial/LangImpl2.html b/docs/tutorial/LangImpl2.html
index edf19a8b48..2339d96a91 100644
--- a/docs/tutorial/LangImpl2.html
+++ b/docs/tutorial/LangImpl2.html
@@ -13,18 +13,34 @@
<div class="doc_title">Kaleidoscope: Implementing a Parser and AST</div>
+<ul>
+<li>Chapter 2
+ <ol>
+ <li><a href="#intro">Chapter 2 Introduction</a></li>
+ <li><a href="#ast">The Abstract Syntax Tree (AST)</a></li>
+ <li><a href="#parserbasics">Parser Basics</a></li>
+ <li><a href="#parserprimexprs">Basic Expression Parsing</a></li>
+ <li><a href="#parserbinops">Binary Expression Parsing</a></li>
+ <li><a href="#parsertop">Parsing the Rest</a></li>
+ <li><a href="#driver">The Driver</a></li>
+ <li><a href="#conclusions">Conclusions</a></li>
+ <li><a href="#code">Full Code Listing</a></li>
+ </ol>
+</li>
+</ul>
+
<div class="doc_author">
<p>Written by <a href="mailto:sabre@nondot.org">Chris Lattner</a></p>
</div>
<!-- *********************************************************************** -->
-<div class="doc_section"><a name="intro">Part 2 Introduction</a></div>
+<div class="doc_section"><a name="intro">Chapter 2 Introduction</a></div>
<!-- *********************************************************************** -->
<div class="doc_text">
-<p>Welcome to part 2 of the "<a href="index.html">Implementing a language with
-LLVM</a>" tutorial. This chapter shows you how to use the <a
+<p>Welcome to Chapter 2 of the "<a href="index.html">Implementing a language
+with LLVM</a>" tutorial. This chapter shows you how to use the <a
href="LangImpl1.html">Lexer built in Chapter 1</a> to build a full <a
href="http://en.wikipedia.org/wiki/Parsing">parser</a> for
our Kaleidoscope language and build an <a
@@ -725,7 +741,7 @@ type "4+5;" and the parser will know you are done.</p>
</div>
<!-- *********************************************************************** -->
-<div class="doc_section"><a name="code">Conclusions and the Full Code</a></div>
+<div class="doc_section"><a name="conclusions">Conclusions</a></div>
<!-- *********************************************************************** -->
<div class="doc_text">
diff --git a/docs/tutorial/LangImpl3.html b/docs/tutorial/LangImpl3.html
index 59513ab3f6..2e961d2f61 100644
--- a/docs/tutorial/LangImpl3.html
+++ b/docs/tutorial/LangImpl3.html
@@ -13,18 +13,31 @@
<div class="doc_title">Kaleidoscope: Code generation to LLVM IR</div>
+<ul>
+<li>Chapter 3
+ <ol>
+ <li><a href="#intro">Chapter 3 Introduction</a></li>
+ <li><a href="#basics">Code Generation setup</a></li>
+ <li><a href="#exprs">Expression Code Generation</a></li>
+ <li><a href="#funcs">Function Code Generation</a></li>
+ <li><a href="#driver">Driver Changes and Closing Thoughts</a></li>
+ <li><a href="#code">Full Code Listing</a></li>
+ </ol>
+</li>
+</ul>
+
<div class="doc_author">
<p>Written by <a href="mailto:sabre@nondot.org">Chris Lattner</a></p>
</div>
<!-- *********************************************************************** -->
-<div class="doc_section"><a name="intro">Part 3 Introduction</a></div>
+<div class="doc_section"><a name="intro">Chapter 3 Introduction</a></div>
<!-- *********************************************************************** -->
<div class="doc_text">
-<p>Welcome to part 3 of the "<a href="index.html">Implementing a language with
-LLVM</a>" tutorial. This chapter shows you how to transform the <a
+<p>Welcome to Chapter 3 of the "<a href="index.html">Implementing a language
+with LLVM</a>" tutorial. This chapter shows you how to transform the <a
href="LangImpl2.html">Abstract Syntax Tree built in Chapter 2</a> 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
diff --git a/docs/tutorial/LangImpl4.html b/docs/tutorial/LangImpl4.html
index 6fb2c8824d..6bafacba46 100644
--- a/docs/tutorial/LangImpl4.html
+++ b/docs/tutorial/LangImpl4.html
@@ -13,21 +13,34 @@
<div class="doc_title">Kaleidoscope: Adding JIT and Optimizer Support</div>
+<ul>
+<li>Chapter 4
+ <ol>
+ <li><a href="#intro">Chapter 4 Introduction</a></li>
+ <li><a href="#trivialconstfold">Trivial Constant Folding</a></li>
+ <li><a href="#optimizerpasses">LLVM Optimization Passes</a></li>
+ <li><a href="#jit">Adding a JIT Compiler</a></li>
+ <li><a href="#code">Full Code Listing</a></li>
+ </ol>
+</li>
+</ul>
+
<div class="doc_author">
<p>Written by <a href="mailto:sabre@nondot.org">Chris Lattner</a></p>
</div>
<!-- *********************************************************************** -->
-<div class="doc_section"><a name="intro">Part 4 Introduction</a></div>
+<div class="doc_section"><a name="intro">Chapter 4 Introduction</a></div>
<!-- *********************************************************************** -->
<div class="doc_text">
-<p>Welcome to part 4 of the "<a href="index.html">Implementing a language with
-LLVM</a>" tutorial. Parts 1-3 described the implementation of a simple language
-and included support for generating LLVM IR. This chapter describes two new
-techniques: adding optimizer support to your language, and adding JIT compiler
-support. This shows how to get nice efficient code for your language.</p>
+<p>Welcome to Chapter 4 of the "<a href="index.html">Implementing a language
+with LLVM</a>" tutorial. Parts 1-3 described the implementation of a simple
+language and included support for generating LLVM IR. This chapter describes
+two new techniques: adding optimizer support to your language, and adding JIT
+compiler support. This shows how to get nice efficient code for your
+language.</p>
</div>
diff --git a/docs/tutorial/LangImpl5.html b/docs/tutorial/LangImpl5.html
index 09477faba6..a579758014 100644
--- a/docs/tutorial/LangImpl5.html
+++ b/docs/tutorial/LangImpl5.html
@@ -13,18 +13,45 @@
<div class="doc_title">Kaleidoscope: Extending the Language: Control Flow</div>
+<ul>
+<li>Chapter 5
+ <ol>
+ <li><a href="#intro">Chapter 5 Introduction</a></li>
+ <li><a href="#ifthen">If/Then/Else</a>
+ <ol>
+ <li><a href="#iflexer">Lexer Extensions</a></li>
+ <li><a href="#ifast">AST Extensions</a></li>
+ <li><a href="#ifparser">Parser Extensions</a></li>
+ <li><a href="#ifir">LLVM IR</a></li>
+ <li><a href="#ifcodegen">Code Generation</a></li>
+ </ol>
+ </li>
+ <li><a href="#for">'for' Loop Expression</a>
+ <ol>
+ <li><a href="#forlexer">Lexer Extensions</a></li>
+ <li><a href="#forast">AST Extensions</a></li>
+ <li><a href="#forparser">Parser Extensions</a></li>
+ <li><a href="#forir">LLVM IR</a></li>
+ <li><a href="#forcodegen">Code Generation</a></li>
+ </ol>
+ </li>
+ <li><a href="#code">Full Code Listing</a></li>
+ </ol>
+</li>
+</ul>
+
<div class="doc_author">
<p>Written by <a href="mailto:sabre@nondot.org">Chris Lattner</a></p>
</div>
<!-- *********************************************************************** -->
-<div class="doc_section"><a name="intro">Part 5 Introduction</a></div>
+<div class="doc_section"><a name="intro">Chapter 5 Introduction</a></div>
<!-- *********************************************************************** -->
<div class="doc_text">
-<p>Welcome to Part 5 of the "<a href="index.html">Implementing a language with
-LLVM</a>" tutorial. Parts 1-4 described the implementation of the simple
+<p>Welcome to Chapter 5 of the "<a href="index.html">Implementing a language
+with LLVM</a>" tutorial. Parts 1-4 described the implementation of the simple
Kaleidoscope language and included support for generating LLVM IR, following by
optimizations and a JIT compiler. Unfortunately, as presented, Kaleidoscope is
mostly useless: it has no control flow other than call and return. This means
@@ -116,7 +143,7 @@ stuff:</p>
<!-- ======================================================================= -->
<div class="doc_subsubsection"><a name="ifast">AST Extensions for
- If/Then/Else </a></div>
+ If/Then/Else</a></div>
<!-- ======================================================================= -->
<div class="doc_text">
@@ -142,7 +169,7 @@ public:
<!-- ======================================================================= -->
<div class="doc_subsubsection"><a name="ifparser">Parser Extensions for
-If/Then/Else </a></div>
+If/Then/Else</a></div>
<!-- ======================================================================= -->
<div class="doc_text">
diff --git a/docs/tutorial/LangImpl6.html b/docs/tutorial/LangImpl6.html
index 5a184c2c18..978ba8e1cd 100644
--- a/docs/tutorial/LangImpl6.html
+++ b/docs/tutorial/LangImpl6.html
@@ -13,18 +13,31 @@
<div class="doc_title">Kaleidoscope: Extending the Language: User-defined Operators</div>
+<ul>
+<li>Chapter 6
+ <ol>
+ <li><a href="#intro">Chapter 6 Introduction</a></li>
+ <li><a href="#idea">User-defined Operators: the Idea</a></li>
+ <li><a href="#binary">User-defined Binary Operators</a></li>
+ <li><a href="#unary">User-defined Unary Operators</a></li>
+ <li><a href="#example">Kicking the Tires</a></li>
+ <li><a href="#code">Full Code Listing</a></li>
+ </ol>
+</li>
+</ul>
+
<div class="doc_author">
<p>Written by <a href="mailto:sabre@nondot.org">Chris Lattner</a></p>
</div>
<!-- *********************************************************************** -->
-<div class="doc_section"><a name="intro">Part 6 Introduction</a></div>
+<div class="doc_section"><a name="intro">Chapter 6 Introduction</a></div>
<!-- *********************************************************************** -->
<div class="doc_text">
-<p>Welcome to Part 6 of the "<a href="index.html">Implementing a language with
-LLVM</a>" tutorial. At this point in our tutorial, we now have a fully
+<p>Welcome to Chapter 6 of the "<a href="index.html">Implementing a language
+with LLVM</a>" tutorial. At this point in our tutorial, we now have a fully
functional language that is fairly minimal, but also useful. One big problem
with it though is that it doesn't have many useful operators (like division,
logical negation, or even any comparisons other than less-than.</p>
diff --git a/docs/tutorial/LangImpl7.html b/docs/tutorial/LangImpl7.html
index 07dd5c620f..bea97e51da 100644
--- a/docs/tutorial/LangImpl7.html
+++ b/docs/tutorial/LangImpl7.html
@@ -14,19 +14,35 @@
<div class="doc_title">Kaleidoscope: Extending the Language: Mutable Variables</div>
+<ul>
+<li>Chapter 7
+ <ol>
+ <li><a href="#intro">Chapter 7 Introduction</a></li>
+ <li><a href="#why">Why is this a hard problem?</a></li>
+ <li><a href="#memory">Memory in LLVM</a></li>
+ <li><a href="#kalvars">Mutable Variables in Kaleidoscope</a></li>
+ <li><a href="#adjustments">Adjusting Existing Variables for
+ Mutation</a></li>
+ <li><a href="#assignment">New Assignment Operator</a></li>
+ <li><a href="#localvars">User-defined Local Variables</a></li>
+ <li><a href="#code">Full Code Listing</a></li>
+ </ol>
+</li>
+</ul>
+
<div class="doc_author">
<p>Written by <a href="mailto:sabre@nondot.org">Chris Lattner</a></p>
</div>
<!-- *********************************************************************** -->
-<div class="doc_section"><a name="intro">Part 7 Introduction</a></div>
+<div class="doc_section"><a name="intro">Chapter 7 Introduction</a></div>
<!-- *********************************************************************** -->
<div class="doc_text">
-<p>Welcome to Part 7 of the "<a href="index.html">Implementing a language with
-LLVM</a>" tutorial. In parts 1 through 6, we've built a very respectable,
-albeit simple, <a
+<p>Welcome to Chapter 7 of the "<a href="index.html">Implementing a language
+with LLVM</a>" tutorial. In chapters 1 through 6, we've built a very
+respectable, albeit simple, <a
href="http://en.wikipedia.org/wiki/Functional_programming">functional
programming language</a>. In our journey, we learned some parsing techniques,
how to build and represent an AST, how to build LLVM IR, and how to optimize