fixed minor bugs
[cdsspec-compiler.git] / src / edu / uci / eecs / specCompiler / codeGenerator / SemanticsChecker.java
index 26647f60c973e875f1064550507cd1849c8796ac..60732306a12f2768f44109f57d4e9d1b49b1470d 100644 (file)
@@ -100,6 +100,21 @@ public class SemanticsChecker {
        public HashMap<ConditionalInterface, HashSet<ConditionalInterface>> getHBConditions() {
                return this.hbConditions;
        }
+       
+       /**
+        * Check if the conditional interface is in the HB checking list
+        * @param condInterface
+        * @return
+        */
+       public boolean containsConditionalInterface(ConditionalInterface condInterface) {
+               if (hbConditions.containsKey(condInterface))
+                       return true;
+               for (ConditionalInterface key : hbConditions.keySet()) {
+                       if (hbConditions.get(key).contains(condInterface))
+                               return true;
+               }
+               return false;
+       }
 
        public String getOption(String key) {
                return options.get(key);
@@ -121,12 +136,6 @@ public class SemanticsChecker {
                                                + label + "!");
                        }
 
-                       // No HB condition label can duplicate!
-                       if (hbLabel2Num.containsKey(label)) {
-                               throw new SemanticsCheckerException("Happens-before label: "
-                                               + label + " duplicates!");
-                       }
-
                        // Number the HB-condition label
                        hbLabel2Num.put(label, _hbLabelNum++);
                }