text stringlengths 12 786k |
|---|
let float_const f : O . t = DW_op_const8s f |
let implicit_pointer ~ offset_in_bytes ~ die_label dwarf_version : O . t = if Dwarf_version . compare dwarf_version Dwarf_version . four < 0 then Misc . fatal_error " DWARF implicit pointers not supported at this version " else if Dwarf_version . compare dwarf_version Dwarf_version . four = 0 th... |
let call ~ die_label ~ compilation_unit_header_label : O . t = DW_op_call4 { label = die_label ; compilation_unit_header_label } |
let jump_offset_of_int jump_offset = try Numbers . Int16 . of_int64_exn ( Dwarf_int . to_int64 jump_offset ) with Misc . Fatal_error -> Misc . fatal_error " Dwarf_operator . conditional : nonzero branch too long " |
let conditional ( ? at_join = [ O . DW_op_nop ] ) ~ if_zero ~ if_nonzero ( ) = let nonzero_branch_size = List . fold_left ( fun nonzero_branch_size op -> Dwarf_int . add ( O . size op ) nonzero_branch_size ) ( Dwarf_int . zero ( ) ) if_nonzero in let nonzero_branch_size = j... |
let cautious f ppf arg = try f ppf arg with Ellipsis -> fprintf ppf " . . . " |
let rec print_ident ppf = function Oide_ident s -> fprintf ppf " % s " s | Oide_dot ( id , s ) -> fprintf ppf " % a . % s " print_ident id s | Oide_apply ( id1 , id2 ) -> fprintf ppf " % a ( % a ) " print_ident id1 print_ident id2 |
let parenthesized_ident name = ( List . mem name [ " or " ; " mod " ; " land " ; " lor " ; " lxor " ; " lsl " ; " lsr " ; " asr " ] ) || ( match name . [ 0 ] with ' a ' . . ' z ' | ' A ' . . ' Z ' | ' \ 223 ' . . ' ... |
let value_ident ppf name = if parenthesized_ident name then fprintf ppf " ( % s ) " name else fprintf ppf " % s " name |
let valid_float_lexeme s = let l = String . length s in let rec loop i = if i >= l then s ^ " . " else match s . [ i ] with | ' 0 ' . . ' 9 ' | ' ' - -> loop ( i + 1 ) | _ -> s in loop 0 |
let float_repres f = match classify_float f with FP_nan -> " nan " | FP_infinite -> if f < 0 . 0 then " neg_infinity " else " infinity " | _ -> let float_val = let s1 = Printf . sprintf " . % 12g " f in if f = float_of_string s1 then s1 else let s2 = Printf . sprintf " . % 1... |
let parenthesize_if_neg ppf fmt v isneg = if isneg then pp_print_char ppf ' ( ' ; fprintf ppf fmt v ; if isneg then pp_print_char ppf ' ) ' |
let print_out_value ppf tree = let rec print_tree_1 ppf = function | Oval_constr ( name , [ param ] ) -> fprintf ppf " [ @< 1 >% a @ % a ] " @ print_ident name print_constr_param param | Oval_constr ( name , ( _ :: _ as params ) ) -> fprintf ppf " [ @< 1 >% a @ ( % ... |
let out_value = ref print_out_value |
let rec print_list_init pr sep ppf = function [ ] -> ( ) | a :: l -> sep ppf ; pr ppf a ; print_list_init pr sep ppf l |
let rec print_list pr sep ppf = function [ ] -> ( ) | [ a ] -> pr ppf a | a :: l -> pr ppf a ; sep ppf ; print_list pr sep ppf l |
let pr_present = print_list ( fun ppf s -> fprintf ppf " ` % s " s ) ( fun ppf -> fprintf ppf " @ " ) |
let pr_vars = print_list ( fun ppf s -> fprintf ppf " ' % s " s ) ( fun ppf -> fprintf ppf " @ " ) |
let rec print_out_type ppf = function | Otyp_alias ( ty , s ) -> fprintf ppf " [ @% a @ as ' % s ] " @ print_out_type ty s | Otyp_poly ( sl , ty ) -> fprintf ppf " [ @< hov 2 >% a . @ % a ] " @ pr_vars sl print_out_type ty | ty -> print_out_type_1 ppf ty function Otyp_ar... |
let out_type = ref print_out_type |
let type_parameter ppf ( ty , ( co , cn ) ) = fprintf ppf " % s ' % s " ( if not cn then " " + else if not co then " " - else " " ) ty |
let print_out_class_params ppf = function [ ] -> ( ) | tyl -> fprintf ppf " [ @< 1 [ >% a ] ] @@ " ( print_list type_parameter ( fun ppf -> fprintf ppf " , " ) ) tyl |
let rec print_out_class_type ppf = function Octy_constr ( id , tyl ) -> let pr_tyl ppf = function [ ] -> ( ) | tyl -> fprintf ppf " [ @< 1 [ >% a ] ] @@ " ( print_typlist ! out_type " , " ) tyl in fprintf ppf " [ @% a % a ] " @ pr_tyl tyl print_ident id | Octy_... |
let out_class_type = ref print_out_class_type |
let out_module_type = ref ( fun _ -> failwith " Oprint . out_module_type " ) |
let out_sig_item = ref ( fun _ -> failwith " Oprint . out_sig_item " ) |
let out_signature = ref ( fun _ -> failwith " Oprint . out_signature " ) |
let rec print_out_module_type ppf = function Omty_abstract -> ( ) | Omty_functor ( name , mty_arg , mty_res ) -> fprintf ppf " [ @< 2 > functor @ ( % s : % a ) ->@ % a ] " @ name print_out_module_type mty_arg print_out_module_type mty_res | Omty_ident id -> fprintf ppf " % a "... |
let _ = out_module_type := print_out_module_type |
let _ = out_signature := print_out_signature |
let _ = out_sig_item := print_out_sig_item |
let print_out_exception ppf exn outv = match exn with Sys . Break -> fprintf ppf " Interrupted . . " @ | Out_of_memory -> fprintf ppf " Out of memory during evaluation . . " @ | Stack_overflow -> fprintf ppf " Stack overflow during evaluation ( looping recursion ) . . " ?@ | _ ... |
let rec print_items ppf = function [ ] -> ( ) | ( tree , valopt ) :: items -> begin match valopt with Some v -> fprintf ppf " [ @< 2 >% a =@ % a ] " @ ! out_sig_item tree ! out_value v | None -> fprintf ppf " [ @% a ] " @ ! out_sig_item tree end ; if items <> [ ] ... |
let print_out_phrase ppf = function Ophr_eval ( outv , ty ) -> fprintf ppf " [ @- : % a @ =@ % a ] . " @@ ! out_type ty ! out_value outv | Ophr_signature [ ] -> ( ) | Ophr_signature items -> fprintf ppf " [ @< v >% a ] . " @@ print_items items | Ophr_exception ( ex... |
let out_phrase = ref print_out_phrase |
let with_info = Compile_common . with_info ~ native : true ~ tool_name |
let interface ~ source_file ~ output_prefix = with_info ~ source_file ~ output_prefix ~ dump_ext " : cmi " @@ fun info -> Compile_common . interface ~ hook_parse_tree ( : fun _ -> ( ) ) ~ hook_typed_tree ( : fun _ -> ( ) ) info |
let ( ) |>> ( x , y ) f = ( x , f y ) |
let flambda i backend typed = typed |> Profile . ( record transl ) ( Translmod . transl_implementation_flambda i . module_name ) |> Profile . ( record generate ) ( fun { Lambda . module_ident ; main_module_block_size ; required_globals ; code } -> ( ( module_ident , main_modu... |
let clambda i backend typed = Clflags . set_oclassic ( ) ; typed |> Profile . ( record transl ) ( Translmod . transl_store_implementation i . module_name ) |> print_if i . ppf_dump Clflags . dump_rawlambda Printlambda . program |> Profile . ( record generate ) ( fun program -> l... |
let emit i = Compilenv . reset ? packname :! Clflags . for_package i . module_name ; Asmgen . compile_implementation_linear i . output_prefix ~ progname : i . source_file |
let implementation ~ backend ~ start_from ~ source_file ~ output_prefix ~ keep_symbol_tables : _ = let backend info typed = Compilenv . reset ? packname :! Clflags . for_package info . module_name ; if Config . flambda then flambda info backend typed else clambda info backend typed in with_info ~ ... |
let report_error ppf exn = let report ppf = function | Lexer . Error ( err , l ) -> Location . print_error ppf l ; Lexer . report_error ppf err | Syntaxerr . Error err -> Syntaxerr . report_error ppf err | Pparse . Error -> Location . print_error_cur_file ppf ; fprintf ppf " Preprocess... |
let pp_tag print_tag ppf tag = if print_tag then Format . fprintf ppf " _ % d " ( Tag . to_int tag ) |
let make_optimistic_const_ctor ( ) : U . const_ctors_decision = let is_int = Extra_param_and_args . create ~ name " : is_int " in let unboxed_const_ctor = Extra_param_and_args . create ~ name " : unboxed_const_ctor " in let ctor = U . Unbox ( Number ( Naked_immediate , unboxed_const_c... |
let make_optimistic_number_decision tenv param_type ( decider : Unboxers . number_decider ) : U . decision option = match decider . prove_is_a_boxed_number tenv param_type with | Proved ( ) -> let naked_number = Extra_param_and_args . create ~ name : decider . param_name in Some ( Unbox ( ... |
let decide tenv param_type deciders : U . decision option = List . find_map ( make_optimistic_number_decision tenv param_type ) deciders |
let deciders = [ Unboxers . Immediate . decider ; Unboxers . Float . decider ; Unboxers . Int32 . decider ; Unboxers . Int64 . decider ; Unboxers . Nativeint . decider ] |
let rec make_optimistic_decision ~ depth tenv ~ param_type : U . decision = let param_type_is_alias_to_symbol = match T . get_alias_exn param_type with | exception Not_found -> false | alias -> Simple . is_symbol alias in if param_type_is_alias_to_symbol then Do_not_unbox Not_beneficial else match decide... |
let infile = ref " " |
let verbose = ref false |
let verbose_front = ref false |
let verbose_tree = ref false |
let run_tests = ref false |
let use_i0 = ref false |
let use_i1 = ref false |
let use_i2 = ref false |
let use_i3 = ref false |
let use_i4 = ref false |
let use_i4x86 = ref false |
let use_all ( ) = use_i0 := true ; use_i1 := true ; use_i2 := true ; use_i3 := true ; use_i4 := true |
let show_compiled = ref false |
let set_infile f = infile := f |
let stack_max = ref 1000 |
let heap_max = ref 1000 |
let option_spec = [ ( " - V " , Arg . Set verbose_front , " verbose front end " ) ; ( " - v " , Arg . Set verbose , " verbose interpreter ( s ) " ) ; ( " - T " , Arg . Set verbose_tree , " verbose output in the form of tree ( currently only frontend ) ... |
let usage_msg = " Usage : slang . byte [ options ] [ < file ] >\ nOptions are " : |
let ( ) = Arg . parse option_spec set_infile usage_msg |
let create ? name parent variable values = let w = Widget . new_atom " menubutton " ~ parent ? name in let mw = Widget . new_atom " menu " ~ parent : w ~ name " : menu " in let res = tkEval [ | TkToken " tk_optionMenu " ; TkToken ( Widget . name w ) ; cCAMLtoTKtextVariable va... |
let create_named parent name variable values = let w = Widget . new_atom " menubutton " ~ parent ~ name in let mw = Widget . new_atom " menu " ~ parent : w ~ name : " menu " in let res = tkEval [ | TkToken " tk_optionMenu " ; TkToken ( Widget . name w ) ; cCAMLtoTKtextVariable... |
let create ~ parent ~ variable ? name values = let w = Widget . new_atom " menubutton " ~ parent ? name in let mw = Widget . new_atom " menu " ~ parent : w ~ name " : menu " in let res = tkEval [ | TkToken " tk_optionMenu " ; TkToken ( Widget . name w ) ; cCAMLtoTKtextVaria... |
module Imported ' modules = struct module Descriptor = Descriptor end |
module rec Options : sig val name ' : unit -> string type t = bool val make : ? mangle_names : bool -> unit -> t val to_proto : t -> Runtime ' . Writer . t val from_proto : Runtime ' . Reader . t -> ( t , [ > Runtime ' . Result . error ] ) result let name ' ( ) = " o... |
let output_prefix name = let oname = match ! output_name with | None -> name | Some n -> if ! compile_only then ( output_name := None ; n ) else name in Misc . chop_extension_if_any oname |
let process_interface_file ppf name = Optcompile . interface ppf name ( output_prefix name ) |
let process_implementation_file ppf name = let opref = output_prefix name in Optcompile . implementation ppf name opref ; objfiles := ( opref ^ " . cmx " ) :: ! objfiles |
let process_file ppf name = if Filename . check_suffix name " . ml " || Filename . check_suffix name " . mlt " then process_implementation_file ppf name else if Filename . check_suffix name ! Config . interface_suffix then begin let opref = output_prefix name in Optcompile . interface ppf name... |
let print_version_and_library ( ) = print_string " The Objective Caml native - code compiler , version " ; print_string Config . version ; print_newline ( ) ; print_string " Standard library directory : " ; print_string Config . standard_library ; print_newline ( ) ; exit 0 |
let print_version_string ( ) = print_string Config . version ; print_newline ( ) ; exit 0 |
let print_standard_library ( ) = print_string Config . standard_library ; print_newline ( ) ; exit 0 |
let fatal err = prerr_endline err ; exit 2 |
let extract_output = function | Some s -> s | None -> fatal " Please specify the name of the output file , using option - o " |
let default_output = function | Some s -> s | None -> Config . default_executable_name |
let usage = " Usage : ocamlopt < options > < files >\ nOptions are " : |
let anonymous = process_file Format . err_formatter ; ; |
let impl = process_implementation_file Format . err_formatter ; ; |
let intf = process_interface_file Format . err_formatter ; ; |
let show_config ( ) = Config . print_config stdout ; exit 0 ; ; ; |
module Options = Main_args . Make_optcomp_options ( struct let set r ( ) = r := true let clear r ( ) = r := false let _a = set make_archive let _annot = set annotations let _c = set compile_only let _cc s = c_compiler := Some s let _cclib s = ccobjs := Misc . rev_split_words s @ ! ccobj... |
let main ( ) = native_code := true ; let ppf = Format . err_formatter in try Arg . parse ( Arch . command_line_options @ Options . list ) anonymous usage ; if List . length ( List . filter ( fun x -> ! x ) [ make_package ; make_archive ; shared ; compile_only ; output_c_obj... |
module Backend = struct let symbol_for_global ' = Compilenv . symbol_for_global ' let closure_symbol = Compilenv . closure_symbol let really_import_approx = Import_approx . really_import_approx let import_symbol = Import_approx . import_symbol let size_int = Arch . size_int let big_endian = Arch . ... |
let backend = ( module Backend : Backend_intf . S ) |
let usage = " Usage : ocamlopt < options > < files >\ nOptions are " : |
module Options = Main_args . Make_optcomp_options ( Main_args . Default . Optmain ) |
let main argv ppf = native_code := true ; match Compenv . readenv ppf Before_args ; Clflags . add_arguments __LOC__ ( Arch . command_line_options @ Options . list ) ; Clflags . add_arguments __LOC__ [ " - depend " , Arg . Unit Makedepend . main_from_option , " < options > Com... |
type knobs = { verbosity : int ; output_dir : string ; timeout : int ; gui : bool ; full_debugging : bool ; db_host : string option ; db_port : int ; db_user : string ; db_password : string ; db_name : string ; db_expid : int ; testgen_alg : testgen_alg ; seed_range : seed_range ... |
let use_db knobs = knobs . db_host <> None |
let get_tc_dir cwd = Filename . concat cwd tcdir |
let get_crash_dir cwd = Filename . concat cwd crashdir |
let get_logfile cwd = Filename . concat cwd ofuzzlog |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.