Example #1
0
 /// <summary>
 /// Loads a variable. This can be an argument or a local reference.
 /// </summary>
 /// <param name="var">The variable reference.</param>
 private void LoadVariable(VariableRef var)
 {
     Debug.Assert(var.RefType == VariableRefType.Argument || var.RefType == VariableRefType.Local);
     if (variables.TryGetValue(var, out Value nonSSAValue))
     {
         var load = BuildLoad(Builder, nonSSAValue.LLVMValue, string.Empty);
         CurrentBlock.Push(nonSSAValue.ValueType, load);
     }
     else
     {
         CurrentBlock.Push(CurrentBlock.GetValue(var));
     }
 }