Skip to content

Commit f44d229

Browse files
committed
Use '$' to escape special characters in all ports
Before, Power and S390 used '.' as escape character, for no apparent reason. Remove the "escape char" parameter from Emitaux.emit_symbol. Instead, '$' is "hard-wired" as the escape char.
1 parent 920fb8e commit f44d229

File tree

6 files changed

+5
-16
lines changed

6 files changed

+5
-16
lines changed

Diff for: asmcomp/arm/emit.mlp

+1-4
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,7 @@ open Emitenv
3131
let emit_label lbl =
3232
emit_string ".L"; emit_int lbl
3333

34-
(* Symbols *)
35-
36-
let emit_symbol s =
37-
Emitaux.emit_symbol '$' s
34+
(* Calls and tail calls *)
3835

3936
let emit_call s =
4037
if !Clflags.dlcode || !Clflags.pic_code

Diff for: asmcomp/arm64/emit.mlp

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ let emit_label lbl =
4949

5050
let emit_symbol s =
5151
if macosx then emit_string "_";
52-
Emitaux.emit_symbol '$' s
52+
Emitaux.emit_symbol s
5353

5454
(* Object types *)
5555

Diff for: asmcomp/emitaux.ml

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ let emit_printf fmt =
3535

3636
let emit_int32 n = emit_printf "0x%lx" n
3737

38-
let emit_symbol esc s =
38+
let emit_symbol s =
3939
for i = 0 to String.length s - 1 do
4040
let c = s.[i] in
4141
match c with
4242
'A'..'Z' | 'a'..'z' | '0'..'9' | '_' ->
4343
output_char !output_channel c
4444
| _ ->
45-
Printf.fprintf !output_channel "%c%02x" esc (Char.code c)
45+
Printf.fprintf !output_channel "$%02x" (Char.code c)
4646
done
4747

4848
let emit_string_literal s =

Diff for: asmcomp/emitaux.mli

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ val emit_string: string -> unit
2020
val emit_int: int -> unit
2121
val emit_nativeint: nativeint -> unit
2222
val emit_int32: int32 -> unit
23-
val emit_symbol: char -> string -> unit
23+
val emit_symbol: string -> unit
2424
val emit_printf: ('a, out_channel, unit) format -> 'a
2525
val emit_char: char -> unit
2626
val emit_string_literal: string -> unit

Diff for: asmcomp/power/emit.mlp

-4
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,6 @@ let (trap_size, trap_handler_offset, trap_previous_offset) =
7575
| ELF64v1 -> (32, 56, 64)
7676
| ELF64v2 -> (32, 40, 48)
7777

78-
(* Output a symbol *)
79-
80-
let emit_symbol s = Emitaux.emit_symbol '.' s
81-
8278
(* Output a label *)
8379

8480
let label_prefix = ".L"

Diff for: asmcomp/s390x/emit.mlp

-4
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,6 @@ let slot_offset env loc cls =
4444
| Outgoing n -> n
4545
| Domainstate _ -> assert false (* not a stack slot *)
4646

47-
(* Output a symbol *)
48-
49-
let emit_symbol s = Emitaux.emit_symbol '.' s
50-
5147
(* Output function call *)
5248

5349
let emit_call s =

0 commit comments

Comments
 (0)