From 05ed5b46b079b1386ad50708ce7de00a8d9a32f0 Mon Sep 17 00:00:00 2001 From: bdemsky Date: Thu, 26 Feb 2004 22:51:10 +0000 Subject: [PATCH] Adding test case & bug fixes to generate code for test case... --- .../MCC/IR/RepairGenerator.java | 26 ++++++++++++------- Repair/RepairCompiler/MCC/IR/UpdateNode.java | 2 +- Repair/RepairCompiler/MCC/ex_test.cc | 17 ++++++++++++ 3 files changed, 35 insertions(+), 10 deletions(-) create mode 100755 Repair/RepairCompiler/MCC/ex_test.cc diff --git a/Repair/RepairCompiler/MCC/IR/RepairGenerator.java b/Repair/RepairCompiler/MCC/IR/RepairGenerator.java index c38860d..3251689 100755 --- a/Repair/RepairCompiler/MCC/IR/RepairGenerator.java +++ b/Repair/RepairCompiler/MCC/IR/RepairGenerator.java @@ -75,7 +75,7 @@ public class RepairGenerator { CodeWriter crhead = new StandardCodeWriter(this.outputhead); CodeWriter craux = new StandardCodeWriter(this.outputaux); crhead.outputline("};"); - craux.outputline("};"); + craux.outputline("}"); generate_updates(); } @@ -316,12 +316,6 @@ public class RepairGenerator { private void generate_teardown() { CodeWriter cr = new StandardCodeWriter(outputaux); - cr.outputline("if ("+repairtable.getSafeSymbol()+")"); - cr.outputline("delete "+repairtable.getSafeSymbol()+";"); - cr.outputline("if ("+oldmodel.getSafeSymbol()+")"); - cr.outputline("delete "+oldmodel.getSafeSymbol()+";"); - cr.outputline("delete "+newmodel.getSafeSymbol()+";"); - cr.outputline("delete "+worklist.getSafeSymbol()+";"); cr.endblock(); } @@ -471,6 +465,7 @@ public class RepairGenerator { cr2.outputline("exit(1);"); cr2.endblock(); // end block created for worklist + cr2.outputline(worklist.getSafeSymbol()+"->pop();"); cr2.endblock(); } @@ -542,8 +537,11 @@ public class RepairGenerator { VarDescriptor mincost=VarDescriptor.makeNew("mincost"); VarDescriptor mincostindex=VarDescriptor.makeNew("mincostindex"); DNFConstraint dnfconst=constraint.dnfconstraint; - cr.outputline("int "+mincostindex.getSafeSymbol()+";"); + if (dnfconst.size()<=1) { + cr.outputline("int "+mincostindex.getSafeSymbol()+"=0;"); + } if (dnfconst.size()>1) { + cr.outputline("int "+mincostindex.getSafeSymbol()+";"); boolean first=true; for(int j=0;jnext=0; + //head->prev=0; + +#include "ex.cc" + + +} -- 2.34.1