|
|
@@ -2,7 +2,6 @@ open Printf
|
|
|
open Str
|
|
|
open Lexing
|
|
|
open Types
|
|
|
-open Globals
|
|
|
|
|
|
(** Empty location, use when node location is unkown or irrelevant. *)
|
|
|
let noloc = ("", 0, 0, 0, 0)
|
|
|
@@ -19,13 +18,13 @@ let prt_line = prerr_endline
|
|
|
let prt_node node = prt_line (Stringify.node2str node)
|
|
|
|
|
|
let log_plain_line verbosity line =
|
|
|
- if args.verbose >= verbosity then prt_line line
|
|
|
+ if Globals.args.verbose >= verbosity then prt_line line
|
|
|
|
|
|
let log_line verbosity line =
|
|
|
log_plain_line verbosity (repeat " " 13 ^ line)
|
|
|
|
|
|
let log_node verbosity node =
|
|
|
- if args.verbose >= verbosity then prt_node node
|
|
|
+ if Globals.args.verbose >= verbosity then prt_node node
|
|
|
|
|
|
(* Variable generation *)
|
|
|
let var_counter = ref 0
|
|
|
@@ -373,7 +372,7 @@ let prerr_loc (fname, ystart, yend, xstart, xend) =
|
|
|
()
|
|
|
|
|
|
let prerr_loc_msg loc msg =
|
|
|
- if args.verbose >= 1 then begin
|
|
|
+ if Globals.args.verbose >= 1 then begin
|
|
|
let (fname, ystart, yend, xstart, xend) = loc in
|
|
|
if loc != noloc then begin
|
|
|
let line_s = if yend != ystart
|
|
|
@@ -388,7 +387,7 @@ let prerr_loc_msg loc msg =
|
|
|
end;
|
|
|
eprintf "%s\n" msg;
|
|
|
|
|
|
- if args.verbose >= 1 && loc != noloc then
|
|
|
+ if Globals.args.verbose >= 1 && loc != noloc then
|
|
|
try prerr_loc loc
|
|
|
with Sys_error _ -> ()
|
|
|
end;
|
|
|
@@ -439,7 +438,7 @@ let immediate_consts = [
|
|
|
]
|
|
|
|
|
|
let is_immediate_const const =
|
|
|
- if args.optimize then List.mem const immediate_consts else false
|
|
|
+ if Globals.args.optimize then List.mem const immediate_consts else false
|
|
|
|
|
|
let is_array node = match typeof node with
|
|
|
| ArrayDims _ | Array _ -> true
|