diff options
author | Björn Gustavsson <[email protected]> | 2015-02-27 07:33:57 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2015-03-11 09:34:19 +0100 |
commit | b4061dfd6ef6f84379fd8a0988eed79cb0bb1972 (patch) | |
tree | 8f514b1c26e7ffee60be4a431fedea1b5c45b0fd /lib/compiler/src/v3_codegen.erl | |
parent | 16d02eb264e2ff4c2c7bbe153c0dedc38e4267a5 (diff) | |
download | otp-b4061dfd6ef6f84379fd8a0988eed79cb0bb1972.tar.gz otp-b4061dfd6ef6f84379fd8a0988eed79cb0bb1972.tar.bz2 otp-b4061dfd6ef6f84379fd8a0988eed79cb0bb1972.zip |
v3_life: Combine literal/2 and literal2/2
For unclear reasons, there are two functions in v3_life that are
almost identical: literal/2 and literal2/2. literal/2 is used
for expressions and literal2/2 for patterns.
It turns out that literal2/2 can do everything that literal/2 can
do, except that it transforms maps differently.
If we adjust v3_codegen to accept the same format of maps in
expressions and patterns, we can rename literal2/2 to literal/2
and use it for expressions and patterns.
Diffstat (limited to 'lib/compiler/src/v3_codegen.erl')
-rw-r--r-- | lib/compiler/src/v3_codegen.erl | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/compiler/src/v3_codegen.erl b/lib/compiler/src/v3_codegen.erl index fadc40492c..7eec9dd62b 100644 --- a/lib/compiler/src/v3_codegen.erl +++ b/lib/compiler/src/v3_codegen.erl @@ -922,7 +922,7 @@ select_extract_tuple(Src, Vs, I, Vdb, Bef, St) -> select_map(Scs, V, Tf, Vf, Bef, St0) -> Reg = fetch_var(V, Bef), {Is,Aft,St1} = - match_fmf(fun(#l{ke={val_clause,{map,_,Es},B},i=I,vdb=Vdb}, Fail, St1) -> + match_fmf(fun(#l{ke={val_clause,{map,exact,_,Es},B},i=I,vdb=Vdb}, Fail, St1) -> select_map_val(V, Es, B, Fail, I, Vdb, Bef, St1) end, Vf, St0, Scs), {[{test,is_map,{f,Tf},[Reg]}|Is],Aft,St1}. |