aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib
diff options
context:
space:
mode:
authorZandra Hird <[email protected]>2015-05-20 15:10:18 +0200
committerZandra Hird <[email protected]>2015-05-20 15:10:18 +0200
commitec906eeb9cd9a2debc7d10962e087d790a14b31c (patch)
treed951696f1739d76925ceb0953f06c0ad1a8050eb /lib/stdlib
parent9b06ba5eaaf9cab35d77b81cba6c760af0f9556a (diff)
parent5f5ce84d0f85faba7f9f26059a08a2ba9122f524 (diff)
downloadotp-ec906eeb9cd9a2debc7d10962e087d790a14b31c.tar.gz
otp-ec906eeb9cd9a2debc7d10962e087d790a14b31c.tar.bz2
otp-ec906eeb9cd9a2debc7d10962e087d790a14b31c.zip
Merge branch 'josevalim/jv-nowarn-bif-clash'
* josevalim/jv-nowarn-bif-clash: Cache nowarn_bif_clash functions in erl_lint OTP-12754
Diffstat (limited to 'lib/stdlib')
-rw-r--r--lib/stdlib/src/erl_lint.erl8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/stdlib/src/erl_lint.erl b/lib/stdlib/src/erl_lint.erl
index 821d81a6b4..c68ec601bf 100644
--- a/lib/stdlib/src/erl_lint.erl
+++ b/lib/stdlib/src/erl_lint.erl
@@ -120,6 +120,7 @@ value_option(Flag, Default, On, OnVal, Off, OffVal, Opts) ->
func=[], %Current function
warn_format=0, %Warn format calls
enabled_warnings=[], %All enabled warnings (ordset).
+ nowarn_bif_clash=[], %All no warn bif clashes (ordset).
errors=[], %Current errors
warnings=[], %Current warnings
file = "" :: string(), %From last file attribute
@@ -569,6 +570,7 @@ start(File, Opts) ->
warn_format = value_option(warn_format, 1, warn_format, 1,
nowarn_format, 0, Opts),
enabled_warnings = Enabled,
+ nowarn_bif_clash = nowarn_function(nowarn_bif_clash, Opts),
file = File
}.
@@ -772,8 +774,7 @@ eof(_Line, St0) ->
%% bif_clashes(Forms, State0) -> State.
-bif_clashes(Forms, St) ->
- Nowarn = nowarn_function(nowarn_bif_clash, St#lint.compile),
+bif_clashes(Forms, #lint{nowarn_bif_clash=Nowarn} = St) ->
Clashes0 = [{Name,Arity} || {function,_L,Name,Arity,_Cs} <- Forms,
erl_internal:bif(Name, Arity)],
Clashes = ordsets:subtract(ordsets:from_list(Clashes0), Nowarn),
@@ -3781,8 +3782,7 @@ is_autoimport_suppressed(NoAutoSet,{Func,Arity}) ->
gb_sets:is_element({Func,Arity},NoAutoSet).
%% Predicate to find out if a function specific bif-clash suppression (old deprecated) is present
bif_clash_specifically_disabled(St,{F,A}) ->
- Nowarn = nowarn_function(nowarn_bif_clash, St#lint.compile),
- lists:member({F,A},Nowarn).
+ lists:member({F,A},St#lint.nowarn_bif_clash).
%% Predicate to find out if an autoimported guard_bif is not overriden in some way
%% Guard Bif without module name is disallowed if