output.ml 395 B

1234567891011121314151617
  1. open Types
  2. open Util
  3. open Globals
  4. let phase = function
  5. | Assembly instrs ->
  6. begin match args.outfile with
  7. | Some filename ->
  8. let oc = open_out filename in
  9. Print.print_assembly oc instrs;
  10. close_out oc
  11. | None ->
  12. if args.verbose >= 1 then prerr_endline hline;
  13. Print.print_assembly stdout instrs
  14. end;
  15. Empty
  16. | _ -> raise (InvalidInput "output")