@Override public boolean equals(Object o) { if (!(o instanceof Edge)) { return false; } Edge edge = (Edge) o; return (edge != null && source.equals(edge.source) && target.equals(edge.target) && Objects.equal(guard, edge.guard)); }
/** Compute outgoing edges in the control flow graph. */ private void computeEdges() { for (Iterator it = iterator(); it.hasNext(); ) { BasicBlock b = (BasicBlock) it.next(); if (b.equals(exit())) { continue; } else if (b.equals(entry())) { BasicBlock bb0 = getBlockForInstruction(0); assert bb0 != null; addNormalEdge(b, bb0); } else { b.computeOutgoingEdges(); } } }
private void printAllRegions() { for (BasicBlock bb1 : cfg.getBasicBlocks()) { for (BasicBlock bb2 : cfg.getBasicBlocks()) { if (!bb1.equals(bb2) && getDomInfo().dominates(bb1, bb2)) { if (isRegion(bb1, bb2)) { LOGGER.debug("REGION {},{}", bb1, bb2); } } } } }
private void buildRegionTree(BasicBlock bb, RPSTRegion region) { while (bb.equals(region.exit)) { region = region.parent; } RPSTRegion newRegion = bb2region.get(bb); if (newRegion != null) { RPSTRegion topMostParent = getTopMostParent(newRegion); LOGGER.trace("Parent of region {} is {}", topMostParent, region); topMostParent.parent = region; region = newRegion; } else { LOGGER.trace("Parent of BB {} is {}", bb, region); bb2region.put(bb, region); } for (BasicBlock c : getDomInfo().getDominatorsTree().getChildren(bb)) { buildRegionTree(c, region); } }