Age | Commit message (Collapse) | Author |
|
|
|
|
|
Some SCC info is no longer cached. It reduces the peak memory
consumption of workers during the typesig phase, and seems to cost
very little time.
|
|
The cache used for speeding up the translation from forms to types is
no longer global, but reset per module. The peak memory consumption
is reduced, and the added time seems to be small.
|
|
Using erlang:system_info(schedulers_online) for determining
parallelism is recommended by OTP experts. It takes care of "+S 4:1"
and simultaneous loading of HiPE code.
|
|
The condensed graph of SCCs occupies less ETS memory. A table
translating to and from SCC to a unique integer is introduced.
|
|
By not using ETS when calculating the condensation of graphs, peak
heap memory consumption is reduced.
|
|
The mini PLT is extended to hold all data of the full PLT, and the
full PLT is restored when needed (for storing the PLT on file).
|
|
|
|
|
|
|
|
* maint:
dialyzer: Substitute 'opacity' for 'opaqueness'
dialyzer: Improve a warning message
dialyzer: Improve a warning message
dialyzer: Correct a warnings message
|
|
Suggested by Kostis.
|
|
Messages regarding guards with orelse/andalso could look
like "Clause guard cannot succeed. The variable A was matched
against the type any()". Now they look like as if or/and is
used: "Guard test is_integer(A::atom()) can never succeed".
|
|
Messages like "Invalid type specification for function
para3:exp_adt/0. The success typing is () -> 3" now look like
"The specification for para3:exp_adt/0 has an opaque subtype
para3_adt:exp1(para3_adt:exp2()) which is violated by the success
typing () -> 3".
The old message did not give any clue as to what invalidated the
contract, namely the opaque subtype.
|
|
Messages like "The attempt to match a term of type rec_api:f()
against the variable _ breaks the opaqueness of rec_adt:f()" now
look like "The attempt to match a term of type rec_adt:f()
against the record field 'f' with type rec_api:f() breaks the
opaqueness of the term".
|
|
* maint:
dialyzer: Fix error handling of bad -dialyzer() attributes
|
|
If a dialyzer module attribute references an undefined (local)
function an error tuple is thrown but no caught. This leads to a
'nocatch' error and not the intended "clean" error.
|
|
The previous variable names can be generated by
projects like LFE and Elixir, leading to possible
conflicts. Our first to choice to solve such conflicts
was to use $ but that's not a valid variable name in core.
Therefore we picked @ which is currently supported and
still reduces the chance of conflicts.
|
|
|
|
Let it handle `dial_warning()` input as well, to match what `format_warning/2` expects.
|
|
Warnings about clauses that cannot match and are also compiler generated
are suppressed unless none of the clauses return.
This feature is useful for non-Erlang BEAM languages (such as Elixir)
that compile to Erlang and expand certain language constructs into case
statements. In that case, as long as the language construct can succeed,
these warnings are undesired and appear spurious to users that do not
check the Erlang code that their program expands into.
Thanks to José Valim for the test (slightly modified).
|
|
|
|
|
|
|
|
|
|
* stavros/dialyzer/fix_call_site_analysis/OTP-13655/PR-1092:
Fix a bug in Dialyzer related to call-site analysis
|
|
Dialyzer's "dataflow" module is using information from the callgraph to
determine which functions may be called at a particular call-site. Unfortunately
this information can include functions that are certainly not among the possible
choices. We don't want to emit warnings in such cases, so a "reasonable"
compromise is to stay silent if there are many possible funs and at least one of
them can succeed.
Bug reported by Dan Gudmundsson, test shrunk down by Magnus Lång.
|
|
Dialyzer failed to remove all loops among constraints.
|
|
* kostis/dialyzer/opaque_type/OTP-13586/PR-1047:
Declare the erl_types:var_table() type as opaque
|
|
|
|
|
|
Dialyzer's dependency calculation was throwing an error when
encountering an 'apply' node with something that was not a variable
(e.g., a literal). The rest of the code did not know what to do with
this error, which resulted in dialyzer crashing. Fix this by ingoring
the detected error in the dependency calculation phase; later dialyzer
passes know how to properly handle and report this kind of errors
anyway.
This fixes [Erlang-JIRA] (ERL-138).
|
|
and do the following changes:
in erl_types: export the type and an appropriate constructor for it
in dialyzer_contracts: perform all necessary code modifications to
fix all dialyzer warnings
Although no warnings are reported by dialyzer, it's quite possible that
these are not the only places where the opacity of the var_table() data
structure is violated. But I decided to leave these places for a better
version of dialyzer to discover...
|
|
|
|
Optimization: A few dictionaries are maps instead of dicts.
|
|
The evaluation of a single SCC has been optimized.
The parallelism when evaluating a single SCC has been removed.
|
|
* experimental/correct_dialyzer_spelling/PR-1007/OTP-13544:
Correct mispelling in Dialyzer's acronym definition
|
|
28a4a5057ab9 mistakenly used the non-existing type cerl:tree() instead
of cerl:cerl().
|
|
dialyzer_typesig:traverse/3 would perform an unsafe optimisation when
given a cons pattern that contained a map and could be folded into a
literal with cerl:fold_literal/1. In this case, when traversing the map
a type variable would be generated, but this variable would be dropped
by the erl_types:t_cons/2 constructor by in turn calling t_sup(),
producing the overapproximation any(). However, in this particular case,
dialyzer_typesig:traverse/3 is not allowed to overapproximate, since its
result is used in an EQ-constraint.
Although erl_types:t_tuple/1 does not overapproximate like t_cons/2,
which makes the bug unlikely to affect tuples too, the fix was
nevertheless applied defensively to the case of tuples as well.
Also, fix a bug where dialyzer_utils:refold_pattern/1 would generate
syntax nodes with two {label, _} attributes.
|
|
|
|
This is analogous to the case of nil. Since #{} is a base-case of almost
all map types, contract and success typing sharing #{} does not mean
much, and is often sign of a violation.
|
|
mk_constraint_list/2 was simplifying (C OR TriviallyTrue) to (C), which
is obviously wrong.
|
|
The assumption that 'try' nodes were only used to wrap entire guards is
no longer true.
We're still swallowing warnings when the handler returns successfully.
Unfortunately, bind_guard/5 would need to be refactored to return a new
state in order to generate those warnings.
|
|
Dialyzer relies heavily on the assumption that the type of a literal
that is used as a pattern is the type of any value that can match that
pattern. For maps, that is not true, and it was causing bad analysis
results. A new help function dialyzer_utils:refold_pattern/1 identifies
maps in literal patterns, and unfolds and labels them, allowing them to
be properly analysed.
|
|
|
|
|
|
"DIscrepany" is replaced with "DIscrepancy" in every occurrence.
|
|
|
|
* maint:
dialyzer: Fix a bug concerning the option 'plt_remove'
|