aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src/beam_listing.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2018-10-23 09:11:27 +0200
committerBjörn Gustavsson <[email protected]>2018-10-23 09:32:42 +0200
commit8f725574800d559a1d71e43ab5f21c0bcb6fa142 (patch)
treec1a818b216be71e29b78a881ad43ca48d77739cd /lib/compiler/src/beam_listing.erl
parent9ebb7a3b087423774ee45becaa4305a7af37adf6 (diff)
downloadotp-8f725574800d559a1d71e43ab5f21c0bcb6fa142.tar.gz
otp-8f725574800d559a1d71e43ab5f21c0bcb6fa142.tar.bz2
otp-8f725574800d559a1d71e43ab5f21c0bcb6fa142.zip
Add a diffable option for the compiler
Add the `diffable` option to produce a more diff-friendly output in a .S file. In a diffable .S file, label numbers starts from 1 in each function and local function calls use function names instead of labels. scripts/diffable produces diff-friendly files but only for a hard-coded sub set of files in OTP. Having the option directly in the compiler makes is easier to diff the BEAM code for arbitrary source modules.
Diffstat (limited to 'lib/compiler/src/beam_listing.erl')
-rw-r--r--lib/compiler/src/beam_listing.erl2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/compiler/src/beam_listing.erl b/lib/compiler/src/beam_listing.erl
index 8a0ce5b50a..6121593b11 100644
--- a/lib/compiler/src/beam_listing.erl
+++ b/lib/compiler/src/beam_listing.erl
@@ -66,7 +66,7 @@ module(Stream, [_|_]=Fs) ->
foreach(fun (F) -> io:format(Stream, "~p.\n", [F]) end, Fs).
format_asm([{label,L}|Is]) ->
- [" {label,",integer_to_list(L),"}.\n"|format_asm(Is)];
+ [io_lib:format(" {label,~p}.\n", [L])|format_asm(Is)];
format_asm([I|Is]) ->
[io_lib:format(" ~p", [I]),".\n"|format_asm(Is)];
format_asm([]) -> [].