* files.
*
* @author le01, 6.035 Staff (<tt>6.035-staff@mit.edu</tt>)
- * @version <tt>$Id: CLI.java,v 1.10 2004/07/27 05:42:30 bdemsky Exp $</tt>
+ * @version <tt>$Id: CLI.java,v 1.11 2004/08/13 19:22:23 bdemsky Exp $</tt>
*/
public class CLI {
/**
System.out.println("-instrument -- generate instrumentation code");
System.out.println("-aggressivesearch");
System.out.println("-prunequantifiernodes");
+ System.out.println("-cplusplus");
System.exit(-1);
}
Compiler.AGGRESSIVESEARCH=true;
} else if (args[i].equals("-prunequantifiernodes")) {
Compiler.PRUNEQUANTIFIERS=true;
+ } else if (args[i].equals("-cplusplus")) {
+ Compiler.ALLOCATECPLUSPLUS=true;
} else if (args[i].equals("-verbose") || args[i].equals("-v")) {
context = 0;
verbose++;
public static boolean GENERATEDEBUGHOOKS=false;
public static boolean GENERATEDEBUGPRINT=false;
public static boolean GENERATEINSTRUMENT=false;
+ public static boolean ALLOCATECPLUSPLUS=false;
public static Vector debuggraphs=new Vector();
package MCC.IR;
import MCC.State;
+import MCC.Compiler;
public class Sources {
State state;
e.generate(cr, size);
cr.popSymbolTable();
cr.outputline(td.getGenerateType().getSafeSymbol()+" "+vd.getSafeSymbol()+"=("+td.getGenerateType().getSafeSymbol()+") malloc("+size.getSafeSymbol()+");");
+
+ if (Compiler.ALLOCATECPLUSPLUS) {
+ String vtable="_ZTV";
+ vtable+=sd.getType().getSafeSymbol().length();
+ vtable+=sd.getType().getSafeSymbol();
+ cr.outputline("((int**)"+vd.getSafeSymbol()+")[0] = (int *)"+vtable+"+2;");
+ }
}
public boolean relsetSource(RelationDescriptor rd, boolean domain) {
cr.popSymbolTable();
cr.outputline(td.getGenerateType().getSafeSymbol()+" "+vd.getSafeSymbol()+"=("+td.getGenerateType().getSafeSymbol()+") malloc("+size.getSafeSymbol()+");");
}
-
}