aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src/compile.erl
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2014-10-28 15:25:24 +0100
committerBjörn Gustavsson <[email protected]>2015-04-30 12:14:29 +0200
commitd20cf6b7d18fd45d6c1beaa39aa87be90080f30b (patch)
tree043ef60b97f7cb426dd8a581ea4a3430e3982147 /lib/compiler/src/compile.erl
parentfe070a32f9f685ef4df1a5123e9328bb82e3947a (diff)
downloadotp-d20cf6b7d18fd45d6c1beaa39aa87be90080f30b.tar.gz
otp-d20cf6b7d18fd45d6c1beaa39aa87be90080f30b.tar.bz2
otp-d20cf6b7d18fd45d6c1beaa39aa87be90080f30b.zip
compiler: Use module erl_anno
Diffstat (limited to 'lib/compiler/src/compile.erl')
-rw-r--r--lib/compiler/src/compile.erl10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/compiler/src/compile.erl b/lib/compiler/src/compile.erl
index 5bd33c4d18..b54d125774 100644
--- a/lib/compiler/src/compile.erl
+++ b/lib/compiler/src/compile.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2015. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -41,7 +41,7 @@
-type option() :: atom() | {atom(), term()} | {'d', atom(), term()}.
--type err_info() :: {erl_scan:line() | 'none',
+-type err_info() :: {erl_anno:line() | 'none',
module(), term()}. %% ErrorDescriptor
-type errors() :: [{file:filename(), [err_info()]}].
-type warnings() :: [{file:filename(), [err_info()]}].
@@ -132,7 +132,8 @@ env_default_opts() ->
Str when is_list(Str) ->
case erl_scan:string(Str) of
{ok,Tokens,_} ->
- case erl_parse:parse_term(Tokens ++ [{dot, 1}]) of
+ Dot = {dot, erl_anno:new(1)},
+ case erl_parse:parse_term(Tokens ++ [Dot]) of
{ok,List} when is_list(List) -> List;
{ok,Term} -> [Term];
{error,_Reason} ->
@@ -1237,7 +1238,8 @@ save_abstract_code(#compile{ifile=File}=St) ->
{error,St#compile{errors=St#compile.errors ++ [{File,Es}]}}
end.
-abstract_code(#compile{code=Code,options=Opts,ofile=OFile}) ->
+abstract_code(#compile{code=Code0,options=Opts,ofile=OFile}) ->
+ Code = erl_parse:anno_to_term(Code0),
Abstr = erlang:term_to_binary({raw_abstract_v1,Code}, [compressed]),
case member(encrypt_debug_info, Opts) of
true ->