95 references to GetInstance
Microsoft.CodeAnalysis (95)
CodeGen\ArrayMembers.cs (2)
200var parameters = ArrayBuilder<ArrayMethodParameterInfo>.GetInstance(rank + 1); 308var parameters = ArrayBuilder<ArrayMethodParameterInfo>.GetInstance(rank);
CodeGen\PrivateImplementationDetails.cs (1)
155ArrayBuilder<SynthesizedStaticField> fieldsBuilder = ArrayBuilder<SynthesizedStaticField>.GetInstance(
Collections\ArrayBuilderExtensions.cs (3)
91var builder = ArrayBuilder<TResult>.GetInstance(items.Count); 131var builder = ArrayBuilder<TResult>.GetInstance(items.Count); 171var builder = ArrayBuilder<TResult>.GetInstance(items.Count);
Collections\ImmutableArrayExtensions.cs (4)
191var builder = ArrayBuilder<TResult>.GetInstance(items.Length); 524var builder = ArrayBuilder<TResult>.GetInstance(self.Length); 1159arrayBuilder = ArrayBuilder<T>.GetInstance(capacity: 2); 1253var builder = ArrayBuilder<TNamedTypeSymbol>.GetInstance(count);
Collections\OrderPreservingMultiDictionary.cs (1)
321arrayBuilder = ArrayBuilder<V>.GetInstance(capacity: 2);
Collections\TemporaryArray`1.cs (1)
98_builder = ArrayBuilder<T>.GetInstance(capacity)
CommandLine\AnalyzerConfigSet.cs (3)
128var sortedAnalyzerConfigs = ArrayBuilder<AnalyzerConfig>.GetInstance(analyzerConfigs.Count); 141var allMatchers = ArrayBuilder<ImmutableArray<SectionNameMatcher?>>.GetInstance(_analyzerConfigs.Length); 147var builder = ArrayBuilder<SectionNameMatcher?>.GetInstance(config.NamedSections.Length);
CommandLine\CommonCompiler.cs (3)
301var configs = ArrayBuilder<AnalyzerConfig>.GetInstance(analyzerConfigPaths.Length); 1155var analyzerOptionsBuilder = hasAnalyzerConfigs ? ArrayBuilder<AnalyzerConfigOptionsResult>.GetInstance(generatedSyntaxTrees.Count) : null; 1156var embeddedTextBuilder = ArrayBuilder<EmbeddedText>.GetInstance(generatedSyntaxTrees.Count);
CommandLine\SarifV2ErrorLogger.cs (1)
232var effectiveSeveritiesBuilder = ArrayBuilder<(string DescriptorId, int DescriptorIndex, ImmutableHashSet<ReportDiagnostic> EffectiveSeverities)>.GetInstance(_descriptors.Count);
DiagnosticAnalyzer\AnalyzerDriver.cs (2)
1065var builder = ArrayBuilder<Diagnostic>.GetInstance(reportedDiagnostics.Length); 2629var filteredNodesToAnalyze = ArrayBuilder<SyntaxNode>.GetInstance(nodesToAnalyze.Count);
DiagnosticAnalyzer\AnalyzerFileReference.cs (1)
656var builder = ArrayBuilder<string>.GetInstance(source.Count);
DiagnosticAnalyzer\CompilerDiagnosticAnalyzer.cs (1)
30var builder = ArrayBuilder<DiagnosticDescriptor>.GetInstance(errorCodes.Length);
Emit\EditAndContinue\DefinitionMap.cs (1)
467var builder = ArrayBuilder<DebugId>.GetInstance(lambda.Parameters.Length);
InternalUtilities\EnumerableExtensions.cs (2)
446var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 459var builder = ArrayBuilder<TResult>.GetInstance(source.Count);
InternalUtilities\FileLockCheck.cs (1)
201var lockInfos = ArrayBuilder<(int, string)>.GetInstance((int)pnProcInfo);
MetadataReader\MetadataDecoder.cs (5)
266var builder = ArrayBuilder<int>.GetInstance(countOfSizes); 402var argumentsBuilder = ArrayBuilder<KeyValuePair<TypeSymbol, ImmutableArray<ModifierInfo<TypeSymbol>>>>.GetInstance(argumentCount); 403var argumentRefersToNoPiaLocalTypeBuilder = ArrayBuilder<bool>.GetInstance(argumentCount); 864var locals = ArrayBuilder<LocalInfo<TypeSymbol>>.GetInstance(localCount); 865var offsets = ArrayBuilder<int>.GetInstance(localCount);
MetadataReader\MetadataHelpers.cs (1)
628var result = ArrayBuilder<T>.GetInstance(dots + 1);
MetadataReader\MetadataReaderExtensions.cs (1)
64var result = ArrayBuilder<AssemblyIdentity>.GetInstance(reader.AssemblyReferences.Count);
MetadataReader\PEAssembly.cs (2)
67var refCounts = ArrayBuilder<int>.GetInstance(modules.Length); 69var refs = ArrayBuilder<AssemblyIdentity>.GetInstance(totalRefCount);
MetadataReader\PEModule.cs (6)
1653var result = ArrayBuilder<string>.GetInstance(attrInfos.Count); 1693var whenTrue = ArrayBuilder<string>.GetInstance(attrInfos.Count); 1694var whenFalse = ArrayBuilder<string>.GetInstance(attrInfos.Count); 1733var result = ArrayBuilder<string>.GetInstance(attrInfos.Count); 2428var boolArrayBuilder = ArrayBuilder<bool>.GetInstance((int)arrayLen); 2457var byteArrayBuilder = ArrayBuilder<byte>.GetInstance((int)arrayLen);
MetadataReader\TypeNameDecoder.cs (2)
224var typeArgumentsBuilder = ArrayBuilder<KeyValuePair<TypeSymbol, ImmutableArray<ModifierInfo<TypeSymbol>>>>.GetInstance(count); 225var refersToNoPiaBuilder = ArrayBuilder<bool>.GetInstance(count);
MetadataReference\AssemblyIdentity.cs (1)
441var result = ArrayBuilder<byte>.GetInstance(PublicKeyTokenSize);
MetadataReference\AssemblyIdentity.DisplayName.cs (1)
708var bytes = ArrayBuilder<byte>.GetInstance(length);
Operations\ControlFlowGraphBuilder.BasicBlockBuilder.cs (1)
238var branches = ArrayBuilder<ControlFlowBranch>.GetInstance(_predecessors?.Count ?? 2);
Operations\ControlFlowGraphBuilder.cs (10)
174var builder = ArrayBuilder<BasicBlock>.GetInstance(blockBuilders.Count); 2007var builder = ArrayBuilder<T>.GetInstance(numElements); 3969var resourceQueue = ArrayBuilder<(IVariableDeclarationOperation, IVariableDeclaratorOperation)>.GetInstance(declarationGroup.Declarations.Length); 6386var initializerBuilder = ArrayBuilder<IOperation>.GetInstance(operation.Initializers.Length); 6519var builder = ArrayBuilder<IOperation>.GetInstance(initializer.ElementValues.Length); 6697var elementBuilder = ArrayBuilder<IOperation>.GetInstance(numElements); 7045var partsBuilder = ArrayBuilder<IInterpolatedStringContentOperation>.GetInstance(operation.Parts.Length); 7247var builder = ArrayBuilder<IArgumentOperation>.GetInstance(propertySymbol.Parameters.Length); 7818ArrayBuilder<IOperation> statementsBuilder = ArrayBuilder<IOperation>.GetInstance(statements.Length); 7976var initializerBuilder = ArrayBuilder<IOperation>.GetInstance(initializers.Length);
Operations\ControlFlowGraphBuilder.RegionBuilder.cs (1)
321var builder = ArrayBuilder<ControlFlowRegion>.GetInstance(Regions.Count);
Operations\IOperation.OperationList.cs (1)
47var builder = ArrayBuilder<IOperation>.GetInstance(Count);
Operations\IOperation.OperationList.Reversed.cs (2)
50var builder = ArrayBuilder<IOperation>.GetInstance(Count); 60var builder = ArrayBuilder<IOperation>.GetInstance(input.Length);
PEWriter\ExtendedPEBuilder.cs (1)
57var builder = ArrayBuilder<Section>.GetInstance(baseSections.Length + 1);
PEWriter\MetadataWriter.cs (2)
605builder = ArrayBuilder<IParameterDefinition>.GetInstance(parameters.Length + 1); 629builder = ArrayBuilder<IParameterDefinition>.GetInstance(parameters.Length);
ReferenceManager\AssemblyDataForAssemblyBeingBuilt.cs (1)
40var refs = ArrayBuilder<AssemblyIdentity>.GetInstance(builderSize);
ReferenceManager\CommonReferenceManager.Binding.cs (3)
445var result = ArrayBuilder<int>.GetInstance(modules.Length); 465var result = ArrayBuilder<ResolvedReference>.GetInstance(references.Length); 480var bindingsOfAssemblyBeingBuilt = ArrayBuilder<AssemblyReferenceBinding>.GetInstance(referenceBindingsOfAssemblyBeingBuilt.Length + implicitAssemblies.Count);
ReferenceManager\CommonReferenceManager.State.cs (1)
474var aliasesOfReferencedAssembliesBuilder = ArrayBuilder<ImmutableArray<string>>.GetInstance(referenceMap.Length - referencedModuleCount);
ReferenceManager\MergedAliases.cs (1)
84var result = ArrayBuilder<string>.GetInstance(aliasesOpt.Length);
SourceFileResolver.cs (1)
62var pathMapBuilder = ArrayBuilder<KeyValuePair<string, string>>.GetInstance(pathMap.Length);
SourceGeneration\GeneratorDriver.cs (4)
97var states = ArrayBuilder<GeneratorState>.GetInstance(generators.Length); 194ArrayBuilder<GeneratedSourceResult> sources = ArrayBuilder<GeneratedSourceResult>.GetInstance(generatorState.PostInitTrees.Length + generatorState.GeneratedTrees.Length); 224var stateBuilder = ArrayBuilder<GeneratorState>.GetInstance(state.Generators.Length); 371var trees = ArrayBuilder<GeneratedSyntaxTree>.GetInstance(generatedSources.Length);
SourceGeneration\GlobalAliases.cs (1)
42var total = ArrayBuilder<(string aliasName, string symbolName)>.GetInstance(aliasesArray.Sum(a => a.AliasAndSymbolNames.Length));
SourceGeneration\Nodes\BatchNode.cs (1)
97var builder = ArrayBuilder<TInput>.GetInstance(entryCount);
SourceGeneration\Nodes\NodeStateTable.cs (5)
160var compacted = ArrayBuilder<TableEntry>.GetInstance(nonRemovedCount); 256_states = ArrayBuilder<TableEntry>.GetInstance(tableCapacity ?? previous.GetTotalEntryItemCount()); 485var stepOutputBuilder = ArrayBuilder<(object, IncrementalStepRunReason)>.GetInstance(outputInfo.Count); 730_items = ArrayBuilder<T>.GetInstance(capacity); 750_states = ArrayBuilder<EntryState>.GetInstance(_requestedCapacity);
SourceGeneration\SyntaxStore.cs (1)
62var syntaxInputBuilders = ArrayBuilder<(SyntaxInputNode node, ISyntaxInputBuilder builder)>.GetInstance(_syntaxInputNodes.Length);
src\Dependencies\CodeAnalysis.Debugging\CustomDebugInfoReader.cs (7)
130var builder = ArrayBuilder<short>.GetInstance(numCounts); 179var builder = ArrayBuilder<StateMachineHoistedLocalScope>.GetInstance(bucketCount); 245var flagsBuilder = ArrayBuilder<bool>.GetInstance(FlagBytesCount); 251var builder = ArrayBuilder<DynamicLocalInfo>.GetInstance(bucketCount); 304var builder = ArrayBuilder<TupleElementNamesInfo>.GetInstance(n); 316var builder = ArrayBuilder<string>.GetInstance(n); 422var resultBuilder = ArrayBuilder<ImmutableArray<string>>.GetInstance(groupSizes.Length);
src\Dependencies\PooledObjects\ArrayBuilder.cs (2)
374var tmp = ArrayBuilder<U>.GetInstance(Count); 708var result = ArrayBuilder<S>.GetInstance(Count);
Syntax\LineDirectiveMap.cs (1)
141var entries = ArrayBuilder<LineMappingEntry>.GetInstance(directives.Count + 1);
Text\LargeText.cs (1)
96var chunks = ArrayBuilder<char[]>.GetInstance(1 + maxCharRemainingGuess / ChunkSize);
Text\LargeTextWriter.cs (1)
26_chunks = ArrayBuilder<char[]>.GetInstance(1 + length / LargeText.ChunkSize);