aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/src/qlc_pt.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2016-09-02 14:13:18 +0200
committerBjörn Gustavsson <[email protected]>2016-09-02 14:13:18 +0200
commit61b53af84200b52a5b91c4266e91ebc6ba0173ee (patch)
tree2d28327d41a41375a9258fa64d99bc3bd8d9c518 /lib/stdlib/src/qlc_pt.erl
parent49381b90620e88bda2d3f3edce25c8e841ded9c1 (diff)
parent6ba91ac62a8cffd9ea274ce8b9023abbcb8d9b67 (diff)
downloadotp-61b53af84200b52a5b91c4266e91ebc6ba0173ee.tar.gz
otp-61b53af84200b52a5b91c4266e91ebc6ba0173ee.tar.bz2
otp-61b53af84200b52a5b91c4266e91ebc6ba0173ee.zip
Merge branch 'bjorn/eliminate-sys_pre_expand/OTP-13856'
* bjorn/eliminate-sys_pre_expand/OTP-13856: Remove sys_pre_expand xref: Eliminate use of sys_pre_expand debugger: Eliminate use of sys_pre_expand compiler: Eliminate use of sys_pre_expand shell_SUITE: Eliminate references to sys_pre_expand in comments qlc_pt: Simplify code because of updated erl_expand_records Teach erl_expand_records to translate module-less calls erl_internal: Add add_predefined_functions/1 cover: Remove always stale comment
Diffstat (limited to 'lib/stdlib/src/qlc_pt.erl')
-rw-r--r--lib/stdlib/src/qlc_pt.erl9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/stdlib/src/qlc_pt.erl b/lib/stdlib/src/qlc_pt.erl
index 0db63b81f4..869b003668 100644
--- a/lib/stdlib/src/qlc_pt.erl
+++ b/lib/stdlib/src/qlc_pt.erl
@@ -1870,7 +1870,8 @@ prep_expr(E, F, S, BF, Imported) ->
unify_column(Frame, Var, Col, BindFun, Imported) ->
A = anno0(),
- Call = {call,A,{atom,A,element},[{integer,A,Col}, {var,A,Var}]},
+ Call = {call,A,{remote,A,{atom,A,erlang},{atom,A,element}},
+ [{integer,A,Col}, {var,A,Var}]},
element_calls(Call, Frame, BindFun, Imported).
%% cons_tuple is used for representing {V1, ..., Vi | TupleTail}.
@@ -1880,6 +1881,8 @@ unify_column(Frame, Var, Col, BindFun, Imported) ->
%% about the size of the tuple is known.
element_calls({call,_,{remote,_,{atom,_,erlang},{atom,_,element}},
[{integer,_,I},Term0]}, F0, BF, Imported) when I > 0 ->
+ %% Note: erl_expand_records ensures that all calls to element/2
+ %% have an explicit "erlang:" prefix.
TupleTail = unique_var(),
VarsL = [unique_var() || _ <- lists:seq(1, I)],
Vars = VarsL ++ TupleTail,
@@ -1887,10 +1890,6 @@ element_calls({call,_,{remote,_,{atom,_,erlang},{atom,_,element}},
VarI = lists:nth(I, VarsL),
{Term, F} = element_calls(Term0, F0, BF, Imported),
{VarI, unify('=:=', Tuple, Term, F, BF, Imported)};
-element_calls({call,L1,{atom,_,element}=E,As}, F0, BF, Imported) ->
- %% erl_expand_records should add "erlang:"...
- element_calls({call,L1,{remote,L1,{atom,L1,erlang},E}, As}, F0, BF,
- Imported);
element_calls(T, F0, BF, Imported) when is_tuple(T) ->
{L, F} = element_calls(tuple_to_list(T), F0, BF, Imported),
{list_to_tuple(L), F};