public static void AnalyseMemoryRegions(AnalysisContext ac, EntryPoint ep) { if (SharedStateAnalyser.EntryPointMemoryRegions.ContainsKey(ep)) { return; } SharedStateAnalyser.EntryPointMemoryRegions.Add(ep, new List <Variable>()); SharedStateAnalyser.AnalyseMemoryRegions(ac, ep, ac.GetImplementation(ep.Name)); }
private static void AnalyseMemoryRegionsInAssign(AnalysisContext ac, EntryPoint ep, AssignCmd cmd) { foreach (var rhs in cmd.Rhss) { if (!(rhs is IdentifierExpr)) { continue; } var impl = ac.GetImplementation((rhs as IdentifierExpr).Name); if (impl != null && Utilities.ShouldAccessFunction(impl.Name)) { SharedStateAnalyser.AnalyseMemoryRegions(ac, ep, impl); } } }
private static void AnalyseMemoryRegionsInCall(AnalysisContext ac, EntryPoint ep, CallCmd cmd) { var impl = ac.GetImplementation(cmd.callee); if (impl != null && Utilities.ShouldAccessFunction(impl.Name)) { SharedStateAnalyser.AnalyseMemoryRegions(ac, ep, impl); } foreach (var expr in cmd.Ins) { if (!(expr is IdentifierExpr)) { continue; } impl = ac.GetImplementation((expr as IdentifierExpr).Name); if (impl != null && Utilities.ShouldAccessFunction(impl.Name)) { SharedStateAnalyser.AnalyseMemoryRegions(ac, ep, impl); } } }