Exemplo n.º 1
0
        /// <summary>
        /// Stores a value to the argument with index idx.
        /// </summary>
        /// <param name="var">The variable reference.</param>
        private void StoreVariable(VariableRef var)
        {
            Debug.Assert(var.RefType == VariableRefType.Argument || var.RefType == VariableRefType.Local);
            var variableType = variableTypes[var];
            var value        = CurrentBlock.Pop(variableType);

            if (variables.TryGetValue(var, out Value nonSSAValue))
            {
                BuildStore(Builder, value.LLVMValue, nonSSAValue.LLVMValue);
            }
            else
            {
                CurrentBlock.SetValue(var, value);
            }
        }