198 references to ToImmutableAndFree
Microsoft.CodeAnalysis (198)
CodeGen\ArrayMembers.cs (2)
208return parameters.ToImmutableAndFree(); 315return parameters.ToImmutableAndFree();
CodeGen\LocalScopeManager.cs (3)
141return result.ToImmutableAndFree(); 153return result.ToImmutableAndFree(); 160return result.ToImmutableAndFree();
CodeGen\MethodBody.cs (1)
115return sequencePointsBuilder.ToImmutableAndFree();
CodeGen\PrivateImplementationDetails.cs (1)
170_orderedSynthesizedFields = fieldsBuilder.ToImmutableAndFree();
CodeGen\SwitchIntegralJumpTableEmitter.cs (1)
248return crumbled.ToImmutableAndFree();
Collections\ArrayBuilderExtensions.cs (5)
97return builder.ToImmutableAndFree(); 137return builder.ToImmutableAndFree(); 177return builder.ToImmutableAndFree(); 224return builder?.ToImmutableAndFree() ?? ImmutableArray<T>.Empty; 269return OneOrMany.Create(builder.ToImmutableAndFree());
Collections\DictionaryExtensions.cs (1)
97result.Add(key, values.ToImmutableAndFree());
Collections\ImmutableArrayExtensions.cs (16)
197return builder.ToImmutableAndFree(); 226return builder.ToImmutableAndFree(); 256return builder.ToImmutableAndFree(); 276return builder.ToImmutableAndFree(); 296return builder.ToImmutableAndFree(); 318return builder.ToImmutableAndFree(); 342return builder.ToImmutableAndFree(); 366return builder.ToImmutableAndFree(); 390return builder.ToImmutableAndFree(); 415return builder.ToImmutableAndFree(); 477return builder.ToImmutableAndFree(); 529return builder.ToImmutableAndFree(); 604return builder.ToImmutableAndFree(); 879return builder.ToImmutableAndFree(); 1193return builder.ToImmutableAndFree(); 1261return builder.ToImmutableAndFree();
Collections\TopologicalSort.cs (1)
141allNodes = allNodesBuilder.ToImmutableAndFree();
CommandLine\AnalyzerConfig.SectionNameMatching.cs (1)
121return new SectionNameMatcher(regex, numberRangePairs.ToImmutableAndFree());
CommandLine\AnalyzerConfigSet.cs (6)
133return new AnalyzerConfigSet(sortedAnalyzerConfigs.ToImmutableAndFree(), globalConfig); 156allMatchers.Add(builder.ToImmutableAndFree()); 161_analyzerMatchers = allMatchers.ToImmutableAndFree(); 300diagnosticBuilder.ToImmutableAndFree()); 385diagnosticBuilder.ToImmutableAndFree()); 547GlobalAnalyzerConfig globalConfig = new GlobalAnalyzerConfig(globalSection, namedSectionBuilder.ToImmutableAndFree());
CommandLine\CommandLineParser.cs (1)
376return pathMapBuilder.ToImmutableAndFree();
CommandLine\CommonCompiler.cs (1)
1612return builder.ToImmutableAndFree();
CommandLine\SarifV2ErrorLogger.cs (1)
345return effectiveSeveritiesBuilder.ToImmutableAndFree();
Compilation\Compilation.cs (1)
1278return typesByMetadataName?.ToImmutableAndFree() ?? ImmutableArray<INamedTypeSymbol>.Empty;
Compilation\CompilationOptions.cs (1)
330return builder.ToImmutableAndFree();
Compilation\ParseOptions.cs (1)
49return builder.ToImmutableAndFree();
Diagnostic\DiagnosticBag.cs (1)
219return builder.ToImmutableAndFree();
DiagnosticAnalyzer\AnalyzerDriver.cs (9)
938return builder.ToImmutableAndFree(); 1083return builder.ToImmutableAndFree(); 1171mapBuilder.Add(diagnostic, new ProgrammaticSuppressionInfo(set.ToImmutableAndFree())); 1476var actionsByKind = actionsByKindBuilder.Select(a => a.ToImmutableAndFree()).ToImmutableArray(); 1481return builder.ToImmutableAndFree(); 1494return builder.ToImmutableAndFree(); 2548ImmutableArray<DeclarationInfo> declarationInfos = builder.ToImmutableAndFree(); 2930return operationBlocksToAnalyze.ToImmutableAndFree(); 2987return operationsToAnalyze.ToImmutableAndFree();
DiagnosticAnalyzer\AnalyzerExecutor.cs (2)
944var tuples = nodeActionsByKind.Select(kvp => KeyValuePairUtil.Create(kvp.Key, kvp.Value.ToImmutableAndFree())); 1043var tuples = operationActionsByKind.Select(kvp => KeyValuePairUtil.Create(kvp.Key, kvp.Value.ToImmutableAndFree()));
DiagnosticAnalyzer\AnalyzerManager.cs (1)
227return filteredActionsBuilderOpt != null ? filteredActionsBuilderOpt.ToImmutableAndFree() : symbolStartActions;
DiagnosticAnalyzer\CompilationWithAnalyzers.cs (3)
872return (symbolStartAnalyzersBuilder.ToImmutableAndFree(), otherAnalyzersBuilder.ToImmutableAndFree()); 1104return builder.ToImmutableAndFree();
DiagnosticAnalyzer\CompilerDiagnosticAnalyzer.cs (1)
35return builder.ToImmutableAndFree();
DiagnosticAnalyzer\DiagnosticStartAnalysisScope.cs (1)
840return builder.ToImmutableAndFree();
DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (2)
239return results.ToImmutableAndFree(); 772return builder.ToImmutableAndFree();
Emit\CommonPEModuleBuilder.cs (3)
479return result.ToImmutableAndFree(); 527_lazyManagedResources = builder.ToImmutableAndFree(); 864return builder.ToImmutableAndFree();
Emit\EditAndContinue\DefinitionMap.cs (3)
482return builder.ToImmutableAndFree(); 557return new MetadataLambdasAndClosures(lambdasBuilder.ToImmutableAndFree(), closureTreeBuilder.ToImmutable()); 659return builder.ToImmutableAndFree();
Emit\EditAndContinue\SymbolChanges.cs (2)
470elementSelector: static e => e.Value.ToImmutableAndFree()) ?? ImmutableSegmentedDictionary<ISymbolInternal, ImmutableArray<ISymbolInternal>>.Empty; 474elementSelector: static e => e.Value.ToImmutableAndFree());
Emit\EditAndContinue\SymbolMatcher.cs (1)
222synthesizedMembersBuilder[mappedContainer] = memberBuilder.ToImmutableAndFree();
Emit\EditAndContinueMethodDebugInformation.cs (4)
142return mapBuilder.ToImmutableAndFree(); 257closures = closuresBuilder.ToImmutableAndFree(); 258lambdas = lambdasBuilder.ToImmutableAndFree(); 361return mapBuilder.ToImmutableAndFree();
Emit\NoPia\CommonEmbeddedMember.cs (1)
88return builder.ToImmutableAndFree();
Emit\NoPia\CommonEmbeddedParameter.cs (1)
129return builder.ToImmutableAndFree();
Emit\NoPia\CommonEmbeddedType.cs (5)
214return builder.ToImmutableAndFree(); 261ImmutableInterlocked.InterlockedInitialize(ref _lazyEvents, builder.ToImmutableAndFree()); 290ImmutableInterlocked.InterlockedInitialize(ref _lazyFields, builder.ToImmutableAndFree()); 480ImmutableInterlocked.InterlockedInitialize(ref _lazyMethods, builder.ToImmutableAndFree()); 509ImmutableInterlocked.InterlockedInitialize(ref _lazyProperties, builder.ToImmutableAndFree());
Emit\NoPia\EmbeddedTypesManager.cs (1)
99if (ImmutableInterlocked.InterlockedInitialize(ref _frozen, builder.ToImmutableAndFree()))
InternalUtilities\EnumerableExtensions.cs (11)
364return builder.ToImmutableAndFree(); 381return builder.ToImmutableAndFree(); 425return builder.ToImmutableAndFree(); 437return builder.ToImmutableAndFree(); 450return builder.ToImmutableAndFree(); 463return builder.ToImmutableAndFree(); 475return builder.ToImmutableAndFree(); 490return builder.ToImmutableAndFree(); 505return builder.ToImmutableAndFree(); 520return builder.ToImmutableAndFree(); 532return builder.ToImmutableAndFree();
InternalUtilities\FileLockCheck.cs (1)
207return lockInfos.ToImmutableAndFree();
MetadataReader\MetadataDecoder.cs (6)
281sizes = builder.ToImmutableAndFree(); 324lowerBounds = builder.ToImmutableAndFree(); 417var arguments = argumentsBuilder.ToImmutableAndFree(); 418var argumentRefersToNoPiaLocalType = argumentRefersToNoPiaLocalTypeBuilder.ToImmutableAndFree(); 766return modifiers?.ToImmutableAndFree() ?? default; 1952return resultBuilder.ToImmutableAndFree();
MetadataReader\MetadataHelpers.cs (1)
652return result.ToImmutableAndFree();
MetadataReader\PEAssembly.cs (2)
79this.AssemblyReferences = refs.ToImmutableAndFree(); 80this.ModuleReferenceCounts = refCounts.ToImmutableAndFree();
MetadataReader\PEModule.cs (7)
1632return result?.ToImmutableAndFree() ?? ImmutableArray<string>.Empty; 1639return result?.ToImmutableAndFree() ?? ImmutableArray<string>.Empty; 1679return result.ToImmutableAndFree(); 1722return (whenTrue.ToImmutableAndFree(), whenFalse.ToImmutableAndFree()); 2434value = boolArrayBuilder.ToImmutableAndFree(); 2463value = byteArrayBuilder.ToImmutableAndFree();
MetadataReader\TypeNameDecoder.cs (2)
234refersToNoPiaLocalType = refersToNoPiaBuilder.ToImmutableAndFree(); 235return typeArgumentsBuilder.ToImmutableAndFree();
MetadataReference\AssemblyIdentity.cs (1)
447return result.ToImmutableAndFree();
MetadataReference\AssemblyIdentity.DisplayName.cs (1)
724result = bytes.ToImmutableAndFree();
Operations\ControlFlowBranch.cs (3)
72result = CollectRegions(Destination.Ordinal, Source.EnclosingRegion).ToImmutableAndFree(); 117result = builder.ToImmutableAndFree(); 154var result = builder == null ? ImmutableArray<ControlFlowRegion>.Empty : builder.ToImmutableAndFree();
Operations\ControlFlowGraphBuilder.BasicBlockBuilder.cs (2)
83_statements?.ToImmutableAndFree() ?? ImmutableArray<IOperation>.Empty, 287return branches.ToImmutableAndFree();
Operations\ControlFlowGraphBuilder.cs (17)
168localFunctions.ToImmutableAndFree(), localFunctionsMap.ToImmutable(), 197return builder.ToImmutableAndFree(); 2015return builder.ToImmutableAndFree(); 2064interpolatedStringBuilder.ToImmutableAndFree(), 4802return MakeInvalidOperation(operation.LimitValue.Syntax, booleanType, builder.ToImmutableAndFree()); 4833return new InvocationOperation(method, constrainedToType: null, instance: null, isVirtual: false, builder.ToImmutableAndFree(), 6417return new AnonymousObjectCreationOperation(initializerBuilder.ToImmutableAndFree(), semanticModel: null, 6538return new ArrayInitializerOperation(builder.ToImmutableAndFree(), semanticModel: null, initializer.Syntax, IsImplicit(initializer)); 6703return new TupleOperation(elementBuilder.ToImmutableAndFree(), tuple.NaturalType, semanticModel: null, tuple.Syntax, tuple.Type, IsImplicit(tuple)); 7083return new InterpolatedStringOperation(partsBuilder.ToImmutableAndFree(), semanticModel: null, operation.Syntax, operation.Type, operation.GetConstantValue(), IsImplicit(operation)); 7259arguments = builder.ToImmutableAndFree(); 7472IOperation initializedInstance = new InvalidOperation(children.ToImmutableAndFree(), semanticModel: null, operation.Syntax, operation.Type, 7495VisitStatements(children.ToImmutableAndFree()); 7502new InvalidOperation(VisitArray(children.ToImmutableAndFree()), semanticModel: null, 7833BlockOperation logicalBlock = BlockOperation.CreateTemporaryBlock(statementsBuilder.ToImmutableAndFree(), ((Operation)operation).OwningSemanticModel!, operation.Syntax); 7850VisitStatements(localFunctionsBuilder.ToImmutableAndFree()); 8052return new AnonymousObjectCreationOperation(initializerBuilder.ToImmutableAndFree(), semanticModel: null, operation.Syntax, operation.Type, operation.IsImplicit);
Operations\ControlFlowGraphBuilder.RegionBuilder.cs (1)
328subRegions = builder.ToImmutableAndFree();
Operations\IOperation.OperationList.cs (1)
52return builder.ToImmutableAndFree();
Operations\IOperation.OperationList.Reversed.cs (2)
55return builder.ToImmutableAndFree(); 66return builder.ToImmutableAndFree();
Operations\OperationExtensions.cs (2)
141return arrayBuilder.ToImmutableAndFree(); 157return arrayBuilder.ToImmutableAndFree();
PEWriter\ExtendedPEBuilder.cs (1)
64return builder.ToImmutableAndFree();
PEWriter\MetadataWriter.cs (1)
635return builder?.ToImmutableAndFree() ?? parameters;
PEWriter\MetadataWriter.PortablePdb.cs (1)
554return builder.ToImmutableAndFree();
ReferenceManager\AssemblyDataForAssemblyBeingBuilt.cs (1)
53_referencedAssemblies = refs.ToImmutableAndFree();
ReferenceManager\CommonReferenceManager.Binding.cs (2)
457return result.ToImmutableAndFree(); 472return result.ToImmutableAndFree();
ReferenceManager\CommonReferenceManager.Resolution.cs (7)
398boundReferenceDirectives = uniqueDirectiveReferences.ToImmutableAndFree(); 424assemblies = assembliesBuilder.ToImmutableAndFree(); 433modules = lazyModulesBuilder.ToImmutableAndFree(); 446aliasesOpt = mergedProperties.AliasesOpt?.ToImmutableAndFree() ?? default(ImmutableArray<string>); 447recursiveAliasesOpt = mergedProperties.RecursiveAliasesOpt?.ToImmutableAndFree() ?? default(ImmutableArray<string>); 451mergedReferences = mergedProperties.MergedReferencesOpt.ToImmutableAndFree(); 855referenceDirectiveLocations = referenceDirectiveLocationsBuilder?.ToImmutableAndFree() ?? ImmutableArray<Location>.Empty;
ReferenceManager\CommonReferenceManager.State.cs (1)
531aliasesOfReferencedAssemblies = aliasesOfReferencedAssembliesBuilder.ToImmutableAndFree();
ReferenceManager\MergedAliases.cs (1)
87return result.ToImmutableAndFree();
SourceFileResolver.cs (1)
82_pathMap = pathMapBuilder.ToImmutableAndFree();
SourceGeneration\AdditionalSourcesCollection.cs (1)
136internal ImmutableArray<GeneratedSourceText> ToImmutableAndFree() => _sourcesAdded.ToImmutableAndFree();
SourceGeneration\GeneratorDriver.cs (8)
113return FromState(_state.With(generators, incrementalGenerators, states.ToImmutableAndFree())); 203return sources.ToImmutableAndFree(); 259var outputNodes = outputBuilder.ToImmutableAndFree(); 260var inputNodes = inputBuilder.ToImmutableAndFree(); 309var syntaxStoreBuilder = _state.SyntaxStore.ToBuilder(compilation, syntaxInputNodes.ToImmutableAndFree(), _state.TrackIncrementalSteps, cancellationToken); 336state = state.With(stateTable: driverStateBuilder.ToImmutable(), syntaxStore: syntaxStoreBuilder.ToImmutable(), generatorStates: stateBuilder.ToImmutableAndFree(), runTime: timer.Elapsed); 378return trees.ToImmutableAndFree(); 437return filteredDiagnostics.ToImmutableAndFree();
SourceGeneration\GlobalAliases.cs (1)
47return Create(total.ToImmutableAndFree());
SourceGeneration\Nodes\BatchNode.cs (2)
52var sourceInputs = sourceInputsBuilder != null ? sourceInputsBuilder.ToImmutableAndFree() : default; 107return builder.ToImmutableAndFree();
SourceGeneration\Nodes\HostOutputNode.cs (1)
60nodeTable.AddEntry(output.ToImmutableAndFree(), EntryState.Added, stopwatch.Elapsed, inputs, EntryState.Added);
SourceGeneration\Nodes\NodeStateTable.cs (5)
172return new NodeStateTable<T>(compacted.ToImmutableAndFree(), ImmutableArray<IncrementalGeneratorRunStep>.Empty, hasTrackedSteps: false, isCached: true); 496stepOutputBuilder.ToImmutableAndFree(), 547finalStates = _states.ToImmutableAndFree(); 552TrackIncrementalSteps ? _steps.ToImmutableAndFree() : default, 767return new TableEntry(_items.ToOneOrManyAndFree(), _states?.ToImmutableAndFree() ?? GetSingleArray(_currentState.Value), anyRemoved: _anyRemoved);
SourceGeneration\Nodes\SyntaxValueProvider_ForAttributeWithMetadataName.cs (1)
154return result.ToImmutableAndFree();
SourceGeneration\Nodes\SyntaxValueProvider_ForAttributeWithSimpleName.cs (3)
92return GlobalAliases.Create(aliases.ToImmutableAndFree()); 121return GlobalAliases.Create(globalAliases.ToImmutableAndFree()); 190return results.ToImmutableAndFree();
src\Dependencies\CodeAnalysis.Debugging\CustomDebugInfoReader.cs (8)
136return builder.ToImmutableAndFree(); 198return builder.ToImmutableAndFree(); 294return builder.ToImmutableAndFree(); 310return builder.ToImmutableAndFree(); 327return new TupleElementNamesInfo(builder.ToImmutableAndFree(), slotIndex, localName, scopeStart, scopeEnd); 408externAliasStrings = externAliasBuilder.ToImmutableAndFree(); 464externAliasStrings = groupBuilder.ToImmutableAndFree(); 476return resultBuilder.ToImmutableAndFree();
src\Dependencies\PooledObjects\ArrayBuilder.cs (3)
380return tmp.ToImmutableAndFree(); 553dictionary.Add(pair.Key, pair.Value.ToImmutableAndFree()); 721return result.ToImmutableAndFree();
Syntax\LineDirectiveMap.cs (1)
164return entries.ToImmutableAndFree();
Text\LargeText.cs (1)
133return chunks.ToImmutableAndFree();
Text\LargeTextWriter.cs (1)
33return new LargeText(_chunks.ToImmutableAndFree(), _encoding, default(ImmutableArray<byte>), _checksumAlgorithm, default(ImmutableArray<byte>));
Text\TextChangeRangeExtensions.cs (1)
338return builder.ToImmutableAndFree();