1 instantiation of PooledHashSet
Microsoft.CodeAnalysis.Workspaces (1)
src\Dependencies\PooledObjects\PooledHashSet.cs (1)
35pool = new ObjectPool<PooledHashSet<T>>(() => new PooledHashSet<T>(pool!, equalityComparer), 128);
156 references to PooledHashSet
Microsoft.CodeAnalysis.Workspaces (156)
Diagnostics\SkippedHostAnalyzersInfo.cs (6)
53using var _1 = PooledHashSet<object>.GetInstance(out var projectAnalyzerIds); 54using var _2 = PooledHashSet<string>.GetInstance(out var projectAnalyzerDiagnosticIds); 55using var _3 = PooledHashSet<string>.GetInstance(out var projectSuppressedDiagnosticIds);
FindSymbols\FindReferences\DependentProjectsFinder.cs (4)
80using var _ = PooledHashSet<Project>.GetInstance(out var result); 170using var _ = PooledHashSet<(Project, bool hasInternalsAccess)>.GetInstance(out var dependentProjects);
FindSymbols\FindReferences\DependentTypeFinder.cs (7)
49private static readonly ObjectPool<PooledHashSet<INamedTypeSymbol>> s_symbolSetPool = PooledHashSet<INamedTypeSymbol>.CreatePool(SymbolEquivalenceComparer.Instance); 118using var _4 = PooledHashSet<PortableExecutableReference>.GetInstance(out var seenPEReferences); 562public static PooledDisposer<PooledHashSet<INamedTypeSymbol>> GetSymbolSet(out SymbolSet instance) 564var pooledInstance = s_symbolSetPool.Allocate(); 567return new PooledDisposer<PooledHashSet<INamedTypeSymbol>>(pooledInstance);
FindSymbols\FindReferences\Finders\ExplicitConversionSymbolReferenceFinder.cs (2)
49using var _ = PooledHashSet<Document>.GetInstance(out var result);
FindSymbols\FindReferences\FindReferencesSearchEngine.cs (12)
219using var _1 = PooledDictionary<ISymbol, PooledHashSet<string>>.GetInstance(out var symbolToGlobalAliases); 224using var _3 = PooledHashSet<Document>.GetInstance(out var foundDocuments); 270private static PooledHashSet<U>? TryGet<T, U>(Dictionary<T, PooledHashSet<U>> dictionary, T key) where T : notnull 271=> dictionary.TryGetValue(key, out var set) ? set : null; 276Dictionary<ISymbol, PooledHashSet<string>> symbolToGlobalAliases, 345PooledDictionary<ISymbol, PooledHashSet<string>> symbolToGlobalAliases, 360private static PooledHashSet<string> GetGlobalAliasesSet<T>(PooledDictionary<T, PooledHashSet<string>> dictionary, T key) where T : notnull 361=> dictionary.GetOrAdd(key, static _ => PooledHashSet<string>.GetInstance()); 363private static void FreeGlobalAliases(PooledDictionary<ISymbol, PooledHashSet<string>> symbolToGlobalAliases)
FindSymbols\FindReferences\FindReferencesSearchEngine_FindReferencesInDocuments.cs (2)
77using var _ = PooledDictionary<ISymbol, PooledHashSet<string>>.GetInstance(out var symbolToGlobalAliases); 102PooledDictionary<ISymbol, PooledHashSet<string>> symbolToGlobalAliases)
FindSymbols\SymbolTree\SymbolTreeInfo_Source.cs (2)
161using var _ = PooledHashSet<string>.GetInstance(out var seenNames);
src\Compilers\Core\Portable\Collections\ImmutableArrayExtensions.cs (4)
1059var set = PooledHashSet<T>.GetInstance(); 1392var set = PooledHashSet<TElement>.GetInstance();
src\Dependencies\PooledObjects\ArrayBuilder.cs (4)
668var set = PooledHashSet<T>.GetInstance(); 709var set = PooledHashSet<S>.GetInstance();
src\Dependencies\PooledObjects\PooledHashSet.cs (8)
14private readonly ObjectPool<PooledHashSet<T>> _pool; 16private PooledHashSet(ObjectPool<PooledHashSet<T>> pool, IEqualityComparer<T> equalityComparer) : 29private static readonly ObjectPool<PooledHashSet<T>> s_poolInstance = CreatePool(EqualityComparer<T>.Default); 32public static ObjectPool<PooledHashSet<T>> CreatePool(IEqualityComparer<T> equalityComparer) 34ObjectPool<PooledHashSet<T>>? pool = null; 35pool = new ObjectPool<PooledHashSet<T>>(() => new PooledHashSet<T>(pool!, equalityComparer), 128); 39public static PooledHashSet<T> GetInstance() 41var instance = s_poolInstance.Allocate();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamedTypeSymbolExtensions.cs (2)
452using var _ = PooledHashSet<string>.GetInstance(out var seenNames);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (4)
183using var _ = PooledHashSet<SyntaxNode>.GetInstance(out var set); 215using var _2 = PooledHashSet<SyntaxNode>.GetInstance(out var commonAncestorsSet);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\CustomDataFlowAnalysis.cs (5)
35var dispatchedExceptionsFromRegions = PooledHashSet<ControlFlowRegion>.GetInstance(); 76PooledHashSet<ControlFlowRegion> dispatchedExceptionsFromRegions, 85var processedBlocks = PooledHashSet<BasicBlock>.GetInstance();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\LValueFlowCaptureProvider.cs (2)
50var rvalueFlowCaptureIds = PooledHashSet<CaptureId>.GetInstance();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.AnalysisData.cs (4)
35private readonly PooledHashSet<ISymbol> _referenceTakenSymbolsBuilder; 40_referenceTakenSymbolsBuilder = PooledHashSet<ISymbol>.GetInstance(); 66protected abstract PooledHashSet<ISymbol> SymbolsReadBuilder { get; } 72protected abstract PooledHashSet<IMethodSymbol> LambdaOrLocalFunctionsBeingAnalyzed { get; }
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.BasicBlockAnalysisData.cs (10)
30private readonly Dictionary<ISymbol, PooledHashSet<IOperation>> _reachingWrites; 45foreach (var value in _reachingWrites.Values) 66if (_reachingWrites.TryGetValue(symbol, out var value)) 90if (_reachingWrites.TryGetValue(symbol, out var values)) 108if (!_reachingWrites.TryGetValue(symbol, out var values)) 110values = PooledHashSet<IOperation>.GetInstance(); 141var writes2 = other._reachingWrites[symbol]; 225private static void AddEntries(Dictionary<ISymbol, PooledHashSet<IOperation>> result, BasicBlockAnalysisData source) 231if (!result.TryGetValue(symbol, out var values)) 233values = PooledHashSet<IOperation>.GetInstance();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (35)
41private readonly PooledDictionary<CaptureId, PooledHashSet<(ISymbol, IOperation)>> _lValueFlowCapturesMap; 48private readonly PooledDictionary<IOperation, PooledHashSet<IOperation>> _reachingDelegateCreationTargets; 69private readonly PooledDictionary<(int firstBlockOrdinal, int lastBlockOrdinal), PooledHashSet<(ISymbol, IOperation)>> _symbolWritesInsideBlockRangeMap; 78PooledHashSet<ISymbol> symbolsRead, 79PooledHashSet<IMethodSymbol> lambdaOrLocalFunctionsBeingAnalyzed, 81PooledDictionary<IOperation, PooledHashSet<IOperation>> reachingDelegateCreationTargets, 99_lValueFlowCapturesMap = PooledDictionary<CaptureId, PooledHashSet<(ISymbol, IOperation)>>.GetInstance(); 103_symbolWritesInsideBlockRangeMap = PooledDictionary<(int firstBlockOrdinal, int lastBlockOrdinal), PooledHashSet<(ISymbol, IOperation)>>.GetInstance(); 108protected override PooledHashSet<ISymbol> SymbolsReadBuilder { get; } 112protected override PooledHashSet<IMethodSymbol> LambdaOrLocalFunctionsBeingAnalyzed { get; } 131symbolsRead: PooledHashSet<ISymbol>.GetInstance(), 132lambdaOrLocalFunctionsBeingAnalyzed: PooledHashSet<IMethodSymbol>.GetInstance(), 134reachingDelegateCreationTargets: PooledDictionary<IOperation, PooledHashSet<IOperation>>.GetInstance(), 189using var _ = PooledHashSet<ILocalSymbol>.GetInstance(out var builder); 216private PooledHashSet<(ISymbol, IOperation)> GetOrCreateSymbolWritesInBlockRange(int firstBlockOrdinal, int lastBlockOrdinal, CancellationToken cancellationToken) 218if (!_symbolWritesInsideBlockRangeMap.TryGetValue((firstBlockOrdinal, lastBlockOrdinal), out var writesInBlockRange)) 221var operations = PooledHashSet<IOperation>.GetInstance(); 225writesInBlockRange = PooledHashSet<(ISymbol, IOperation)>.GetInstance(); 242PooledHashSet<IOperation> operationsBuilder, 255_reachingDelegateCreationTargets.TryGetValue(invocation.Instance, out var targets)) 274void AddDescendantOperationsFromDelegateCreationTargets(PooledHashSet<IOperation> targets) 465if (!_lValueFlowCapturesMap.TryGetValue(captureId, out var captures)) 467captures = PooledHashSet<(ISymbol, IOperation)>.GetInstance(); 476if (_lValueFlowCapturesMap.TryGetValue(captureId, out var captures)) 523var targetsBuilder = PooledHashSet<IOperation>.GetInstance(); 534if (!arg.self._reachingDelegateCreationTargets.TryGetValue(symbolWrite, out var targetsBuilderForSymbolWrite)) 589var targetsBuilder = PooledHashSet<IOperation>.GetInstance(); 601if (_reachingDelegateCreationTargets.TryGetValue(write, out var targetsBuilder)) 630foreach (var creations in _reachingDelegateCreationTargets.Values) 651foreach (var captures in _lValueFlowCapturesMap.Values) 658foreach (var operations in _symbolWritesInsideBlockRangeMap.Values)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.OperationTreeAnalysisData.cs (6)
25PooledHashSet<ISymbol> symbolsRead, 26PooledHashSet<IMethodSymbol> lambdaOrLocalFunctionsBeingAnalyzed, 35protected override PooledHashSet<ISymbol> SymbolsReadBuilder { get; } 39protected override PooledHashSet<IMethodSymbol> LambdaOrLocalFunctionsBeingAnalyzed { get; } 47symbolsRead: PooledHashSet<ISymbol>.GetInstance(), 48lambdaOrLocalFunctionsBeingAnalyzed: PooledHashSet<IMethodSymbol>.GetInstance(),
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (8)
30private PooledDictionary<IAssignmentOperation, PooledHashSet<(ISymbol, IOperation)>> _pendingWritesMap; 59_pendingWritesMap = PooledDictionary<IAssignmentOperation, PooledHashSet<(ISymbol, IOperation)>>.GetInstance(); 81foreach (var pendingWrites in _pendingWritesMap.Values) 167var set = PooledHashSet<(ISymbol, IOperation)>.GetInstance(); 174if (!_pendingWritesMap.TryGetValue(deconstructionAssignment, out var set)) 176set = PooledHashSet<(ISymbol, IOperation)>.GetInstance(); 189if (_pendingWritesMap.TryGetValue(operation, out var pendingWrites))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\PooledHashSet.cs (3)
11public static PooledDisposer<PooledHashSet<T>> GetInstance(out PooledHashSet<T> instance) 14return new PooledDisposer<PooledHashSet<T>>(instance);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PooledBuilderExtensions.cs (2)
112using var _ = PooledHashSet<U>.GetInstance(out var set);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PublicContract.cs (4)
94using var _ = PooledHashSet<T>.GetInstance(out var set); 124using var _ = PooledHashSet<T>.GetInstance(out var set);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (2)
77using var _ = PooledHashSet<INamespaceSymbol>.GetInstance(out var conflicts);
Workspace\ProjectSystem\FileWatchedPortableExecutableReferenceFactory.cs (2)
75using var _ = PooledHashSet<string>.GetInstance(out var referenceDirectories);
Workspace\Solution\SolutionCompilationState.cs (4)
330using var _ = PooledHashSet<ProjectId>.GetInstance(out var dependentProjects); 368using var _ = PooledHashSet<ProjectId>.GetInstance(out var dependentProjects);
Workspace\Solution\SolutionState.cs (4)
376using var _2 = PooledHashSet<ProjectId>.GetInstance(out var addedProjectIds); 437using var _ = PooledHashSet<ProjectId>.GetInstance(out var projectIdsSet);
Workspace\Solution\TextDocumentStates.cs (2)
161using var _ = PooledHashSet<DocumentId>.GetInstance(out var set);
Workspace\Workspace.cs (6)
297using var _1 = PooledHashSet<DocumentId>.GetInstance(out var changedDocumentIds); 1623using var _1 = PooledHashSet<DocumentId>.GetInstance(out var infoChangedDocumentIds); 1624using var _2 = PooledHashSet<Document>.GetInstance(out var infoChangedNewDocuments);