public PointsToAbstractValue GetOrCreateDefaultValue(AnalysisEntity analysisEntity)
        {
            if (!_defaultPointsToValueMapBuilder.TryGetValue(analysisEntity, out PointsToAbstractValue value))
            {
                if (analysisEntity.SymbolOpt?.Kind == SymbolKind.Local ||
                    analysisEntity.SymbolOpt is IParameterSymbol parameter && parameter.RefKind == RefKind.Out ||
                    analysisEntity.CaptureIdOpt != null)
                {
                    return(PointsToAbstractValue.Undefined);
                }
                else if (!analysisEntity.Type.IsReferenceTypeOrNullableValueType())
                {
                    return(PointsToAbstractValue.NoLocation);
                }
                else if (analysisEntity.HasUnknownInstanceLocation)
                {
                    return(PointsToAbstractValue.Unknown);
                }

                value = PointsToAbstractValue.Create(AbstractLocation.CreateAnalysisEntityDefaultLocation(analysisEntity), mayBeNull: true);
                _trackedEntitiesBuilder.AddEntityAndPointsToValue(analysisEntity, value);
                _defaultPointsToValueMapBuilder.Add(analysisEntity, value);
            }
 public void AddTrackedPointsToValue(PointsToAbstractValue value)
 => PointsToValues.Add(value);
 public bool IsTrackedPointsToValue(PointsToAbstractValue value)
 => PointsToValues.Contains(value);
示例#4
0
 public void AddEntityAndPointsToValue(AnalysisEntity analysisEntity, PointsToAbstractValue value)
 {
     AllEntities.Add(analysisEntity);
     AddTrackedPointsToValue(value);
 }