Home | History | Annotate | Download | only in tutorial

Lines Matching full:variable

51 In this case, we have the variable "X", whose value depends on the path
109 variable (which lives in memory, because it is on the stack) for each
116 "i32\*" even though the variable is defined as "i32". What this means is
120 variable definitions, they are declared with the `LLVM alloca
135 variable in the LLVM IR. Stack memory allocated with the alloca
169 #. Each mutable variable becomes a stack allocation.
170 #. Each read of the variable becomes a load from the stack.
171 #. Each update of the variable becomes a store to the stack.
172 #. Taking the address of a variable just uses the stack address
251 the variable exposed so that debug info can be attached to it. This
301 operator, then extend Kaleidoscope to support new variable definitions.
308 "Value\*" that holds the double value for the named variable. In order
310 ``NamedValues`` holds the *memory location* of the variable in question.
317 variable of 'for' loops. For consistency, we'll allow mutation of these
352 variable references. In our new scheme, variables live on the stack, so
359 // Look this variable up in the function.
361 if (V == 0) return ErrorV("Unknown variable name");
376 // Create an alloca for the variable in the entry block.
379 // Emit the start code first, without 'variable' in scope.
392 // the body of the loop mutates the variable.
401 the variable as needed.
413 // Create an alloca for this variable.
419 // Add arguments to variable symbol table.
478 Here there is only one variable (x, the input argument) but you can
481 value is stored into it. Each reference to the variable does a reload
515 the variable. The point of showing this is to calm your tension about
578 return ErrorV("destination of '=' must be a variable");
583 The other strange thing is that it requires the LHS to be a variable. It
594 Value *Variable = NamedValues[LHSE->getName()];
595 if (Variable == 0) return ErrorV("Unknown variable name");
597 Builder.CreateStore(Val, Variable);
602 Once we have the variable, codegen'ing the assignment is
716 // At least one variable name is required.
780 time. For each variable we put into the symbol table, we remember the
785 // Emit the initializer before adding the variable to scope, this prevents
786 // the initializer from referencing the variable itself, and permits stuff
801 // Remember the old variable binding so that we can restore the binding when
820 Finally, before returning, we restore the previous variable bindings:
832 The end result of all of this is that we get properly scoped variable