}
}
-
private void name_updates() {
int count=0;
for(Iterator it=termination.updatenodes.iterator();it.hasNext();) {
private void generate_stateobject() {
CodeWriter crhead = new StandardCodeWriter(outputhead);
+ CodeWriter craux = new StandardCodeWriter(outputaux);
crhead.outputline("struct "+name+"_state {");
Iterator globals=state.stGlobals.descriptors();
while (globals.hasNext()) {
crhead.outputline(vd.getType().getGenerateType().getSafeSymbol()+" "+vd.getSafeSymbol()+";");
}
crhead.outputline("};");
+ crhead.outputline("struct "+name+"_state * allocate"+name+"_state();");
+ craux.outputline("struct "+name+"_state * allocate"+name+"_state()");
+ craux.startblock();
+ craux.outputline("return (struct "+name+"_state *) malloc(sizeof(struct "+name+"_state));");
+ craux.endblock();
+
+ crhead.outputline("void free"+name+"_state(struct "+name+"_state *);");
+ craux.outputline("void free"+name+"_state(struct "+name+"_state * thisvar)");
+ craux.startblock();
+ craux.outputline("free(thisvar);");
+ craux.endblock();
+
crhead.outputline("void "+name+"_statecomputesizes(struct "+name+"_state * ,int *,int **);");
crhead.outputline("void "+name+"_staterecomputesizes(struct "+name+"_state *);");
}
}
}
}
- craux.outputline("struct "+ name+"* "+name+"()");
+ craux.outputline("struct "+ name+"* allocate"+name+"()");
craux.startblock();
craux.outputline("/* creating hashtables */");
craux.outputline(relation.getSafeSymbol() + "_hashinv = noargallocateSimpleHash();");
}
}
-
+ craux.outputline("return thisvar;");
craux.endblock();
crhead.outputline("};");
craux.outputline("void free"+name+"(struct "+ name +"* thisvar)");
crhead.outputline("void doanalysis(struct "+name+"_state *);");
craux.outputline("void doanalysis(struct "+name+"_state * thisvar)");
craux.startblock();
+ craux.outputline("int highmark;"); /* This declaration is special...need it to be first */
craux.startBuffer();
+
if (Compiler.TIME) {
craux.outputline("struct timeval _begin_time,_end_time;");
craux.outputline("gettimeofday(&_begin_time,NULL);");
craux.outputline("rebuildcount=0;");
craux.outputline("abstractcount=0;");
}
- craux.addDeclaration("int","highmark");
+
craux.addDeclaration("struct "+name+ " * ",oldmodel.getSafeSymbol());
craux.outputline(oldmodel.getSafeSymbol()+"=0;");