1 write to _factory
Microsoft.CodeAnalysis.VisualBasic (1)
Lowering\ExpressionLambdaRewriter\ExpressionLambdaRewriter.vb (1)
46
_factory
= New SyntheticBoundNodeFactory(Nothing, currentMethod, node, compilationState, diagnostics)
185 references to _factory
Microsoft.CodeAnalysis.VisualBasic (185)
Lowering\ExpressionLambdaRewriter\ExpressionLambdaRewriter.vb (88)
47
_expressionType =
_factory
.WellKnownType(WellKnownType.System_Linq_Expressions_Expression)
54
_elementInitType = Me.
_factory
.WellKnownType(WellKnownType.System_Linq_Expressions_ElementInit)
63
_memberBindingType = Me.
_factory
.WellKnownType(WellKnownType.System_Linq_Expressions_MemberBinding)
72
_memberInfoType = Me.
_factory
.WellKnownType(WellKnownType.System_Reflection_MemberInfo)
81
_int32Type =
_factory
.SpecialType(SpecialType.System_Int32)
90
_objectType =
_factory
.SpecialType(SpecialType.System_Object)
126
Return
_factory
.Diagnostics
182
Return VisitInternal(Me.
_factory
.Literal("Diagnostics Generated"))
193
Dim old As SyntaxNode =
_factory
.Syntax
194
_factory
.Syntax = node.Syntax
196
_factory
.Syntax = old
202
Return
_factory
.Convert(_expressionType, result)
323
Dim parameterExpressionType =
_factory
.WellKnownType(WellKnownType.System_Linq_Expressions_ParameterExpression)
333
Dim param =
_factory
.SynthesizedLocal(parameterExpressionType)
334
Dim parameterReference =
_factory
.Local(param, False)
335
Dim parameterReferenceLValue =
_factory
.Local(param, True)
342
_factory
.[Typeof](
344
_factory
.WellKnownType(WellKnownType.System_Type)),
345
_factory
.Literal(p.Name))
347
initializers.Add(
_factory
.AssignmentExpression(parameterReferenceLValue, parameter))
357
Dim result =
_factory
.Sequence(locals.ToImmutableAndFree(),
363
_factory
.Array(parameterExpressionType, parameters.ToImmutableAndFree())))
397
If(method.IsShared,
_factory
.Null(_expressionType), receiverOpt),
398
_factory
.MethodInfo(method,
_factory
.WellKnownType(WellKnownType.System_Reflection_MethodInfo)), ConvertArgumentsIntoArray(node.Arguments))
410
rewrittenReceiver =
_factory
.Null(_expressionType)
426
_factory
.FieldInfo(field))
437
rewrittenReceiver =
_factory
.Null(_expressionType)
448
_factory
.MethodInfo(getMethod,
_factory
.WellKnownType(WellKnownType.System_Reflection_MethodInfo)))
468
receiverOpt = Me.
_factory
.Convert(Me.ObjectType, Me.
_factory
.Null())
481
receiverOpt = Me.
_factory
.Convert(Me.ObjectType, receiverOpt)
490
Dim createDelegate = DirectCast(Binder.GetWellKnownTypeMember(Me.
_factory
.Compilation, WellKnownMember.System_Reflection_MethodInfo__CreateDelegate, useSiteInfo), MethodSymbol)
496
Dim methodInfo As BoundExpression = Me.
_factory
.MethodInfo(targetMethod, createDelegate.ContainingType)
499
result = Me.
_factory
.Call(methodInfo,
501
Me.
_factory
.[Typeof](delegateType, createDelegate.Parameters(0).Type),
506
createDelegate = DirectCast(Me.
_factory
.SpecialMember(SpecialMember.System_Delegate__CreateDelegate4), MethodSymbol)
509
result = Me.
_factory
.Call(Me.
_factory
.Null(Me.ObjectType),
511
Me.
_factory
.[Typeof](delegateType, createDelegate.Parameters(0).Type),
513
Me.
_factory
.MethodInfo(targetMethod, createDelegate.Parameters(2).Type),
514
Me.
_factory
.Literal(False))
546
Return
_factory
.Array(_expressionType, newExpr.AsImmutableOrNull())
562
_factory
.[Typeof](node.Type,
_factory
.WellKnownType(WellKnownType.System_Type))), node.InitializerOpt)
620
_factory
.Convert(MemberInfoType, Me.
_factory
.FieldInfo(DirectCast(leftSymbol, FieldSymbol))),
621
Me.
_factory
.MethodInfo((DirectCast(leftSymbol, PropertySymbol)).SetMethod,
_factory
.WellKnownType(WellKnownType.System_Reflection_MethodInfo)))
623
newInitializers(i) =
_factory
.Convert(
633
Return
_factory
.Array(MemberBindingType, newInitializers.AsImmutableOrNull())
651
newInitializers(i) =
_factory
.Convert(
655
_factory
.MethodInfo([call].Method,
_factory
.WellKnownType(WellKnownType.System_Reflection_MethodInfo)),
661
Return
_factory
.Array(ElementInitType, newInitializers.AsImmutableOrNull())
674
_factory
.[Typeof](node.Type,
_factory
.WellKnownType(WellKnownType.System_Type)))
677
Dim ctor =
_factory
.ConstructorInfo(node.ConstructorOpt)
687
methodInfos(i) = Me.
_factory
.Convert(Me.MemberInfoType, Me.
_factory
.MethodInfo(properties(i).GetMethod,
_factory
.WellKnownType(WellKnownType.System_Reflection_MethodInfo)))
692
_factory
.Convert(
_factory
.SpecialType(SpecialType.System_Collections_Generic_IEnumerable_T).Construct(_expressionType),
694
Me.
_factory
.Array(Me.MemberInfoType, methodInfos.AsImmutableOrNull()))
721
DirectCast(Me.
_factory
.SpecialMember(SpecialMember.System_Array__LongLength), PropertySymbol).GetMethod,
736
Dim boundType As BoundExpression =
_factory
.[Typeof](arrayType.ElementType,
_factory
.WellKnownType(WellKnownType.System_Type))
751
Return
_factory
.Array(_expressionType, newArgs.AsImmutableOrNull)
755
Return ConvertRuntimeHelperToExpressionTree(WellKnownMember.System_Linq_Expressions_Expression__TypeIs, Visit(node.Operand),
_factory
.[Typeof](node.TargetType,
_factory
.WellKnownType(WellKnownType.System_Type)))
767
_factory
.MethodInfo(method,
_factory
.WellKnownType(WellKnownType.System_Reflection_MethodInfo)),
768
_factory
.Array(_expressionType, params))
773
Return ConvertRuntimeHelperToExpressionTree(WellKnownMember.System_Linq_Expressions_Expression__Default,
_factory
.[Typeof](type,
_factory
.WellKnownType(WellKnownType.System_Type)))
779
_factory
.ConstructorInfo(helper),
780
_factory
.Array(_expressionType, argument))
785
Return
_factory
.Convert(_expressionType, ConvertRuntimeHelperToExpressionTree(WellKnownMember.System_Linq_Expressions_Expression__Negate_Expression, expr))
791
Return ConvertRuntimeHelperToExpressionTree(WellKnownMember.System_Linq_Expressions_Expression__New_Type,
_factory
.[Typeof](type,
_factory
.WellKnownType(WellKnownType.System_Type)))
807
Return
_factory
.Convert(
811
_factory
.Convert(Me.ObjectType, node),
_factory
.[Typeof](type,
_factory
.WellKnownType(WellKnownType.System_Type))))
828
Dim helper As MethodSymbol =
_factory
.WellKnownMember(Of MethodSymbol)(helperMethod)
835
Return New BoundCall(
_factory
.Syntax, helper, methodGroupOpt:=Nothing, receiverOpt:=Nothing,
841
Return
_factory
.BadExpression(arguments)
Lowering\ExpressionLambdaRewriter\ExpressionLambdaRewriter_BinaryOperator.vb (37)
78
Me.
_factory
.Literal(isLifted),
79
_factory
.MethodInfo(node.Call.Method,
_factory
.WellKnownType(WellKnownType.System_Reflection_MethodInfo)))
88
_factory
.MethodInfo(node.Call.Method,
_factory
.WellKnownType(WellKnownType.System_Reflection_MethodInfo)))
178
_factory
.MethodInfo(operand.Call.Method,
_factory
.WellKnownType(WellKnownType.System_Reflection_MethodInfo)))
273
left, right, Me.
_factory
.Literal(resultType.IsNullableType),
_factory
.MethodInfo(helper,
_factory
.WellKnownType(WellKnownType.System_Reflection_MethodInfo)))
308
Dim newType As TypeSymbol = If(operandIsNullable, Me.
_factory
.NullableOf(operandUnderlyingType), operandUnderlyingType)
318
Dim newType As TypeSymbol = If(operandIsNullable, Me.
_factory
.NullableOf(Me.Int32Type), Me.Int32Type)
325
left, right, Me.
_factory
.Literal(resultType.IsNullableType),
326
Me.
_factory
.Null(
_factory
.WellKnownType(WellKnownType.System_Reflection_MethodInfo)))
352
Dim systemBool As TypeSymbol =
_factory
.SpecialType(SpecialType.System_Boolean)
403
Return
_factory
.BadExpression(Visit(node.Left), Visit(node.Right))
408
Return
_factory
.BadExpression(Visit(node.Left), Visit(node.Right))
411
helper = Me.
_factory
.WellKnownMember(Of MethodSymbol)(WellKnownMember.System_Math__PowDoubleDouble)
413
Return
_factory
.BadExpression(Visit(node.Left), Visit(node.Right))
427
left, right,
_factory
.MethodInfo(helper,
_factory
.WellKnownType(WellKnownType.System_Reflection_MethodInfo)))
459
result = Convert(result, If(resultTypeIsNullable, Me.
_factory
.NullableOf(resultUnderlyingType), resultUnderlyingType), isChecked)
522
loweredOperand = Convert(loweredOperand, If(isNullable, Me.
_factory
.NullableOf(underlyingType), underlyingType), False)
527
loweredOperand = Convert(loweredOperand, If(isNullable, Me.
_factory
.NullableOf(Me.Int32Type), Me.Int32Type), checked)
576
result = Convert(result, Me.
_factory
.NullableOf(Me.Int32Type), isChecked)
590
_factory
.Convert(_expressionType,
593
Me.
_factory
.Convert(Me.ObjectType, Me.
_factory
.Literal(shiftMask)),
594
Me.
_factory
.Typeof(Me.Int32Type,
_factory
.WellKnownType(WellKnownType.System_Type))))
599
Dim int32Nullable As TypeSymbol = If(isNullable, Me.
_factory
.NullableOf(Me.Int32Type), Nothing)
605
loweredOperand =
_factory
.Convert(_expressionType,
653
Return DirectCast(
_factory
.SpecialMember(specialHelper), MethodSymbol)
680
Return DirectCast(
_factory
.SpecialMember(specialHelper), MethodSymbol)
719
Return Me.
_factory
.WellKnownMember(Of MethodSymbol)(wellKnownHelper)
784
Return Me.
_factory
.Convert(resultType, [call])
Lowering\ExpressionLambdaRewriter\ExpressionLambdaRewriter_ConditionalExpresion.vb (16)
65
Return Me.
_factory
.SynthesizedParameter(paramType, s_coalesceLambdaParameterName)
69
Return Me.
_factory
.Parameter(paramSymbol).MakeRValue()
73
Dim parameterExpressionType As TypeSymbol =
_factory
.WellKnownType(WellKnownType.System_Linq_Expressions_ParameterExpression)
75
Dim paramLocalSymbol As LocalSymbol = Me.
_factory
.SynthesizedLocal(parameterExpressionType)
76
Dim parameterReference As BoundLocal = Me.
_factory
.Local(paramLocalSymbol, True)
79
_factory
.[Typeof](lambdaParameter.Type,
_factory
.WellKnownType(WellKnownType.System_Type)),
80
_factory
.Literal(s_coalesceLambdaParameterName))
87
Me.
_factory
.Sequence(ImmutableArray.Create(Of LocalSymbol)(
90
Me.
_factory
.AssignmentExpression(parameterReference, parameter)),
94
Me.
_factory
.Array(
115
Return Me.
_factory
.Convert(toType, CreateUserDefinedNullableToUnderlyingConversion(parameter, parameterType, isChecked), isChecked)
117
Return Me.
_factory
.Convert(toType, parameter, isChecked)
129
Dim helper As MethodSymbol = DirectCast(Me.
_factory
.SpecialMember(
134
Return Me.
_factory
.Convert(underlyingType, expression, isChecked)
214
parameter = Me.
_factory
.Convert(expectedParameterType, parameter, isChecked)
Lowering\ExpressionLambdaRewriter\ExpressionLambdaRewriter_Conversion.vb (33)
73
Return Convert(Visit(Me.
_factory
.Null(Me.ObjectType)), typeTo, False)
113
type = type.ExpressionTargetDelegate(Me.
_factory
.Compilation)
114
Dim result =
_factory
.Convert(_expressionType, VisitLambdaInternal(node, DirectCast(type, NamedTypeSymbol)))
212
helperOperandType = Me.
_factory
.NullableOf(helperOperandType)
217
helperReturnType = Me.
_factory
.NullableOf(helperReturnType)
235
Dim helper As MethodSymbol = Me.
_factory
.WellKnownMember(Of MethodSymbol)(WellKnownMember.Microsoft_VisualBasic_CompilerServices_Conversions__ToGenericParameter_T_Object)
236
Return [Call](
_factory
.Null(_expressionType), helper.Construct(typeTo), rewrittenOperand)
247
Return ConvertIfNeeded(objectConversion,
_factory
.SpecialType(SpecialType.System_Object), typeTo, False)
257
helper =
_factory
.WellKnownMember(Of Symbol)(WellKnownMember.Microsoft_VisualBasic_CompilerServices_Conversions__ToCharArrayRankOneString)
258
argumentType =
_factory
.SpecialType(SpecialType.System_String)
260
helper =
_factory
.WellKnownMember(Of Symbol)(WellKnownMember.Microsoft_VisualBasic_CompilerServices_Conversions__ToCharArrayRankOneObject)
261
argumentType =
_factory
.SpecialType(SpecialType.System_Object)
276
typeBeforeNegation =
_factory
.SpecialType(SpecialType.System_Int32)
284
typeBeforeNegation = Me.
_factory
.NullableOf(typeBeforeNegation)
312
Return Me.
_factory
.SpecialType(SpecialType.System_SByte)
314
Return Me.
_factory
.SpecialType(SpecialType.System_Int16)
316
Return Me.
_factory
.SpecialType(SpecialType.System_Int32)
318
Return Me.
_factory
.SpecialType(SpecialType.System_Int64)
329
Dim helper As MethodSymbol = DirectCast(Me.
_factory
.SpecialMember(
348
Dim helper As MethodSymbol = DirectCast(Me.
_factory
.SpecialMember(
405
_factory
.[Typeof](type,
_factory
.WellKnownType(WellKnownType.System_Type)))
415
expr =
_factory
.Convert(_expressionType, expr)
418
Return
_factory
.Convert(
425
_factory
.[Typeof](type,
_factory
.WellKnownType(WellKnownType.System_Type))))
430
Return
_factory
.Convert(
435
_factory
.[Typeof](type,
_factory
.WellKnownType(WellKnownType.System_Type)),
436
_factory
.MethodInfo(helper,
_factory
.WellKnownType(WellKnownType.System_Reflection_MethodInfo))))
610
Return Me.
_factory
.WellKnownMember(Of MethodSymbol)(wellKnownHelper)
612
Return DirectCast(
_factory
.SpecialMember(specialHelper), MethodSymbol)
Lowering\ExpressionLambdaRewriter\ExpressionLambdaRewriter_UnaryOperator.vb (11)
49
argument, Me.
_factory
.MethodInfo(method,
_factory
.WellKnownType(WellKnownType.System_Reflection_MethodInfo))))
73
Return ConvertRuntimeHelperToExpressionTree(helper, argument, Me.
_factory
.MethodInfo(method,
_factory
.WellKnownType(WellKnownType.System_Reflection_MethodInfo)))
101
result = Convert(result, If(origArgTypeIsNullable, Me.
_factory
.NullableOf(origArgUnderlyingType), origArgUnderlyingType), isChecked)
140
Return ConvertRuntimeHelperToExpressionTree(WellKnownMember.System_Linq_Expressions_Expression__Coalesce_Lambda, Visit(userDefinedOperator.Operand), Visit(Me.
_factory
.Literal(False)), coalesceLambda)
151
Return ConvertRuntimeHelperToExpressionTree(WellKnownMember.System_Linq_Expressions_Expression__Coalesce, Visit(operand), Visit(Me.
_factory
.Literal(False)))
193
_factory
.MethodInfo(node.Call.Method,
_factory
.WellKnownType(WellKnownType.System_Reflection_MethodInfo)))
228
Return DirectCast(
_factory
.SpecialMember(specialHelper), MethodSymbol)
247
Return Me.
_factory
.WellKnownMember(Of MethodSymbol)(wellKnownHelper)