Ejemplo n.º 1
0
        public void PreventLoopMerging(IStatement mutated, IStatement affected, ICollection <IVariableDeclaration> loopVars)
        {
            int source = indexOf[mutated];
            int target = indexOf[affected];

            if (!graph.TryGetEdge(source, target, out int edge))
            {
                edge = graph.AddEdge(source, target);
                prohibitedLoopVars[edge] = loopVars;
            }
            else
            {
                ICollection <IVariableDeclaration> list = prohibitedLoopVars[edge];
                if (list == null)
                {
                    list = new Set <IVariableDeclaration>(ReferenceEqualityComparer <IVariableDeclaration> .Instance);
                    prohibitedLoopVars[edge] = list;
                }
                list.AddRange(loopVars);
            }
        }