aboutsummaryrefslogtreecommitdiffstats
path: root/lib/hipe
diff options
context:
space:
mode:
authorMagnus Lång <[email protected]>2017-02-20 14:49:44 +0100
committerMagnus Lång <[email protected]>2017-03-06 18:18:23 +0100
commit1acdb8912735e78ced00a5c995a33fd4ea5eef91 (patch)
treed69eeee19f8716cfaac6c23ecfd1b62ec152e949 /lib/hipe
parent3abba595d91506f32aba47ecc39e9b6b3a08f645 (diff)
downloadotp-1acdb8912735e78ced00a5c995a33fd4ea5eef91.tar.gz
otp-1acdb8912735e78ced00a5c995a33fd4ea5eef91.tar.bz2
otp-1acdb8912735e78ced00a5c995a33fd4ea5eef91.zip
hipe_amd64_registers: Cleanup exit/1 calls
Diffstat (limited to 'lib/hipe')
-rw-r--r--lib/hipe/amd64/hipe_amd64_registers.erl27
1 files changed, 9 insertions, 18 deletions
diff --git a/lib/hipe/amd64/hipe_amd64_registers.erl b/lib/hipe/amd64/hipe_amd64_registers.erl
index a4cb71a106..a5cecef5a1 100644
--- a/lib/hipe/amd64/hipe_amd64_registers.erl
+++ b/lib/hipe/amd64/hipe_amd64_registers.erl
@@ -207,19 +207,14 @@ allocatable_x87() ->
nr_args() -> ?AMD64_NR_ARG_REGS.
-arg(N) ->
- if N < ?AMD64_NR_ARG_REGS ->
- case N of
- 0 -> ?ARG0;
- 1 -> ?ARG1;
- 2 -> ?ARG2;
- 3 -> ?ARG3;
- 4 -> ?ARG4;
- 5 -> ?ARG5;
- _ -> exit({?MODULE, arg, N})
- end;
- true ->
- exit({?MODULE, arg, N})
+arg(N) when N < ?AMD64_NR_ARG_REGS ->
+ case N of
+ 0 -> ?ARG0;
+ 1 -> ?ARG1;
+ 2 -> ?ARG2;
+ 3 -> ?ARG3;
+ 4 -> ?ARG4;
+ 5 -> ?ARG5
end.
is_arg(R) ->
@@ -240,11 +235,7 @@ args(Arity) when is_integer(Arity), Arity >= 0 ->
args(I, Rest) when I < 0 -> Rest;
args(I, Rest) -> args(I-1, [arg(I) | Rest]).
-ret(N) ->
- case N of
- 0 -> ?RAX;
- _ -> exit({?MODULE, ret, N})
- end.
+ret(0) -> ?RAX.
%% Note: the fact that (allocatable() UNION allocatable_x87() UNION
%% allocatable_sse2()) is a subset of call_clobbered() is hard-coded in