add Context.flush()
authoradam <adam@megacz.com>
Mon, 3 Nov 2008 10:15:38 +0000 (11:15 +0100)
committeradam <adam@megacz.com>
Mon, 3 Nov 2008 10:15:38 +0000 (11:15 +0100)
src/edu/berkeley/fleet/ir/Context.java

index 624ab5c..d26c0cb 100644 (file)
@@ -207,6 +207,13 @@ public class Context {
             flush_pending(true);
         }
 
+        /** [inboxes only], will fuse with previous instruction if it was a sendToken() */
+        public void flush() {
+            if (!dock.isInputDock()) throw new RuntimeException("flush() may only be used at input docks");
+            flush_pending();
+            instructions.add(new Instruction.Flush(dock, count!=1, predicate));
+        }
+
         /** [outboxes only], will fuse with previous instruction if it was a sendToken() */
         public void send(Destination dest) { send(dest, null); }
         public void send(Destination dest, BitVector signal) {