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);
 }
Пример #3
0
 private void EmitPseudoVariableValue(BoundPseudoVariable expression, bool used)
 {
     EmitExpression(expression.EmitExpressions.GetValue(expression, _diagnostics), used);
 }
Пример #4
0
 private void EmitPseudoVariableAddress(BoundPseudoVariable expression)
 {
     EmitExpression(expression.EmitExpressions.GetAddress(expression), used: true);
 }
Пример #5
0
 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);
Пример #8
0
 internal override BoundExpression GetValue(BoundPseudoVariable variable)
 {
     var local = variable.LocalSymbol;
     var expr = InvokeGetMethod(_getValueMethod, variable.Syntax, local.Name);
     return ConvertToLocalType(_compilation, expr, local.Type);
 }
Пример #9
0
 internal override BoundExpression GetAddress(BoundPseudoVariable variable)
 {
     var local = variable.LocalSymbol;
     return InvokeGetMethod(_getAddressMethod.Construct(local.Type), variable.Syntax, local.Name);
 }
Пример #10
0
 public override BoundNode VisitPseudoVariable(BoundPseudoVariable node)
 {
     CheckDeclared(node.LocalSymbol);
     base.VisitPseudoVariable(node);
     return(null);
 }
Пример #11
0
            internal override BoundExpression GetAddress(BoundPseudoVariable variable)
            {
                var local = variable.LocalSymbol;

                return(InvokeGetMethod(_getAddressMethod.Construct(local.Type), variable.Syntax, local.Name));
            }
Пример #12
0
 internal abstract BoundExpression GetAddress(BoundPseudoVariable variable);
Пример #13
0
 internal abstract BoundExpression GetValue(BoundPseudoVariable variable, DiagnosticBag diagnostics);
Пример #14
0
 internal abstract BoundExpression GetValue(BoundPseudoVariable variable);