diff graal/GraalCompiler/src/com/sun/c1x/lir/LIRBlock.java @ 2779:93ec3f067420

Changed CriticalEdgeFinder to use LIRBlock.
author Thomas Wuerthinger <thomas@wuerthinger.net>
date Wed, 25 May 2011 11:04:59 +0200
parents 2ac7b30b7290
children 9bc0c2eb00d6
line wrap: on
line diff
--- a/graal/GraalCompiler/src/com/sun/c1x/lir/LIRBlock.java	Tue May 24 21:39:45 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/lir/LIRBlock.java	Wed May 25 11:04:59 2011 +0200
@@ -249,4 +249,20 @@
     public void setInstructions(List<Instruction> list) {
         instructions = list;
     }
+
+    public void substituteSuccessor(LIRBlock target, LIRBlock newSucc) {
+        for (int i = 0; i < successors.size(); ++i) {
+            if (successors.get(i) == target) {
+                successors.set(i, newSucc);
+            }
+        }
+    }
+
+    public void substitutePredecessor(LIRBlock source, LIRBlock newSucc) {
+        for (int i = 0; i < predecessors.size(); ++i) {
+            if (predecessors.get(i) == source) {
+                predecessors.set(i, newSucc);
+            }
+        }
+    }
 }