public VariableScope(LocalVariable variable, int start, VariableScope parent) { Variable = variable; Start = start; Parent = parent; }
internal LocalVariable AddClosureVariable(ParameterExpression variable) { if (_closureVariables == null) { _closureVariables = new Dictionary<ParameterExpression, LocalVariable>(); } LocalVariable result = new LocalVariable(_closureVariables.Count, true, false); _closureVariables.Add(variable, result); return result; }
public bool TryGetLocalOrClosure(ParameterExpression var, out LocalVariable local) { VariableScope scope; if (_variables.TryGetValue(var, out scope)) { local = scope.Variable; return true; } if (_closureVariables != null && _closureVariables.TryGetValue(var, out local)) { return true; } local = null; return false; }
public LocalDefinition DefineLocal(ParameterExpression variable, int start) { LocalVariable result = new LocalVariable(_localCount++, false, false); _maxLocalCount = System.Math.Max(_localCount, _maxLocalCount); VariableScope existing, newScope; if (_variables.TryGetValue(variable, out existing)) { newScope = new VariableScope(result, start, existing); if (existing.ChildScopes == null) { existing.ChildScopes = new List<VariableScope>(); } existing.ChildScopes.Add(newScope); } else { newScope = new VariableScope(result, start, null); } _variables[variable] = newScope; return new LocalDefinition(result.Index, variable); }
public VariableScope(LocalVariable variable, int start, VariableScope?parent) { Variable = variable; Start = start; Parent = parent; }
public ParameterByRefUpdater(LocalVariable parameter, int argumentIndex) : base(argumentIndex) { _parameter = parameter; }