X-Git-Url: http://plrg.eecs.uci.edu/git/?p=repair.git;a=blobdiff_plain;f=Repair%2FRepairCompiler%2FMCC%2FCLI.java;h=9f3badc6cc863b8d40739258e0257842bed1b154;hp=88847f6759863eff7466c97016b7bc9f61bea129;hb=b8ce029bda61ce5f768d8b1603f2ec1c9c7e2360;hpb=ad9c0159edd8dd9eed39eb8f74635c5bffb95ed5 diff --git a/Repair/RepairCompiler/MCC/CLI.java b/Repair/RepairCompiler/MCC/CLI.java index 88847f6..9f3badc 100755 --- a/Repair/RepairCompiler/MCC/CLI.java +++ b/Repair/RepairCompiler/MCC/CLI.java @@ -1,7 +1,7 @@ package MCC; -import java.util.Vector; -import java.util.StringTokenizer; +import java.util.*; +import MCC.IR.DebugItem; /** * A generic command-line interface for 6.035 compilers. This class @@ -11,7 +11,7 @@ import java.util.StringTokenizer; * files. * * @author le01, 6.035 Staff (6.035-staff@mit.edu) - * @version $Id: CLI.java,v 1.8 2004/05/31 14:19:10 bdemsky Exp $ + * @version $Id: CLI.java,v 1.19 2005/10/17 00:29:13 bdemsky Exp $ */ public class CLI { /** @@ -21,13 +21,13 @@ public class CLI { * should be performed. */ public boolean opts[]; - + /** * Vector of String containing the command-line arguments which could * not otherwise be parsed. */ public Vector extras; - + /** * Vector of String containing the optimizations which could not be * parsed. It is okay to complain about anything in this list, even @@ -39,7 +39,7 @@ public class CLI { * Name of the file to put the output in. */ public String outfile; - + /** * Name of the file to get input from. This is null if the user didn't * provide a file name. @@ -98,20 +98,62 @@ public class CLI { opts = new boolean[optnames.length]; + if (args.length==0) { + System.out.println("-debugcompiler -- print out debug messages"); + System.out.println("-depth depthnum constraintnum -- generate dependency graph from constraintnum with depth of depthnum"); + System.out.println("-depthconj depthnum constraintnum conjunctionnum -- generate dependency graph from constraintnum with depth of depthnum"); + System.out.println("-instrument -- generate instrumentation code"); + System.out.println("-aggressivesearch -- search for one repair per constraint"); + System.out.println("-prunequantifiernodes -- prune nodes that satisfy constraint by decreasing scope"); + System.out.println("-cplusplus -- properly set up c++ classes"); + System.out.println("-time -- generate timing code"); + System.out.println("-omitcomp -- omit compensation updates"); + System.out.println("-mergenodes -- omit nodes for simpler role dependence graphs"); + System.out.println("-debuggraph -- add edge labels and support to debug graph"); + System.out.println("-rejectlengthchanges -- reject all updates which change the length of an array"); + System.out.println("-printrepairs -- print log of repair actions"); + System.out.println("-exactallocation -- application calls malloc for each struct and"); + System.out.println(" allocates exactly the right amount of space."); + + System.exit(-1); + } + for (int i = 0; i < args.length; i++) { if (args[i].equals("-debugcompiler")) { context = 0; debug = true; } else if (args[i].equals("-checkonly")) { Compiler.REPAIR=false; + } else if (args[i].equals("-exactallocation")) { + Compiler.EXACTALLOCATION=true; + } else if (args[i].equals("-omitcomp")) { + Compiler.OMITCOMP=true; + } else if (args[i].equals("-debuggraph")) { + Compiler.DEBUGGRAPH=true; + } else if (args[i].equals("-mergenodes")) { + Compiler.MERGENODES=true; + } else if (args[i].equals("-printrepairs")) { + Compiler.PRINTREPAIRS=true; + } else if (args[i].equals("-depth")) { + Compiler.debuggraphs.add(new DebugItem(Integer.parseInt(args[i+1]),Integer.parseInt(args[i+2]))); + i+=2; + } else if (args[i].equals("-depthconj")) { + Compiler.debuggraphs.add(new DebugItem(Integer.parseInt(args[i+1]),Integer.parseInt(args[i+2]),Integer.parseInt(args[i+3]))); + i+=3; + } else if (args[i].equals("-rejectlengthchanges")) { + Compiler.REJECTLENGTH=true; } else if (args[i].equals("-debug")) { Compiler.GENERATEDEBUGHOOKS=true; + } else if (args[i].equals("-time")) { + Compiler.TIME=true; } else if (args[i].equals("-instrument")) { Compiler.GENERATEINSTRUMENT=true; } else if (args[i].equals("-aggressivesearch")) { 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++; @@ -155,7 +197,7 @@ public class CLI { int i = 0; while (infile == null && i < extras.size()) { String fn = (String) extras.elementAt(i); - + if (fn.charAt(0) != '-') { infile = fn;