File tree 7 files changed +16
-44
lines changed
middle_end/flambda2/to_cmm
7 files changed +16
-44
lines changed Original file line number Diff line number Diff line change @@ -364,8 +364,7 @@ let dump_terminator' ?(print_reg = Printmach.reg) ?(res = [||]) ?(args = [||])
364
364
Format. fprintf ppf " %t%a" print_res dump_mach_op
365
365
(match prim with
366
366
| 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 }
369
368
| Alloc { bytes; dbginfo; mode } -> Mach. Ialloc { bytes; dbginfo; mode }
370
369
| Checkbound { immediate = Some x } -> Mach. Iintop_imm (Icheckbound , x)
371
370
| Checkbound { immediate = None } -> Mach. Iintop Icheckbound
Original file line number Diff line number Diff line change @@ -184,8 +184,7 @@ let check_external_call_operation :
184
184
Cfg. external_call_operation ->
185
185
unit =
186
186
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)
189
188
then different location " function symbol" ;
190
189
if not (Bool. equal expected.alloc result.alloc)
191
190
then different location " allocating" ;
Original file line number Diff line number Diff line change @@ -146,18 +146,15 @@ let linearize_terminator cfg_with_layout (func : string) start
146
146
| Tailcall_func (Direct func_symbol ) ->
147
147
[L. Lop (Itailcall_imm { func = func_symbol })], None
148
148
| 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
+ ],
150
152
Some destination )
151
153
| Call_no_return { func_symbol; alloc; ty_args; ty_res } ->
152
154
single
153
155
(L. Lop
154
156
(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 }))
161
158
| Call { op; label_after } ->
162
159
let op : Mach.operation =
163
160
match op with
@@ -170,12 +167,7 @@ let linearize_terminator cfg_with_layout (func : string) start
170
167
match op with
171
168
| External { func_symbol; alloc; ty_args; ty_res } ->
172
169
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 }
179
171
| Checkbound { immediate = None } -> Iintop Icheckbound
180
172
| Checkbound { immediate = Some i } -> Iintop_imm (Icheckbound , i)
181
173
| Alloc { bytes; dbginfo; mode } -> Ialloc { bytes; dbginfo; mode }
Original file line number Diff line number Diff line change @@ -155,13 +155,7 @@ let basic_or_terminator_of_operation :
155
155
then Tailcall_self { destination = State. get_tailrec_label state }
156
156
else Tailcall_func (Direct func))
157
157
| 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
165
159
if returns
166
160
then
167
161
With_next_label
Original file line number Diff line number Diff line change @@ -540,22 +540,11 @@ let rec create_blocks (t : t) (i : L.instruction) (block : C.basic_block)
540
540
terminator desc
541
541
| Iextcall { func; alloc; ty_args; ty_res; returns = false } ->
542
542
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 })
549
544
| Icall_ind -> terminator_call Indirect
550
545
| Icall_imm { func } -> terminator_call (Direct func)
551
546
| 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 })
559
548
| Iintop Icheckbound -> terminator_prim (Checkbound { immediate = None })
560
549
| Iintop_imm (Icheckbound, i ) ->
561
550
terminator_prim (Checkbound { immediate = Some i })
Original file line number Diff line number Diff line change @@ -3777,10 +3777,10 @@ let emit_constant_closure symb fundecls clos_vars cont =
3777
3777
| arity ->
3778
3778
Csymbol_address
3779
3779
(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)))
3784
3784
:: Cint (closure_info ~arity ~startenv ~is_last )
3785
3785
:: Csymbol_address { sym_name = f1.label; sym_global = symb.sym_global }
3786
3786
:: emit_others 4 remainder)
@@ -4119,8 +4119,7 @@ let cfloat f = Cmm.Cdouble f
4119
4119
4120
4120
let symbol_address s = Cmm. Csymbol_address s
4121
4121
4122
- let define_symbol symbol =
4123
- [Cdefine_symbol symbol]
4122
+ let define_symbol symbol = [Cdefine_symbol symbol]
4124
4123
4125
4124
(* Cmm phrases *)
4126
4125
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ let flush_cmm_helpers_state () =
38
38
let aux name cst acc =
39
39
match (cst : Cmmgen_state.constant ) with
40
40
| 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
42
42
| Const_closure _ ->
43
43
Misc. fatal_errorf
44
44
" There shouldn't be any closures in Cmmgen_state during Flambda 2 to \
You can’t perform that action at this time.
0 commit comments