/** * Unify the points-to-sets for the variables identified by the set s * * @param s numbers of points-to-set variables * @throws IllegalArgumentException if s is null */ public void unify(IntSet s) { if (s == null) { throw new IllegalArgumentException("s is null"); } // cache the variables represented HashSet<PointsToSetVariable> cache = HashSetFactory.make(s.size()); for (IntIterator it = s.intIterator(); it.hasNext();) { int i = it.next(); cache.add(pointsToMap.getPointsToSet(i)); } // unify the variables pointsToMap.unify(s); int rep = pointsToMap.getRepresentative(s.intIterator().next()); // clean up the equations updateEquationsForUnification(cache, rep); // special logic to clean up side effects updateSideEffectsForUnification(cache, rep); }
/** * Unify the points-to-sets for the variables identified by the set s * * @param s numbers of points-to-set variables * @throws IllegalArgumentException if s is null */ public void unify(IntSet s) { if (s == null) { throw new IllegalArgumentException("s is null"); } // cache the variables represented HashSet<PointsToSetVariable> cache = HashSetFactory.make(s.size()); for (IntIterator it = s.intIterator(); it.hasNext();) { int i = it.next(); cache.add(pointsToMap.getPointsToSet(i)); } // unify the variables pointsToMap.unify(s); int rep = pointsToMap.getRepresentative(s.intIterator().next()); // clean up the equations updateEquationsForUnification(cache, rep); // special logic to clean up side effects updateSideEffectsForUnification(cache, rep); }
AssignEquation assign = (AssignEquation) as; PointsToSetVariable rhs = assign.getRightHandSide(); int rhsRep = pointsToMap.getRepresentative(pointsToMap.getIndex(rhs.getPointerKey())); if (rhsRep == rep) { flowGraph.removeStatement(as); AssignEquation assign = (AssignEquation) as; PointsToSetVariable lhs = assign.getLHS(); int lhsRep = pointsToMap.getRepresentative(pointsToMap.getIndex(lhs.getPointerKey())); if (lhsRep == rep) { flowGraph.removeStatement(as);
AssignEquation assign = (AssignEquation) as; PointsToSetVariable rhs = assign.getRightHandSide(); int rhsRep = pointsToMap.getRepresentative(pointsToMap.getIndex(rhs.getPointerKey())); if (rhsRep == rep) { flowGraph.removeStatement(as); AssignEquation assign = (AssignEquation) as; PointsToSetVariable lhs = assign.getLHS(); int lhsRep = pointsToMap.getRepresentative(pointsToMap.getIndex(lhs.getPointerKey())); if (lhsRep == rep) { flowGraph.removeStatement(as);