text
stringlengths
12
786k
let mk_dtypedtree f = " - dtypedtree " , Arg . Unit f , " ( undocumented ) " ; ;
let mk_drawlambda f = " - drawlambda " , Arg . Unit f , " ( undocumented ) " ; ;
let mk_dno_unique_ids f = " - dno - unique - ids " , Arg . Unit f , " ( undocumented ) " ; ;
let mk_dunique_ids f = " - dunique - ids " , Arg . Unit f , " ( undocumented ) " ; ;
let mk_dno_locations f = " - dno - locations " , Arg . Unit f , " ( undocumented ) " ; ;
let mk_dlocations f = " - dlocations " , Arg . Unit f , " ( undocumented ) " ; ;
let mk_dsource f = " - dsource " , Arg . Unit f , " ( undocumented ) " ; ;
let mk_dlambda f = " - dlambda " , Arg . Unit f , " ( undocumented ) " ; ;
let mk_drawclambda f = " - drawclambda " , Arg . Unit f , " ( undocumented ) " ; ;
let mk_dclambda f = " - dclambda " , Arg . Unit f , " ( undocumented ) " ; ;
let mk_dflambda f = " - dflambda " , Arg . Unit f , " Print Flambda ( 1 or 2 ) terms on exit from Flambda " ; ;
let mk_drawflambda f = " - drawflambda " , Arg . Unit f , " Print Flambda terms after closure conversion \ n \ \ ( for Flambda 2 , after [ Lambda_to_flambda ] ) " ; ;
let mk_dflambda_invariants f = " - dflambda - invariants " , Arg . Unit f , " Check Flambda ( 1 and 2 ) invariants " ; ;
let mk_dflambda_no_invariants f = " - dflambda - no - invariants " , Arg . Unit f , " Do not check Flambda ( 1 and 2 ) \ invariants " ; ;
let mk_dflambda_let f = " - dflambda - let " , Arg . Int f , " < stamp > Print when the given Flambda 1 [ Let ] \ is created " ; ;
let mk_dflambda_verbose f = " - dflambda - verbose " , Arg . Unit f , " Print Flambda 1 terms including around \ each pass " ; ;
let mk_dinstr f = " - dinstr " , Arg . Unit f , " ( undocumented ) " ; ;
let mk_dcamlprimc f = " - dcamlprimc " , Arg . Unit f , " ( undocumented ) " ; ;
let mk_dcmm_invariants f = " - dcmm - invariants " , Arg . Unit f , " Extra sanity checks on Cmm " ; ;
let mk_dcmm f = " - dcmm " , Arg . Unit f , " ( undocumented ) " ; ;
let mk_dsel f = " - dsel " , Arg . Unit f , " ( undocumented ) " ; ;
let mk_dcombine f = " - dcombine " , Arg . Unit f , " ( undocumented ) " ; ;
let mk_dcse f = " - dcse " , Arg . Unit f , " ( undocumented ) " ; ;
let mk_dlive f = " - dlive " , Arg . Unit f , " ( undocumented ) " ; ;
let mk_davail f = " - davail " , Arg . Unit f , " Print register availability info when printing \ liveness " ; ;
let mk_drunavail f = " - drunavail " , Arg . Unit f , " Run register availability pass ( for testing \ only ; needs - g ) " ; ;
let mk_dspill f = " - dspill " , Arg . Unit f , " ( undocumented ) " ; ;
let mk_dsplit f = " - dsplit " , Arg . Unit f , " ( undocumented ) " ; ;
let mk_dinterf f = " - dinterf " , Arg . Unit f , " ( undocumented ) " ; ;
let mk_dprefer f = " - dprefer " , Arg . Unit f , " ( undocumented ) " ; ;
let mk_dalloc f = " - dalloc " , Arg . Unit f , " ( undocumented ) " ; ;
let mk_dreload f = " - dreload " , Arg . Unit f , " ( undocumented ) " ; ;
let mk_dscheduling f = " - dscheduling " , Arg . Unit f , " ( undocumented ) " ; ;
let mk_dlinear f = " - dlinear " , Arg . Unit f , " ( undocumented ) " ; ;
let mk_dinterval f = " - dinterval " , Arg . Unit f , " ( undocumented ) " ; ;
let mk_dstartup f = " - dstartup " , Arg . Unit f , " ( undocumented ) " ; ;
let mk_opaque f = " - opaque " , Arg . Unit f , " Does not generate cross - module optimization information \ n \ \ ( reduces necessary recompilation on module change ) " ; ;
let mk_strict_formats f = " - strict - formats " , Arg . Unit f , " Reject invalid formats accepted by legacy implementations \ n \ \ ( Warning : Invalid formats may behave differently from \ n \ \ previous OCaml versions , and will become always - rejected \ n \ \ in future OCaml versions...
let mk_no_strict_formats f = " - no - strict - formats " , Arg . Unit f , " Accept invalid formats accepted by legacy implementations ( default ) \ n \ \ ( Warning : Invalid formats may behave differently from \ n \ \ previous OCaml versions , and will become always - rejected \ n \ \...
let mk_args f = " - args " , Arg . Expand f , " < file > Read additional newline - terminated command line arguments \ n \ \ from < file " > ; ;
let mk_args0 f = " - args0 " , Arg . Expand f , " < file > Read additional null character terminated command line arguments \ n \ from < file " > ; ;
let mk_afl_instrument f = " - afl - instrument " , Arg . Unit f , " Enable instrumentation for afl - fuzz " ; ;
let mk_afl_inst_ratio f = " - afl - inst - ratio " , Arg . Int f , " Configure percentage of branches instrumented \ n \ \ ( advanced , see afl - fuzz docs for AFL_INST_RATIO ) " ; ;
let mk__ f = " " , - Arg . String f , " < file > Treat < file > as a file name ( even if it starts with ` ' ) " - ; ;
module type Common_options = sig val _absname : unit -> unit val _alert : string -> unit val _I : string -> unit val _labels : unit -> unit val _alias_deps : unit -> unit val _no_alias_deps : unit -> unit val _app_funct : unit -> unit val _no_app_funct : unit -> unit val _disable_all_extensions...
module type Core_options = sig include Common_options val _nopervasives : unit -> unit val _unsafe : unit -> unit val _warn_error : string -> unit val _warn_help : unit -> unit val _dno_unique_ids : unit -> unit val _dunique_ids : unit -> unit val _dno_locations : unit -> unit val _dlocations : ...
module type Compiler_options = sig val _a : unit -> unit val _annot : unit -> unit val _binannot : unit -> unit val _c : unit -> unit val _cc : string -> unit val _cclib : string -> unit val _ccopt : string -> unit val _config : unit -> unit val _config_var : string -> unit val _for_pack :...
module type Toplevel_options = sig include Core_options val _init : string -> unit val _noinit : unit -> unit val _no_version : unit -> unit val _noprompt : unit -> unit val _nopromptcont : unit -> unit val _stdin : unit -> unit val _args : string -> string array val _args0 : string -> string a...
module type Bytecomp_options = sig include Core_options include Compiler_options val _compat_32 : unit -> unit val _custom : unit -> unit val _no_check_prims : unit -> unit val _dllib : string -> unit val _dllpath : string -> unit val _make_runtime : unit -> unit val _vmthread : unit -> unit val _...
module type Bytetop_options = sig include Toplevel_options val _dinstr : unit -> unit end ; ;
module type Optcommon_options = sig val _compact : unit -> unit val _inline : string -> unit val _inline_toplevel : string -> unit val _inlining_report : unit -> unit val _dump_pass : string -> unit val _inline_max_depth : string -> unit val _rounds : int -> unit val _inline_max_unroll : string ...
module type Optcomp_options = sig include Core_options include Compiler_options include Optcommon_options val _nodynlink : unit -> unit val _p : unit -> unit val _pp : string -> unit val _S : unit -> unit val _shared : unit -> unit val _afl_instrument : unit -> unit val _afl_inst_ratio : int -> un...
module type Opttop_options = sig include Toplevel_options include Optcommon_options val _verbose : unit -> unit val _S : unit -> unit end ; ;
module type Ocamldoc_options = sig include Common_options val _impl : string -> unit val _intf : string -> unit val _intf_suffix : string -> unit val _pp : string -> unit val _thread : unit -> unit val _v : unit -> unit val _verbose : unit -> unit val _vmthread : unit -> unit end
module type Arg_list = sig val list : ( string * Arg . spec * string ) list end ; ;
module Make_bytecomp_options ( F : Bytecomp_options ) = struct let list = [ mk_a F . _a ; mk_alert F . _alert ; mk_absname F . _absname ; mk_annot F . _annot ; mk_binannot F . _binannot ; mk_c F . _c ; mk_cc F . _cc ; mk_cclib F . _cclib ; mk_ccopt F . _ccopt ; mk_c...
module Make_bytetop_options ( F : Bytetop_options ) = struct let list = [ mk_absname F . _absname ; mk_alert F . _alert ; mk_I F . _I ; mk_init F . _init ; mk_labels F . _labels ; mk_alias_deps F . _alias_deps ; mk_no_alias_deps F . _no_alias_deps ; mk_app_funct F . _app_fu...
module Make_optcomp_options ( F : Optcomp_options ) = struct let list = [ mk_a F . _a ; mk_alert F . _alert ; mk_absname F . _absname ; mk_afl_instrument F . _afl_instrument ; mk_afl_inst_ratio F . _afl_inst_ratio ; mk_annot F . _annot ; mk_binannot F . _binannot ; mk_inline_...
module Make_opttop_options ( F : Opttop_options ) = struct let list = [ mk_absname F . _absname ; mk_alert F . _alert ; mk_compact F . _compact ; mk_I F . _I ; mk_init F . _init ; mk_inline F . _inline ; mk_inline_toplevel F . _inline_toplevel ; mk_inlining_report F . _inli...
module Make_ocamldoc_options ( F : Ocamldoc_options ) = struct let list = [ mk_absname F . _absname ; mk_alert F . _alert ; mk_I F . _I ; mk_impl F . _impl ; mk_intf F . _intf ; mk_intf_suffix F . _intf_suffix ; mk_intf_suffix_2 F . _intf_suffix ; mk_labels F . _labels ; ...
let options_with_command_line_syntax_inner r after_rest = let rec loop ~ name_opt ( spec : Arg . spec ) : Arg . spec = let option = match name_opt with | None -> ignore | Some name -> ( fun ( ) -> r := name :: ! r ) in let arg a = r := Filename . quote a :: ! r in let option_with_arg...
let options_with_command_line_syntax options r = let rest = ref false in List . map ( fun ( name , spec , doc ) -> ( name , options_with_command_line_syntax_inner r rest ~ name_opt ( : Some name ) spec , doc ) ) options
module Default = struct open Clflags let set r ( ) = r := true let clear r ( ) = r := false module Common = struct let _absname = set Clflags . absname let _alert = Warnings . parse_alert_option let _alias_deps = clear transparent_modules let _app_funct = set applicative_functors let _labels ...
type file_kind = ML | MLI ; ;
let load_path = ref ( [ ] : ( string * string array ) list )
let ml_synonyms = ref [ " . ml " ]
let mli_synonyms = ref [ " . mli " ]
let shared = ref false
let native_only = ref false
let bytecode_only = ref false
let raw_dependencies = ref false
let sort_files = ref false
let all_dependencies = ref false
let nocwd = ref false
let one_line = ref false
let files = ref ( [ ] : ( string * file_kind * String . Set . t * string list ) list )
let allow_approximation = ref false
let map_files = ref [ ]
let module_map = ref String . Map . empty
let debug = ref false
module Error_occurred : sig val set : unit -> unit val get : unit -> bool let error_occurred = ref false let get ( ) = ! error_occurred let set ( ) = error_occurred := true end
let fix_slash s = if Sys . os_type = " Unix " then s else begin String . map ( function ' ' \\ -> ' ' / | c -> c ) s end
let dirs = ref String . Map . empty
let readdir dir = try String . Map . find dir ! dirs with Not_found -> let contents = try Sys . readdir dir with Sys_error msg -> Format . fprintf Format . err_formatter " [ @ Bad - I option : % s ] . " @@ msg ; Error_occurred . set ( ) ; [ ] || in dirs := String . Map . ...
let add_to_list li s = li := s :: ! li
let add_to_load_path dir = try let dir = Misc . expand_directory Config . standard_library dir in let contents = readdir dir in add_to_list load_path ( dir , contents ) with Sys_error msg -> Format . fprintf Format . err_formatter " [ @ Bad - I option : % s ] . " @@ msg ; Error_occurr...
let add_to_synonym_list synonyms suffix = if ( String . length suffix ) > 1 && suffix . [ 0 ] = ' . ' then add_to_list synonyms suffix else begin Format . fprintf Format . err_formatter " [ @ Bad suffix : ' % s ' ] . " @@ suffix ; Error_occurred . set ( ) end
let find_module_in_load_path name = let names = List . map ( fun ext -> name ^ ext ) ( ! mli_synonyms @ ! ml_synonyms ) in let unames = let uname = String . uncapitalize_ascii name in List . map ( fun ext -> uname ^ ext ) ( ! mli_synonyms @ ! ml_synonyms ) in let rec find_in_array a ...
let find_dependency target_kind modname ( byt_deps , opt_deps ) = try let filename = find_module_in_load_path modname in let basename = Filename . chop_extension filename in let cmi_file = basename ^ " . cmi " in let cmx_file = basename ^ " . cmx " in let mli_exists = List . exists ( fun...
let ( depends_on , escaped_eol ) = ( " " , : " \\\ n " )
let print_filename s = let s = if ! Clflags . force_slash then fix_slash s else s in if not ( String . contains s ' ' ) then begin print_string s ; end else begin let rec count n i = if i >= String . length s then n else if s . [ i ] = ' ' then count ( n + 1 ) ( i + 1 ) else ...
let print_dependencies target_files deps = let pos = ref 0 in let print_on_same_line item = if ! pos <> 0 then print_string " " ; print_filename item ; pos := ! pos + String . length item + 1 ; in let print_on_new_line item = print_string escaped_eol ; print_filename item ; pos := String ....
let print_raw_dependencies source_file deps = print_filename source_file ; print_string depends_on ; String . Set . iter ( fun dep -> if ( String . length dep > 0 ) && ( match dep . [ 0 ] with | ' A ' . . ' Z ' | ' \ 128 ' . . ' \ 255 ' -> true | _ -> fals...
let print_exception exn = Location . report_exception Format . err_formatter exn
let report_err exn = Error_occurred . set ( ) ; print_exception exn
let rec lexical_approximation lexbuf = try let rec process after_lident lexbuf = match Lexer . token lexbuf with | Parser . UIDENT name -> Depend . free_structure_names := String . Set . add name ! Depend . free_structure_names ; process false lexbuf | Parser . LIDENT _ -> process true lexbuf ...
let read_and_approximate inputfile = Depend . free_structure_names := String . Set . empty ; let ic = open_in_bin inputfile in try seek_in ic 0 ; Location . input_name := inputfile ; let lexbuf = Lexing . from_channel ic in Location . init lexbuf inputfile ; lexical_approximation lexbuf ; cl...
let read_parse_and_extract parse_function extract_function def ast_kind source_file = Depend . pp_deps := [ ] ; Depend . free_structure_names := String . Set . empty ; try let input_file = Pparse . preprocess source_file in begin try let ast = Pparse . file ~ tool_name input_file parse_functio...
let print_ml_dependencies source_file extracted_deps pp_deps = let basename = Filename . chop_extension source_file in let byte_targets = [ basename ^ " . cmo " ] in let native_targets = if ! all_dependencies then [ basename ^ " . cmx " ; basename ^ " . o " ] else [ basename ^ "...
let print_mli_dependencies source_file extracted_deps pp_deps = let basename = Filename . chop_extension source_file in let ( byt_deps , _opt_deps ) = String . Set . fold ( find_dependency MLI ) extracted_deps ( [ ] , [ ] ) in print_dependencies [ basename ^ " . cmi " ] ( ...