aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src/v3_codegen.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2015-02-27 07:33:57 +0100
committerBjörn Gustavsson <[email protected]>2015-03-11 09:34:19 +0100
commitb4061dfd6ef6f84379fd8a0988eed79cb0bb1972 (patch)
tree8f514b1c26e7ffee60be4a431fedea1b5c45b0fd /lib/compiler/src/v3_codegen.erl
parent16d02eb264e2ff4c2c7bbe153c0dedc38e4267a5 (diff)
downloadotp-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.erl2
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}.