Skip to content

Commit

Permalink
Do not check for inline instr in main-compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
vbgl authored and eponier committed Jan 6, 2025
1 parent 133aaa6 commit 2a652ea
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 26 deletions.
22 changes: 0 additions & 22 deletions compiler/src/checkAnnot.ml
Original file line number Diff line number Diff line change
Expand Up @@ -59,25 +59,3 @@ let check_stack_size fds =
hierror "the maximum call depth is %a (expected: %a)"
Z.pp_print actual Z.pp_print expected)
fds

let rec check_no_inline_instr ~funname s =
List.iter (check_no_inline_instr_i ~funname) s

and check_no_inline_instr_i ~funname i =
if has_annot "inline" i then
hierror ~funname ~loc:(Lmore i.i_loc) ~internal:false
~kind:"compilation error" ~sub_kind:"loop unrolling"
"“inline”-annotated instructions remain";
check_no_inline_instr_i_r ~funname i.i_desc

and check_no_inline_instr_i_r ~funname = function
| Cassgn _ | Copn _ | Csyscall _ | Cfor _ | Ccall _ -> ()
| Cif (_, a, b) | Cwhile (_, a, _, _, b) ->
check_no_inline_instr ~funname a;
check_no_inline_instr ~funname b

let check_no_inline_instr (_, fds) =
List.iter
(fun { f_name; f_body; _ } ->
check_no_inline_instr ~funname:f_name.fn_name f_body)
fds
3 changes: 0 additions & 3 deletions compiler/src/checkAnnot.mli
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
val check_stack_size : (Expr.stk_fun_extra * _ Prog.func) list -> unit
(** Check the stacksize, stackallocsize & stackalign annotations, if any *)

val check_no_inline_instr : _ Prog.prog -> unit
(** Check that no “inline”-annotated instruction remain. *)
1 change: 0 additions & 1 deletion compiler/src/main_compiler.ml
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ let main () =
|> fun () -> exit 0
else
(
if s == Unrolling then CheckAnnot.check_no_inline_instr p;
eprint s (Printer.pp_prog ~debug Arch.reg_size Arch.asmOp) p
) in

Expand Down

0 comments on commit 2a652ea

Please sign in to comment.