diff --git a/docs/tutorial/LangImpl7.html b/docs/tutorial/LangImpl7.html index 9aa65d3b6e1..523d24fcde1 100644 --- a/docs/tutorial/LangImpl7.html +++ b/docs/tutorial/LangImpl7.html @@ -172,7 +172,7 @@ declared with global variable definitions, they are declared with the
-define i32 @test(i1 %Condition) {
+define i32 @example() {
 entry:
 	%X = alloca i32           ; type of %X is i32*.
 	...
@@ -261,7 +261,7 @@ cond_next:
 
 

The mem2reg pass implements the standard "iterated dominator frontier" algorithm for constructing SSA form and has a number of optimizations that speed -up very common degenerate cases. mem2reg really is the answer for dealing with +up (very common) degenerate cases. mem2reg is the answer for dealing with mutable variables, and we highly recommend that you depend on it. Note that mem2reg only works on variables in certain circumstances:

@@ -337,7 +337,7 @@ add two features:

While the first item is really what this is about, we only have variables -for incoming arguments and for induction variables, and redefining them only +for incoming arguments and for induction variables, and redefining those only goes so far :). Also, the ability to define new variables is a useful thing regardless of whether you will be mutating them. Here's a motivating example that shows how we could use these:

@@ -358,7 +358,7 @@ def fib(x) # Iterative fib. def fibi(x) var a = 1, b = 1, c in - (for i = 3, i &;t; x in + (for i = 3, i < x in c = a + b : a = b : b = c) : @@ -446,8 +446,8 @@ Value *VariableExprAST::Codegen() { Value *V = NamedValues[Name]; if (V == 0) return ErrorV("Unknown variable name"); - // Load the value. - return Builder.CreateLoad(V, Name.c_str()); + // Load the value. + return Builder.CreateLoad(V, Name.c_str()); }
@@ -688,7 +688,8 @@ Value *BinaryExprAST::Codegen() {

Unlike the rest of the binary operators, our assignment operator doesn't follow the "emit LHS, emit RHS, do computation" model. As such, it is handled as a special case before the other binary operators are handled. The other -strange thing about it is that it requires the LHS to be a variable directly. +strange thing is that it requires the LHS to be a variable. It is invalid to +have "(x+1) = expr" - only things like "x = expr" are allowed.

@@ -775,7 +776,7 @@ static int gettok() {

The next step is to define the AST node that we will construct. For var/in, -it will look like this:

+it looks like this:

@@ -796,7 +797,7 @@ public:
 

var/in allows a list of names to be defined all at once, and each name can optionally have an initializer value. As such, we capture this information in the VarNames vector. Also, var/in has a body, this body is allowed to access -the variables defined by the let/in.

+the variables defined by the var/in.

With this ready, we can define the parser pieces. First thing we do is add it as a primary expression: