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)
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)