changes: missing nodes in SC graph
authoryeom <yeom>
Tue, 30 Oct 2012 08:11:18 +0000 (08:11 +0000)
committeryeom <yeom>
Tue, 30 Oct 2012 08:11:18 +0000 (08:11 +0000)
Robust/src/Analysis/SSJava/BuildLattice.java

index 931e865..d1c631f 100644 (file)
@@ -81,6 +81,12 @@ public class BuildLattice {
 
       HNode higherNode = inputGraph.getHNode(higherName);
 
+      if (higherNode == null) {
+        NameDescriptor d = new NameDescriptor(higherName);
+        higherNode = inputGraph.getHNode(d);
+        higherNode.setSkeleton(true);
+      }
+
       if (higherNode != null && higherNode.isSharedNode()) {
         lattice.addSharedLoc(higherName);
       }
@@ -100,6 +106,16 @@ public class BuildLattice {
         String lowerName = generateElementName(basisSet, inputGraph, mapFToLocName, lower);
         HNode lowerNode = inputGraph.getHNode(lowerName);
 
+        if (lowerNode == null && !lowerName.equals(SSJavaAnalysis.BOTTOM)) {
+          NameDescriptor d = new NameDescriptor(lowerName);
+          lowerNode = inputGraph.getHNode(d);
+          lowerNode.setSkeleton(true);
+        }
+
+        if (lowerNode != null && !inputGraph.isDirectlyConnectedTo(higherNode, lowerNode)) {
+          inputGraph.addEdge(higherNode, lowerNode);
+        }
+
         if (lowerNode != null && lowerNode.isSharedNode()) {
           lattice.addSharedLoc(lowerName);
         }