X-Git-Url: http://plrg.eecs.uci.edu/git/?p=repair.git;a=blobdiff_plain;f=Repair%2FRepairCompiler%2FMCC%2FIR%2FStructureTypeDescriptor.java;h=32d38f567c278164078551576072b11b68c0ed8b;hp=222c6c1134fcb4d9eeeb25fe19791d39f4d51fb0;hb=a8d1f83099dff307e67a60a7e40074e22c1ed128;hpb=3c506efa4061b38ca6a709d69f04f315534ce634 diff --git a/Repair/RepairCompiler/MCC/IR/StructureTypeDescriptor.java b/Repair/RepairCompiler/MCC/IR/StructureTypeDescriptor.java index 222c6c1..32d38f5 100755 --- a/Repair/RepairCompiler/MCC/IR/StructureTypeDescriptor.java +++ b/Repair/RepairCompiler/MCC/IR/StructureTypeDescriptor.java @@ -15,9 +15,16 @@ public class StructureTypeDescriptor extends TypeDescriptor { Hashtable fields = new Hashtable(); /* fast lookups */ Vector fieldlist = new Vector(); /* ordering information */ Hashtable labels = new Hashtable(); + int idnum; + static int counter=0; + + public int getId() { + return idnum; + } public StructureTypeDescriptor(String name) { super(name); + idnum=counter++; } public TypeDescriptor getGenerateType() { @@ -34,7 +41,10 @@ public class StructureTypeDescriptor extends TypeDescriptor { } public Expr getOffsetExpr(FieldDescriptor field) { - + /* Fix sizeof calculations */ + if ((field==null)&&(subtype!=null)) + return subtype.getOFfsetExpr(field); + boolean aligned=true; Expr size = new IntegerLiteralExpr(0); @@ -117,11 +127,11 @@ public class StructureTypeDescriptor extends TypeDescriptor { labels.put(ld.getSymbol(), ld); } - public TypeDescriptor getSubType() { + public TypeDescriptor getSuperType() { return subtype; } - public void setSubType(TypeDescriptor td) { + public void setSuperType(TypeDescriptor td) { subtype = td; }