private static GlobalFlowStateDictionaryAnalysisValue CreateAnalysisValue( IDeferredTypeEntity entity, IOperation parameterOrLocalReferenceOperation, GlobalFlowStateDictionaryAnalysisValue defaultValue, EnumerationCount enumerationCount) { var operationsSetBuilder = PooledHashSet <IOperation> .GetInstance(); operationsSetBuilder.Add(parameterOrLocalReferenceOperation); var newInvocationSet = new TrackingEnumerationSet( operationsSetBuilder.ToImmutableAndFree(), enumerationCount); var trackedEntitiesBuilder = PooledDictionary <IDeferredTypeEntity, TrackingEnumerationSet> .GetInstance(); trackedEntitiesBuilder.Add(entity, newInvocationSet); var analysisValue = new GlobalFlowStateDictionaryAnalysisValue( trackedEntitiesBuilder.ToImmutableDictionaryAndFree(), GlobalFlowStateDictionaryAnalysisValueKind.Known); return(defaultValue.Kind == GlobalFlowStateDictionaryAnalysisValueKind.Known ? GlobalFlowStateDictionaryAnalysisValue.Merge(analysisValue, defaultValue, false) : analysisValue); }
private GlobalFlowStateDictionaryAnalysisValue CreateAndUpdateAnalysisValue( IOperation parameterOrLocalOperation, IDeferredTypeEntity entity, GlobalFlowStateDictionaryAnalysisValue defaultValue, EnumerationCount enumerationCount) { var analysisValueForNewEntity = CreateAnalysisValue(entity, parameterOrLocalOperation, defaultValue, enumerationCount); UpdateGlobalValue(analysisValueForNewEntity); return(analysisValueForNewEntity); }