Bug fix of inner class: only add LIVE local variables that are referred to in an...
[IRC.git] / Robust / src / IR / ClassDescriptor.java
index 43923d0cff3830e103b83e33840300a2232723a0..00a2e45cd732f42081ec1846cab384f2606affe1 100644 (file)
@@ -19,7 +19,6 @@ public class ClassDescriptor extends Descriptor {
   SymbolTable flags;
   SymbolTable methods;
   boolean inline=false;
-  
 
   ChainHashMap mandatoryImports;
   ChainHashMap multiImports;
@@ -37,7 +36,11 @@ public class ClassDescriptor extends Descriptor {
 
   // inner classes/enum can have these
   String surroundingclass=null;
-  ClassDescriptor surroudingdesc=null;
+  //adding another variable to indicate depth of this inner class 
+  int innerDepth = 0;
+  ClassDescriptor surroundingdesc=null;
+  SymbolTable surroundingNameTable = null;
+
   SymbolTable innerdescs;
 
   // for enum type
@@ -338,6 +341,14 @@ public class ClassDescriptor extends Descriptor {
   public void setAsInnerClass() {
     this.isInnerClass = true;
   }
+  //Will have to call this whenever we are adding the this$ member, ideally should have used a single entrance to add the field. so that entrance could be used to set this flag.
+  public void setInnerDepth( int theDepth ) {
+       innerDepth = theDepth;
+  }
+
+  public int getInnerDepth() {
+       return innerDepth;
+  }
 
   public boolean isInnerClass() {
     return this.isInnerClass;
@@ -352,11 +363,11 @@ public class ClassDescriptor extends Descriptor {
   }
 
   public ClassDescriptor getSurroundingDesc() {
-    return this.surroudingdesc;
+    return this.surroundingdesc;
   }
 
   public void setSurrounding(ClassDescriptor scd) {
-    this.surroudingdesc=scd;
+    this.surroundingdesc=scd;
   }
 
   public void addInnerClass(ClassDescriptor icd) {
@@ -459,4 +470,12 @@ public class ClassDescriptor extends Descriptor {
       return otherClassname;
     }
   }
+  
+  public void setSurroundingNameTable(SymbolTable nametable) {
+    this.surroundingNameTable = nametable;
+  }
+  
+  public SymbolTable getSurroundingNameTable() {
+    return this.surroundingNameTable;
+  }
 }