- desc=G.NoArg (fn () => Flag.set flag_verbose),
- help="verbose messages"},
- {short = "", long=["dump-ast"],
- desc=G.NoArg (fn () => Flag.set flag_ast),
- help="pretty print the AST"},
- {short = "", long=["dump-ir"],
- desc=G.NoArg (fn () => Flag.set flag_ir),
- help="pretty print the IR"},
- {short = "", long=["dump-assem"],
- desc=G.NoArg (fn () => Flag.set flag_assem),
- help="pretty print the assembly before register allocaction"}
- ]
+ desc=G.NoArg (fn () => Flag.set Flags.verbose),
+ help="verbose messages"},
+ {short = "a", long=["dump-ast"],
+ desc=G.NoArg (fn () => Flag.set Flags.ast),
+ help="pretty print the AST"},
+ {short = "i", long=["dump-ir"],
+ desc=G.NoArg (fn () => Flag.set Flags.ir),
+ help="pretty print the IR"},
+ {short = "l", long=["dump-liveness"],
+ desc=G.NoArg (fn () => Flag.set Flags.liveness),
+ help="pretty print the liveness results"},
+ {short = "s", long=["dump-assem"],
+ desc=G.NoArg (fn () => Flag.set Flags.assem),
+ help="pretty print the assembly before register allocaction"},
+ {short = "c", long=["dump-color"],
+ desc=G.NoArg (fn () => Flag.set Flags.color),
+ help="pretty print the allocated regs"},
+ {short = "", long=["safe"],
+ desc=G.NoArg (fn () => Flag.set Flags.safe),
+ help="enable memory-safety"},
+ {short = "", long=["unsafe"],
+ desc=G.NoArg (fn () => Flag.unset Flags.safe),
+ help="disable memory-safety"},
+ {short = "", long = ["disable-all"],
+ desc=G.NoArg (fn () => enabledopts := nil),
+ help="disable all optimizations"}
+ ] @
+ map
+ (fn (opt : Optimizer.optimization) =>
+ { short = "", long=["disable-" ^ (#shortname opt)],
+ desc = G.NoArg (* This is nasty. *)
+ (fn () => enabledopts := List.filter (fn x => (#shortname x) <> (#shortname opt)) (!enabledopts)),
+ help = "disable optimization: " ^ (#description opt) })
+ uniqopts