Jelajahi Sumber

Removed 'open Globals' and used 'Globals.args' instead

Taddeus Kroes 12 tahun lalu
induk
melakukan
d2ac2ab8ea

+ 0 - 1
phases/assemble.ml

@@ -2,7 +2,6 @@ open Printf
 open Types
 open Util
 open Stringify
-open Globals
 
 let comline comment = InlineComment (EmptyLine, comment)
 

+ 0 - 1
phases/boolop.ml

@@ -18,7 +18,6 @@
  *)
 open Types
 open Util
-open Globals
 
 let cast ctype node = TypeCast (ctype, node, [Type ctype])
 

+ 0 - 1
phases/constprop.ml

@@ -17,7 +17,6 @@
  *)
 open Types
 open Util
-open Globals
 
 let is_const_name name =
   Str.string_match (Str.regexp "^.+\\$\\$[0-9]+$") name 0

+ 0 - 1
phases/context.ml

@@ -1,7 +1,6 @@
 open Printf
 open Types
 open Util
-open Globals
 
 type nametype = Varname of string | Funcname of string
 

+ 0 - 1
phases/desug.ml

@@ -1,7 +1,6 @@
 open Printf
 open Types
 open Util
-open Globals
 
 (* Create new constant variables for all assigned array values so that they are
  * only evaluated once *)

+ 0 - 1
phases/dimreduce.ml

@@ -1,6 +1,5 @@
 open Types
 open Util
-open Globals
 
 let rec expand_dims = function
   (* Flatten Block nodes returned by transformations below *)

+ 0 - 1
phases/extern.ml

@@ -1,6 +1,5 @@
 open Types
 open Util
-open Globals
 
 let create_param ctype name =
   let param = Param (ctype, name, [Depth 1]) in

+ 0 - 1
phases/index.ml

@@ -1,6 +1,5 @@
 open Types
 open Util
-open Globals
 
 let tag_index program =
   let nglobs = ref 0 in

+ 4 - 5
phases/load.ml

@@ -1,6 +1,5 @@
 open Types
 open Util
-open Globals
 
 (* Unix command to call for C preprocessor:
  * -nostdinc    : don't include from C stdlib
@@ -32,15 +31,15 @@ let input_buffered ic chunksize =
 let phase = function
   | Empty ->
     let display_name =
-      match args.infile with
+      match Globals.args.infile with
       | Some filename -> filename
       | None -> "<stdin>"
     in
     let bufsize = 512 in
 
-    if args.cpp then
+    if Globals.args.cpp then
       let cpp_out =
-        match args.infile with
+        match Globals.args.infile with
         | Some filename ->
           Unix.open_process_in (cpp_cmd ^ " " ^ filename)
         | None ->
@@ -58,7 +57,7 @@ let phase = function
 
     else
       let content =
-        match args.infile with
+        match Globals.args.infile with
         | Some filename -> input_all (open_in filename)
         | None -> input_buffered stdin bufsize
       in

+ 2 - 3
phases/output.ml

@@ -1,16 +1,15 @@
 open Types
 open Util
-open Globals
 
 let phase = function
   | Assembly instrs ->
-    begin match args.outfile with
+    begin match Globals.args.outfile with
     | Some filename ->
       let oc = open_out filename in
       Print.print_assembly oc instrs;
       close_out oc
     | None ->
-      if args.verbose >= 1 then prerr_endline hline;
+      if Globals.args.verbose >= 1 then prerr_endline hline;
       Print.print_assembly stdout instrs
     end;
     Empty

+ 0 - 1
phases/parse.ml

@@ -1,7 +1,6 @@
 open Lexing
 open Types
 open Util
-open Globals
 
 let get_loc lexbuf =
   Util.loc_from_lexpos lexbuf.lex_curr_p lexbuf.lex_curr_p

+ 0 - 1
phases/peephole.ml

@@ -1,7 +1,6 @@
 open Printf
 open Types
 open Util
-open Globals
 
 let rec strip_comments = function
   | Comment _ :: tl -> strip_comments tl

+ 2 - 3
phases/print.ml

@@ -1,6 +1,5 @@
 open Types
 open Util
-open Globals
 open Stringify
 
 let tab = "  "
@@ -49,9 +48,9 @@ let rtn_suffix = function
 let rec instr2str = function
   (* Global / directives *)
   | Comment comment ->
-    if args.verbose >= 2 then "; " ^ comment else ""
+    if Globals.args.verbose >= 2 then "; " ^ comment else ""
   | InlineComment (instr, comment) ->
-    if args.verbose >= 2 then
+    if Globals.args.verbose >= 2 then
       expand max_instr_width (instr2str instr) ^ " ; " ^ comment
     else
       instr2str instr

+ 0 - 1
phases/typecheck.ml

@@ -17,7 +17,6 @@
 open Printf
 open Types
 open Util
-open Globals
 open Stringify
 
 let array_depth = function