Skip to content

Commit 3b26fe0

Browse files
committed
fmt
1 parent 49199f6 commit 3b26fe0

File tree

7 files changed

+16
-44
lines changed

7 files changed

+16
-44
lines changed

backend/cfg/cfg.ml

+1-2
Original file line numberDiff line numberDiff line change
@@ -364,8 +364,7 @@ let dump_terminator' ?(print_reg = Printmach.reg) ?(res = [||]) ?(args = [||])
364364
Format.fprintf ppf "%t%a" print_res dump_mach_op
365365
(match prim with
366366
| External { func_symbol = func; ty_res; ty_args; alloc } ->
367-
Mach.Iextcall
368-
{ func = func; ty_res; ty_args; returns = true; alloc }
367+
Mach.Iextcall { func; ty_res; ty_args; returns = true; alloc }
369368
| Alloc { bytes; dbginfo; mode } -> Mach.Ialloc { bytes; dbginfo; mode }
370369
| Checkbound { immediate = Some x } -> Mach.Iintop_imm (Icheckbound, x)
371370
| Checkbound { immediate = None } -> Mach.Iintop Icheckbound

backend/cfg/cfg_equivalence.ml

+1-2
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,7 @@ let check_external_call_operation :
184184
Cfg.external_call_operation ->
185185
unit =
186186
fun location expected result ->
187-
if not
188-
(String.equal expected.func_symbol result.func_symbol)
187+
if not (String.equal expected.func_symbol result.func_symbol)
189188
then different location "function symbol";
190189
if not (Bool.equal expected.alloc result.alloc)
191190
then different location "allocating";

backend/cfg/cfg_to_linear.ml

+5-13
Original file line numberDiff line numberDiff line change
@@ -146,18 +146,15 @@ let linearize_terminator cfg_with_layout (func : string) start
146146
| Tailcall_func (Direct func_symbol) ->
147147
[L.Lop (Itailcall_imm { func = func_symbol })], None
148148
| Tailcall_self { destination } ->
149-
( [L.Lop (Itailcall_imm { func = { sym_name = func; sym_global = Local } })],
149+
( [ L.Lop
150+
(Itailcall_imm { func = { sym_name = func; sym_global = Local } })
151+
],
150152
Some destination )
151153
| Call_no_return { func_symbol; alloc; ty_args; ty_res } ->
152154
single
153155
(L.Lop
154156
(Iextcall
155-
{ func = func_symbol;
156-
alloc;
157-
ty_args;
158-
ty_res;
159-
returns = false
160-
}))
157+
{ func = func_symbol; alloc; ty_args; ty_res; returns = false }))
161158
| Call { op; label_after } ->
162159
let op : Mach.operation =
163160
match op with
@@ -170,12 +167,7 @@ let linearize_terminator cfg_with_layout (func : string) start
170167
match op with
171168
| External { func_symbol; alloc; ty_args; ty_res } ->
172169
Iextcall
173-
{ func = func_symbol;
174-
alloc;
175-
ty_args;
176-
ty_res;
177-
returns = true
178-
}
170+
{ func = func_symbol; alloc; ty_args; ty_res; returns = true }
179171
| Checkbound { immediate = None } -> Iintop Icheckbound
180172
| Checkbound { immediate = Some i } -> Iintop_imm (Icheckbound, i)
181173
| Alloc { bytes; dbginfo; mode } -> Ialloc { bytes; dbginfo; mode }

backend/cfg/cfgize.ml

+1-7
Original file line numberDiff line numberDiff line change
@@ -155,13 +155,7 @@ let basic_or_terminator_of_operation :
155155
then Tailcall_self { destination = State.get_tailrec_label state }
156156
else Tailcall_func (Direct func))
157157
| Iextcall { func; ty_res; ty_args; alloc; returns } ->
158-
let external_call =
159-
{ Cfg.func_symbol = func;
160-
alloc;
161-
ty_res;
162-
ty_args
163-
}
164-
in
158+
let external_call = { Cfg.func_symbol = func; alloc; ty_res; ty_args } in
165159
if returns
166160
then
167161
With_next_label

backend/cfg/linear_to_cfg.ml

+2-13
Original file line numberDiff line numberDiff line change
@@ -540,22 +540,11 @@ let rec create_blocks (t : t) (i : L.instruction) (block : C.basic_block)
540540
terminator desc
541541
| Iextcall { func; alloc; ty_args; ty_res; returns = false } ->
542542
terminator
543-
(C.Call_no_return
544-
{ func_symbol = func;
545-
alloc;
546-
ty_args;
547-
ty_res
548-
})
543+
(C.Call_no_return { func_symbol = func; alloc; ty_args; ty_res })
549544
| Icall_ind -> terminator_call Indirect
550545
| Icall_imm { func } -> terminator_call (Direct func)
551546
| Iextcall { func; alloc; ty_args; ty_res; returns = true } ->
552-
terminator_prim
553-
(External
554-
{ func_symbol = func;
555-
alloc;
556-
ty_args;
557-
ty_res
558-
})
547+
terminator_prim (External { func_symbol = func; alloc; ty_args; ty_res })
559548
| Iintop Icheckbound -> terminator_prim (Checkbound { immediate = None })
560549
| Iintop_imm (Icheckbound, i) ->
561550
terminator_prim (Checkbound { immediate = Some i })

backend/cmm_helpers.ml

+5-6
Original file line numberDiff line numberDiff line change
@@ -3777,10 +3777,10 @@ let emit_constant_closure symb fundecls clos_vars cont =
37773777
| arity ->
37783778
Csymbol_address
37793779
(global_symbol
3780-
(curry_function_sym arity.function_kind
3781-
(List.map machtype_of_layout_changing_tagged_int_to_val
3782-
arity.params_layout)
3783-
(machtype_of_layout_changing_tagged_int_to_val arity.return_layout)))
3780+
(curry_function_sym arity.function_kind
3781+
(List.map machtype_of_layout_changing_tagged_int_to_val
3782+
arity.params_layout)
3783+
(machtype_of_layout_changing_tagged_int_to_val arity.return_layout)))
37843784
:: Cint (closure_info ~arity ~startenv ~is_last)
37853785
:: Csymbol_address { sym_name = f1.label; sym_global = symb.sym_global }
37863786
:: emit_others 4 remainder)
@@ -4119,8 +4119,7 @@ let cfloat f = Cmm.Cdouble f
41194119

41204120
let symbol_address s = Cmm.Csymbol_address s
41214121

4122-
let define_symbol symbol =
4123-
[Cdefine_symbol symbol]
4122+
let define_symbol symbol = [Cdefine_symbol symbol]
41244123

41254124
(* Cmm phrases *)
41264125

middle_end/flambda2/to_cmm/to_cmm.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ let flush_cmm_helpers_state () =
3838
let aux name cst acc =
3939
match (cst : Cmmgen_state.constant) with
4040
| Const_table (sym_global, l) ->
41-
C.cdata (C.define_symbol {sym_name = name; sym_global} @ l) :: acc
41+
C.cdata (C.define_symbol { sym_name = name; sym_global } @ l) :: acc
4242
| Const_closure _ ->
4343
Misc.fatal_errorf
4444
"There shouldn't be any closures in Cmmgen_state during Flambda 2 to \

0 commit comments

Comments
 (0)