public SimpleAnalysis(ControlFlowGraph.ControlFlowGraph entryCFG, Weverca.MemoryModels.MemoryModelFactory memoryModel, EnvironmentInitializer initializer) : base(entryCFG, memoryModel.CreateSnapshot) { _flowResolver = new SimpleFlowResolver(); _functionResolver = new SimpleFunctionResolver(initializer); initializer(EntryInput); }
/// <summary> /// Resolve return value from all possible calls /// </summary> /// <param name="calls">All calls on dispatch level, which return value is resolved</param> /// <returns>Resolved return value</returns> public override MemoryEntry ResolveReturnValue(IEnumerable <ExtensionPoint> calls) { var returnValues = new HashSet <Value>(); foreach (var call in calls) { var returnEntry = SimpleFunctionResolver.GetReturn(call.Graph.End.OutSet); if (returnEntry == null) { returnValues.Add(OutSet.UndefinedValue); } else { returnValues.UnionWith(returnEntry.PossibleValues); } } return(new MemoryEntry(returnValues)); }