1 instantiation of PooledHashSet
Microsoft.CodeAnalysis.CodeStyle (1)
src\Dependencies\PooledObjects\PooledHashSet.cs (1)
35pool = new ObjectPool<PooledHashSet<T>>(() => new PooledHashSet<T>(pool!, equalityComparer), 128);
127 references to PooledHashSet
Microsoft.CodeAnalysis.CodeStyle (127)
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (8)
160using var _4 = PooledHashSet<string>.GetInstance(out var compilerDiagnosticIds); 179using var _8 = PooledHashSet<string>.GetInstance(out var idsToAnalyzeBuilder); 231PooledHashSet<string> compilerDiagnosticIds, 395PooledHashSet<string> compilerDiagnosticIds, 751using var _ = PooledHashSet<ISymbol>.GetInstance(out var processedPartialSymbols);
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (2)
466using var _1 = PooledHashSet<ISymbol>.GetInstance(out var symbolsReferencedInDocComments);
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (4)
470using var _ = PooledHashSet<SymbolUsageResult>.GetInstance(out var symbolUsageResultsBuilder); 481PooledHashSet<SymbolUsageResult> symbolUsageResultsBuilder, 699PooledHashSet<SymbolUsageResult> symbolUsageResultsBuilder,
src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (8)
275using var _ = PooledHashSet<IFieldSymbol>.GetInstance(out var set); 291using var _ = PooledHashSet<IFieldSymbol>.GetInstance(out var set); 544using var _1 = PooledHashSet<IFieldSymbol>.GetInstance(out var reportedFields); 545using var _2 = PooledHashSet<IPropertySymbol>.GetInstance(out var reportedProperties);
src\Analyzers\Core\Analyzers\UseConditionalExpression\ForAssignment\UseConditionalExpressionForAssignmentHelpers.cs (2)
97using var _1 = PooledHashSet<ILocalSymbol>.GetInstance(out var symbolsDeclaredInConditional);
src\Analyzers\Core\Analyzers\UseObjectInitializer\UseNamedMemberInitializerAnalyzer.cs (2)
74using var _1 = PooledHashSet<string>.GetInstance(out var seenNames);
src\Compilers\Core\Portable\Collections\ImmutableArrayExtensions.cs (4)
988var set = PooledHashSet<T>.GetInstance(); 1321var 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)
450using 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);