diff options
author | Björn Gustavsson <[email protected]> | 2018-02-01 15:59:02 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2018-02-01 15:59:02 +0100 |
commit | 18d9afbd5c62bb7b7237fe0d580fc05737a096c1 (patch) | |
tree | d68c29a4d077ce205982a114d65d738e600ec7ea /lib/compiler/src/beam_a.erl | |
parent | bb0b3c7252119604cf3e8c9ba78d20000e06f4ea (diff) | |
parent | fbcff5a137e37edd80aca9c5fe18ce6880648169 (diff) | |
download | otp-18d9afbd5c62bb7b7237fe0d580fc05737a096c1.tar.gz otp-18d9afbd5c62bb7b7237fe0d580fc05737a096c1.tar.bz2 otp-18d9afbd5c62bb7b7237fe0d580fc05737a096c1.zip |
Merge pull request #1701 from bjorng/bjorn/get_hd_tl
Eliminate get_list/3 internally in the compiler
Diffstat (limited to 'lib/compiler/src/beam_a.erl')
-rw-r--r-- | lib/compiler/src/beam_a.erl | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/compiler/src/beam_a.erl b/lib/compiler/src/beam_a.erl index 7df2edd714..91acb19971 100644 --- a/lib/compiler/src/beam_a.erl +++ b/lib/compiler/src/beam_a.erl @@ -61,6 +61,14 @@ rename_instrs([{'%live',_}|Is]) -> %% Ignore old type of live annotation. Only happens when compiling %% from very old .S files. rename_instrs(Is); +rename_instrs([{get_list,S,D1,D2}|Is]) -> + %% Only happens when compiling from old .S files. + if + D1 =:= S -> + [{get_tl,S,D2},{get_hd,S,D1}|rename_instrs(Is)]; + true -> + [{get_hd,S,D1},{get_tl,S,D2}|rename_instrs(Is)] + end; rename_instrs([I|Is]) -> [rename_instr(I)|rename_instrs(Is)]; rename_instrs([]) -> []. |