internal override BoundExpression GetValue(BoundPseudoVariable variable, DiagnosticBag diagnostics) { var method = GetIntrinsicMethod(_compilation, ExpressionCompilerConstants.GetVariableValueMethodName); var local = variable.LocalSymbol; var expr = InvokeGetMethod(method, variable.Syntax, local.Name); return ConvertToLocalType(_compilation, expr, local.Type, diagnostics); }
internal override BoundExpression GetAddress(BoundPseudoVariable variable) { var method = GetIntrinsicMethod(_compilation, ExpressionCompilerConstants.GetVariableAddressMethodName); // Currently the MetadataDecoder does not support byref return types // so the return type of GetVariableAddress(Of T)(name As String) // is an error type. Since the method is only used for emit, an // updated placeholder method is used instead. Debug.Assert(method.ReturnType.TypeKind == TypeKind.Error); // If byref return types are supported in the future, use method as is. method = new PlaceholderMethodSymbol( method.ContainingType, method.Name, m => method.TypeParameters.SelectAsArray(t => (TypeParameterSymbol)new SimpleTypeParameterSymbol(m, t.Ordinal, t.Name)), m => m.TypeParameters[0], // return type is <>T& m => method.Parameters.SelectAsArray(p => (ParameterSymbol)new SynthesizedParameterSymbol(m, p.Type, p.Ordinal, p.RefKind, p.Name, p.CustomModifiers, p.CountOfCustomModifiersPrecedingByRef))); var local = variable.LocalSymbol; return InvokeGetMethod(method.Construct(local.Type), variable.Syntax, local.Name); }
private void EmitPseudoVariableValue(BoundPseudoVariable expression, bool used) { EmitExpression(expression.EmitExpressions.GetValue(expression, _diagnostics), used); }
private void EmitPseudoVariableAddress(BoundPseudoVariable expression) { EmitExpression(expression.EmitExpressions.GetAddress(expression), used: true); }
internal abstract BoundExpression GetValue(BoundPseudoVariable variable, DiagnosticBag diagnostics);
internal abstract BoundExpression GetAddress(BoundPseudoVariable variable);
internal override BoundExpression GetValue(BoundPseudoVariable variable) { var local = variable.LocalSymbol; var expr = InvokeGetMethod(_getValueMethod, variable.Syntax, local.Name); return ConvertToLocalType(_compilation, expr, local.Type); }
internal override BoundExpression GetAddress(BoundPseudoVariable variable) { var local = variable.LocalSymbol; return InvokeGetMethod(_getAddressMethod.Construct(local.Type), variable.Syntax, local.Name); }
public override BoundNode VisitPseudoVariable(BoundPseudoVariable node) { CheckDeclared(node.LocalSymbol); base.VisitPseudoVariable(node); return(null); }
internal override BoundExpression GetAddress(BoundPseudoVariable variable) { var local = variable.LocalSymbol; return(InvokeGetMethod(_getAddressMethod.Construct(local.Type), variable.Syntax, local.Name)); }
internal abstract BoundExpression GetValue(BoundPseudoVariable variable);