Operations\ControlFlowGraphBuilder.cs (17)
168localFunctions.ToImmutableAndFree(), localFunctionsMap.ToImmutable(),
197return builder.ToImmutableAndFree();
2009return builder.ToImmutableAndFree();
2058interpolatedStringBuilder.ToImmutableAndFree(),
4705return MakeInvalidOperation(operation.LimitValue.Syntax, booleanType, builder.ToImmutableAndFree());
4736return new InvocationOperation(method, constrainedToType: null, instance: null, isVirtual: false, builder.ToImmutableAndFree(),
6218return new AnonymousObjectCreationOperation(initializerBuilder.ToImmutableAndFree(), semanticModel: null,
6339return new ArrayInitializerOperation(builder.ToImmutableAndFree(), semanticModel: null, initializer.Syntax, IsImplicit(initializer));
6465return new TupleOperation(elementBuilder.ToImmutableAndFree(), tuple.NaturalType, semanticModel: null, tuple.Syntax, tuple.Type, IsImplicit(tuple));
6845return new InterpolatedStringOperation(partsBuilder.ToImmutableAndFree(), semanticModel: null, operation.Syntax, operation.Type, operation.GetConstantValue(), IsImplicit(operation));
7021arguments = builder.ToImmutableAndFree();
7234IOperation initializedInstance = new InvalidOperation(children.ToImmutableAndFree(), semanticModel: null, operation.Syntax, operation.Type,
7257VisitStatements(children.ToImmutableAndFree());
7264new InvalidOperation(VisitArray(children.ToImmutableAndFree()), semanticModel: null,
7567BlockOperation logicalBlock = BlockOperation.CreateTemporaryBlock(statementsBuilder.ToImmutableAndFree(), ((Operation)operation).OwningSemanticModel!, operation.Syntax);
7584VisitStatements(localFunctionsBuilder.ToImmutableAndFree());
7786return new AnonymousObjectCreationOperation(initializerBuilder.ToImmutableAndFree(), semanticModel: null, operation.Syntax, operation.Type, operation.IsImplicit);
Binder\Binder_Expressions.cs (21)
216symbols.ToImmutableAndFree(),
338boundArgs.ToImmutableAndFree(),
930ImmutableArray<BoundExpression> subExpressions = builder.ToImmutableAndFree();
936ImmutableArray<string> tupleNames = namesBuilder is null ? default : namesBuilder.ToImmutableAndFree();
1021var elements = elementTypesWithAnnotations.ToImmutableAndFree();
1022var locations = elementLocations.ToImmutableAndFree();
1039return new BoundTupleLiteral(node, boundArguments.ToImmutableAndFree(), elementNames, inferredPositions, tupleTypeOpt, hasErrors);
1123return (elementNames.ToImmutable(), builder.ToImmutableAndFree());
3371ImmutableArray<BoundExpression> arraySizes = sizes.ToImmutableAndFree();
3474return exprBuilder.ToImmutableAndFree();
3629return new BoundArrayInitialization(node, isInferred, initializers.ToImmutableAndFree(), hasErrors: hasErrors);
3837builder.ToImmutableAndFree(),
4753return new BoundBadExpression(node, LookupResultKind.NotCreatable, ImmutableArray.Create<Symbol?>(type), children.ToImmutableAndFree(), type) { WasCompilerGenerated = wasCompilerGenerated };
4857initializers.ToImmutableAndFree(),
5358return new BoundCollectionInitializerExpression(initializerSyntax, implicitReceiver, initializerBuilder.ToImmutableAndFree(), initializerType);
5454exprBuilder.ToImmutableAndFree(),
5593return builder == null ? constructors : builder.ToImmutableAndFree();
5787return new BoundBadExpression(node, resultKind, symbols.ToImmutableAndFree(), childNodes.ToImmutableAndFree(), type);
7067var methods = builder.ToImmutableAndFree();
9271var typeDescr = new AnonymousTypeDescriptor(fieldsBuilder.ToImmutableAndFree(), location);
Binder\Binder_InterpolatedString.cs (9)
189return new BoundUnconvertedInterpolatedString(node, builder.ToImmutableAndFree(), resultConstant, stringType);
357partsArrayBuilder.ToImmutableAndFree(),
475partsArrayBuilder.ToImmutableAndFree(),
724return partsBuilder?.ToImmutableAndFree() ?? unconvertedInterpolatedString.Parts;
844return (builderAppendCallsArray.ToImmutableAndFree(), builderPatternExpectsBool ?? false, positionInfoArray.ToImmutableAndFree(), baseStringLength, numFormatHoles);
941handlerArgumentIndexes = handlerArgumentIndexesBuilder.ToImmutableAndFree();
1045additionalConstructorArguments: argumentPlaceholdersBuilder.ToImmutableAndFree(),
1046additionalConstructorRefKinds: argumentRefKindsBuilder.ToImmutableAndFree());
Binder\Binder_Patterns.cs (6)
285return builder.ToImmutableAndFree();
1002deconstructionSubpatterns = patternsBuilder.ToImmutableAndFree();
1014deconstructionSubpatterns = patternsBuilder.ToImmutableAndFree();
1398return new BoundITuplePattern(node, iTupleGetLength, iTupleGetItem, subPatterns.ToImmutableAndFree(), strippedInputType, iTupleType, hasErrors);
1421deconstruction: subPatterns.ToImmutableAndFree(), properties: default, variable: null, variableAccess: null,
1497return builder.ToImmutableAndFree();
Lowering\ClosureConversion\ClosureConversion.cs (15)
296body = new BoundBlock(body.Syntax, _addedLocals.ToImmutableAndFree(), _addedStatements.ToImmutableAndFree()) { WasCompilerGenerated = true };
483return environments.ToImmutableAndFree();
912arguments = argumentsBuilder.ToImmutableAndFree();
913argRefKinds = refkindsBuilder.ToImmutableAndFree();
992return builder.ToImmutableAndFree();
1131return node.Update(newLocals.ToImmutableAndFree(), prologue.ToImmutableAndFree(), newValue, newType);
1179return node.Update(newLocals.ToImmutableAndFree(), node.LocalFunctions, node.HasUnsafeModifier, newInstrumentation, newStatements.ToImmutableAndFree());
1195return node.Update(newLocals.ToImmutableAndFree(), statements);
1217var rewrittenCatchLocals = newLocals.ToImmutableAndFree();
1251rewrittenFilterPrologue = new BoundStatementList(rewrittenFilter.Syntax, prologueBuilder.ToImmutableAndFree());
1304return new BoundBlock(node.Syntax, newLocals.ToImmutableAndFree(), newStatements.ToImmutableAndFree(), node.HasErrors);
Lowering\ClosureConversion\ExpressionLambdaRewriter.cs (8)
325return _bound.ArrayOrEmpty(ExpressionType, builder.ToImmutableAndFree());
336return _bound.ArrayOrEmpty(ExpressionType, builder.ToImmutableAndFree());
774var result = _bound.Sequence(locals.ToImmutableAndFree(), initializers.ToImmutableAndFree(),
779_bound.ArrayOrEmpty(ParameterExpressionType, parameters.ToImmutableAndFree())));
905return _bound.ArrayOrEmpty(MemberBindingType, builder.ToImmutableAndFree());
924return _bound.ArrayOrEmpty(ElementInitType, builder.ToImmutableAndFree());
983return ExprFactory("New", ctor, args, _bound.ArrayOrEmpty(MemberInfoType, membersBuilder.ToImmutableAndFree()));
Lowering\LocalRewriter\LocalRewriter_Call.cs (7)
201return MakeCall(nodeOpt, syntax, rewrittenReceiver, method, arguments, argumentRefKindsOpt, invokedAsExtensionMethod, resultKind, type, temps.ToImmutableAndFree());
533rewrittenArguments = visitedArgumentsBuilder.ToImmutableAndFree();
921argumentRefKindsOpt = refKindsBuilder.ToImmutableAndFree();
989return argumentsBuilder.ToImmutableAndFree();
1188argument = CreateParamArrayArgument(syntax, parameter.Type, paramArray.ToImmutableAndFree(), compilation, localRewriter: null);
1208return argumentsInEvaluationBuilder.ToImmutableAndFree();
1275var arrayArgs = paramArray.ToImmutableAndFree();
Lowering\LocalRewriter\LocalRewriter_DeconstructionAssignmentOperator.cs (8)
52return _factory.Sequence(lhsTemps.ToImmutableAndFree(), lhsEffects.ToImmutableAndFree(), result);
97return _factory.Sequence(temps.ToImmutableAndFree(), effects.ToImmutableAndFree(), last);
106return _factory.Sequence(temps.ToImmutableAndFree(), effects.ToImmutableAndFree(), returnValue);
269right.Syntax, sourceTuple: null, wasTargetTyped: false, arguments: builder!.ToImmutableAndFree(), argumentNamesOpt: default, inferredNamesOpt: default, tupleType);
367return builder.ToImmutableAndFree();
408return outLocals.ToImmutableAndFree();
517return init.ToImmutableAndFree();
Lowering\LocalRewriter\LocalRewriter_TupleBinaryOperator.cs (10)
38BoundExpression result = _factory.Sequence(temps.ToImmutableAndFree(), initEffects.ToImmutableAndFree(), returnValue);
82var newArguments = builder.ToImmutableAndFree();
126syntax, sourceTuple: null, wasTargetTyped: true, fieldAccessorsBuilder.ToImmutableAndFree(), ImmutableArray<string?>.Empty,
160var newArguments = builder.ToImmutableAndFree();
308BoundExpression innerSequence = _factory.Sequence(locals: ImmutableArray<LocalSymbol>.Empty, innerEffects.ToImmutableAndFree(), logicalExpression);
322return _factory.Sequence(ImmutableArray<LocalSymbol>.Empty, outerEffects.ToImmutableAndFree(),
330return _factory.Sequence(ImmutableArray<LocalSymbol>.Empty, outerEffects.ToImmutableAndFree(),
339_factory.Sequence(ImmutableArray<LocalSymbol>.Empty, outerEffects.ToImmutableAndFree(),
458arguments: argumentBuilder.ToImmutableAndFree(),
Lowering\StateMachineRewriter\MethodToStateMachineRewriter.cs (6)
520proxies.Add(local, new CapturedToExpressionSymbolReplacement(replacement, hoistedFields.ToImmutableAndFree(), isReusable: true));
527return F.Sequence(ImmutableArray.Create(sacrificialTemp), sideEffects.ToImmutableAndFree(), F.AssignmentExpression(F.Local(sacrificialTemp), replacement, isRef: true));
538return F.Sequence(ImmutableArray<LocalSymbol>.Empty, sideEffects.ToImmutableAndFree(), last);
563return array.Update(expression, indices.ToImmutableAndFree(), array.Type);
749translated = node.Update(newLocalsBuilder.ToImmutableAndFree(), statements);
761newLocals = newLocalsBuilder.ToImmutableAndFree();
Binding\Binder_Expressions.vb (12)
367Dim elements = elementTypes.ToImmutableAndFree()
368Dim locations = elementLocations.ToImmutableAndFree()
384Return New BoundTupleLiteral(node, inferredType, elementNames, inferredPositions, boundArguments.ToImmutableAndFree(), tupleTypeOpt, hasErrors)
457Return (elementNames.ToImmutable(), builder.ToImmutableAndFree())
1624arrayInitialization = New BoundArrayInitialization(arrayInitialization.Syntax, initializers.ToImmutableAndFree, Nothing)
3840Return BadExpression(node, children.ToImmutableAndFree(), ErrorTypeSymbol.UnknownResultType)
3898boundArguments = convertedArguments.ToImmutableAndFree()
4274Return New BoundArrayInitialization(node, initializers.ToImmutableAndFree(), arrayInitType, hasErrors:=True)
4278Return New BoundArrayInitialization(node, initializers.ToImmutableAndFree(), arrayInitType, hasErrors:=True)
4282Return New BoundArrayInitialization(node, initializers.ToImmutableAndFree(), arrayInitType, hasErrors:=True)
4287Return New BoundArrayInitialization(node, initializers.ToImmutableAndFree(), arrayInitType)
4419Return boundArgumentsBuilder.ToImmutableAndFree
Binding\Binder_Invocation.vb (10)
326Return BadExpression(node, badExpressionChildren.ToImmutableAndFree(), ErrorTypeSymbol.UnknownResultType)
790ImmutableArray(Of Symbol).Empty, builder.ToImmutableAndFree(),
1646childBoundNodes = builder.ToImmutableAndFree()
1760bestSymbols = bestSymbolsBuilder.ToImmutableAndFree()
2726New BoundArrayInitialization(node, items.ToImmutableAndFree(), targetType).MakeCompilerGenerated(), Nothing, Nothing, targetType).MakeCompilerGenerated()
2796Return (argumentsInOrder.ToImmutableAndFree(), defaultArguments)
2949argBuilder.ToImmutableAndFree,
3090boundArguments = boundArgumentsBuilder.ToImmutableAndFree
3091argumentNames = If(argumentNamesBuilder Is Nothing, Nothing, argumentNamesBuilder.ToImmutableAndFree)
3092argumentNamesLocations = If(argumentNamesLocationsBuilder Is Nothing, Nothing, argumentNamesLocationsBuilder.ToImmutableAndFree)
Binding\Binder_Statements.vb (10)
288Return New BoundBadStatement(caseStatement, children.ToImmutableAndFree(), hasErrors:=True)
405locals = localBuilder.ToImmutableAndFree()
415Return New BoundBlock(methodBlock, If(methodBlock IsNot Nothing, methodBlock.Statements, Nothing), locals, statements.ToImmutableAndFree())
761Return New BoundRedimStatement(node, operands.ToImmutableAndFree())
794Return New BoundEraseStatement(node, clauses.ToImmutableAndFree())
1048builder.Add(New BoundAsNewLocalDeclarations(varDecl, locals.ToImmutableAndFree(), asNewInitializer, Me))
1052Return builder.ToImmutableAndFree()
2079Return New BoundBlock(syntax, stmtList, locals.ToImmutableAndFree, boundStatements.AsImmutableOrNull())
3067nextVariables = nextVariableBuilder.ToImmutableAndFree
4748Return catchBlocks.ToImmutableAndFree
Lowering\LocalRewriter\LocalRewriter_LateBindingHelpers.vb (9)
82Dim initializer = New BoundArrayInitialization(node, initializers.ToImmutableAndFree, Nothing)
155Return New BoundSequence(node, ImmutableArray.Create(arrayTemp), sideeffects.ToImmutableAndFree, arrayTempRef, arrayTempRef.Type)
245Return New BoundSequence(node, ImmutableArray.Create(arrayTemp), sideeffects.ToImmutableAndFree, arrayTempRef, arrayTempRef.Type)
296Dim initializer = New BoundArrayInitialization(node, initializers.ToImmutableAndFree, Nothing)
326Dim initializer = New BoundArrayInitialization(node, initializers.ToImmutableAndFree, Nothing)
846ImmutableArray.Create(Of BoundExpression)(store).Concat(copyBackBuilder.ToImmutableAndFree),
914arguments = argumentBuilder.ToImmutableAndFree
915writeTargets = writeTargetsBuilder.ToImmutableAndFree
961Dim initializer = New BoundArrayInitialization(node, initializers.ToImmutableAndFree, Nothing)
Microsoft.CodeAnalysis.VisualBasic.ExpressionEvaluator.ExpressionCompiler.UnitTests (1)