Home | History | Annotate | Download | only in tutorial

Lines Matching full:variable

97 <p>In this case, we have the variable "X", whose value depends on the path
162 With this in mind, the high-level idea is that we want to make a stack variable
171 variable is defined as "i32". What this means is that @G defines <em>space</em>
174 being declared with global variable definitions, they are declared with the
191 variable in the LLVM IR. Stack memory allocated with the alloca instruction is
227 <li>Each mutable variable becomes a stack allocation.</li>
228 <li>Each read of the variable becomes a load from the stack.</li>
229 <li>Each update of the variable becomes a store to the stack.</li>
230 <li>Taking the address of a variable just uses the stack address directly.</li>
315 Debug information in LLVM</a> relies on having the address of the variable
378 Kaleidoscope to support new variable definitions.
392 "Value*" that holds the double value for the named variable. In order to
394 <tt>named_values</tt> holds the <em>memory location</em> of the variable in
401 things: incoming arguments to functions and the induction variable of 'for'
442 variable references. In our new scheme, variables live on the stack, so code
450 | Ast.Variable name -&gt;
452 | Not_found -&gt; raise (Error "unknown variable name")
469 (* Create an alloca for the variable in the entry block. *)
472 (* Emit the start code first, without 'variable' in scope. *)
480 (* Within the loop, the variable is defined equal to the PHI node. If it
481 * shadows an existing variable, we have to restore it, so save it
494 * the body of the loop mutates the variable. *)
505 load/store to access the variable as needed.</p>
520 (* Create an alloca for this variable. *)
526 (* Add arguments to variable symbol table. *)
597 <p>Here there is only one variable (x, the input argument) but you can still
600 it. Each reference to the variable does a reload from the stack. Also, note
635 variable. The point of showing this is to calm your tension about inserting
709 | Ast.Variable name -&gt; name
710 | _ -&gt; raise (Error "destination of '=' must be a variable")
718 strange thing is that it requires the LHS to be a variable. It is invalid to
729 let variable = try Hashtbl.find named_values name with
730 | Not_found -&gt; raise (Error "unknown variable name")
732 ignore(build_store val_ variable builder);
739 <p>Once we have the variable, codegen'ing the assignment is straightforward:
839 (* At least one variable name is required. *)
882 For each variable we put into the symbol table, we remember the previous value
887 (* Emit the initializer before adding the variable to scope, this
888 * prevents the initializer from referencing the variable itself, and
902 (* Remember the old variable binding so that we can restore the binding
930 <p>Finally, before returning, we restore the previous variable bindings:</p>
944 <p>The end result of all of this is that we get properly scoped variable
1113 (* variant for referencing a variable, like "a". *)
1114 | Variable of string
1193 (* Simple variable ref. *)
1194 | [&lt; &gt;] -&gt; Ast.Variable id
1236 (* At least one variable name is required. *)
1398 | Ast.Variable name -&gt;
1400 | Not_found -&gt; raise (Error "unknown variable name")
1420 | Ast.Variable name -&gt; name
1421 | _ -&gt; raise (Error "destination of '=' must be a variable")
1428 let variable = try Hashtbl.find named_values name with
1429 | Not_found -&gt; raise (Error "unknown variable name")
1431 ignore(build_store val_ variable builder);
1545 (* Create an alloca for the variable in the entry block. *)
1548 (* Emit the start code first, without 'variable' in scope. *)
1565 (* Within the loop, the variable is defined equal to the PHI node. If it
1566 * shadows an existing variable, we have to restore it, so save it
1590 * the body of the loop mutates the variable. *)
1608 (* Restore the unshadowed variable. *)
1623 (* Emit the initializer before adding the variable to scope, this
1624 * prevents the initializer from referencing the variable itself, and
1638 (* Remember the old variable binding so that we can restore the binding
1700 (* Create an alloca for this variable. *)
1706 (* Add arguments to variable symbol table. *)