Skip to content

Commit

Permalink
arm [minor]: have emit_call, emit_jump include a newline
Browse files Browse the repository at this point in the history
  • Loading branch information
gasche committed Nov 11, 2016
1 parent 8e983c0 commit 51390e9
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions asmcomp/arm/emit.mlp
Expand Up @@ -42,13 +42,13 @@ let emit_symbol s =

let emit_call s =
if !Clflags.dlcode || !Clflags.pic_code
then `bl {emit_symbol s}(PLT)`
else `bl {emit_symbol s}`
then ` bl {emit_symbol s}(PLT)\n`
else ` bl {emit_symbol s}\n`

let emit_jump s =
if !Clflags.dlcode || !Clflags.pic_code
then `b {emit_symbol s}(PLT)`
else `b {emit_symbol s}`
then ` b {emit_symbol s}(PLT)\n`
else ` b {emit_symbol s}\n`

(* Output a pseudo-register *)

Expand Down Expand Up @@ -137,7 +137,7 @@ type gc_call =
let call_gc_sites = ref ([] : gc_call list)

let emit_call_gc gc =
`{emit_label gc.gc_lbl}: {emit_call "caml_call_gc"}\n`;
`{emit_label gc.gc_lbl}:`; emit_call "caml_call_gc";
`{emit_label gc.gc_frame_lbl}: b {emit_label gc.gc_return_lbl}\n`

(* Record calls to caml_ml_array_bound_error.
Expand All @@ -163,7 +163,7 @@ let bound_error_label ?label dbg =
end

let emit_call_bound_error bd =
`{emit_label bd.bd_lbl}: {emit_call "caml_ml_array_bound_error"}\n`;
`{emit_label bd.bd_lbl}:`; emit_call "caml_ml_array_bound_error";
`{emit_label bd.bd_frame_lbl}:\n`

(* Negate a comparison *)
Expand Down Expand Up @@ -450,7 +450,7 @@ let emit_instr i =
`{record_frame i.live false i.dbg ~label:label_after}\n`; 2
end
| Lop(Icall_imm { func; label_after; }) ->
` {emit_call func}\n`;
emit_call func;
`{record_frame i.live false i.dbg ~label:label_after}\n`; 1
| Lop(Itailcall_ind { label_after = _; }) ->
output_epilogue begin fun () ->
Expand All @@ -465,14 +465,14 @@ let emit_instr i =
output_epilogue begin fun () ->
if !contains_calls then
` ldr lr, [sp, #{emit_int (-4)}]\n`;
` {emit_jump func}\n`; 2
emit_jump func; 2
end
end
| Lop(Iextcall { func; alloc = false; }) ->
` {emit_call func}\n`; 1
emit_call func; 1
| Lop(Iextcall { func; alloc = true; label_after; }) ->
let ninstr = emit_load_symbol_addr (phys_reg 7 (* r7 *)) func in
` {emit_call "caml_c_call"}\n`;
emit_call "caml_c_call";
`{record_frame i.live false i.dbg ~label:label_after}\n`;
1 + ninstr
| Lop(Istackoffset n) ->
Expand Down Expand Up @@ -566,11 +566,11 @@ let emit_instr i =
end else begin
let ninstr =
begin match n with
8 -> ` {emit_call "caml_alloc1"}\n`; 1
| 12 -> ` {emit_call "caml_alloc2"}\n`; 1
| 16 -> ` {emit_call "caml_alloc3"}\n`; 1
8 -> emit_call "caml_alloc1"; 1
| 12 -> emit_call "caml_alloc2"; 1
| 16 -> emit_call "caml_alloc3"; 1
| _ -> let ninstr = emit_intconst (phys_reg 7) (Int32.of_int n) in
` {emit_call "caml_allocN"}\n`; 1 + ninstr
emit_call "caml_allocN"; 1 + ninstr
end in
`{emit_label lbl_frame}: add {emit_reg i.res.(0)}, alloc_ptr, #4\n`;
1 + ninstr
Expand Down Expand Up @@ -793,7 +793,7 @@ let emit_instr i =
| Lraise k ->
begin match k with
| Cmm.Raise_withtrace ->
` {emit_call "caml_raise_exn"}\n`;
emit_call "caml_raise_exn";
`{record_frame Reg.Set.empty true i.dbg}\n`; 1
| Cmm.Raise_notrace ->
` mov sp, trap_ptr\n`;
Expand Down Expand Up @@ -830,7 +830,7 @@ let emit_profile() =
match Config.system with
"linux_eabi" | "linux_eabihf" | "netbsd" ->
` push \{lr}\n`;
` {emit_call "__gnu_mcount_nc"}\n`
emit_call "__gnu_mcount_nc";
| _ -> ()

(* Emission of a function declaration *)
Expand Down

0 comments on commit 51390e9

Please sign in to comment.