aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dialyzer/src
AgeCommit message (Collapse)Author
2017-04-26dialyzer: Fix a bug regarding unknown typesHans Bolinder
Since commit 12b3790 Dialyzer has not reported unknown types.
2017-03-10Update copyright yearRickard Green
2017-03-06Merge branch 'hasse/dialyzer/fix_warnings/OTP-14177' into maintHans Bolinder
* hasse/dialyzer/fix_warnings/OTP-14177: dialyzer: Improve a warning dialyzer: Fix a weird warning dialyzer: Fix an opaque bug dialyzer: Minor fix
2017-03-02dialyzer, observer: Use portable lookup of home directoryBjörn Gustavsson
Use init:get_argument(home) to find the location of the home directory. That will work on all platforms (including Windows). Note that the run-time system will fail to start if HOME (or the equivalent on Windows) is not set. Therefore, it can be assumed that init:get_argument(home) will not fail. ERL-161
2017-03-02dialyzer: Update runtime dependenciesHans Bolinder
2017-02-28dialyzer: Fix an opaque bugHans Bolinder
An opaque bug that would crash Dialyzer has been fixed. The bug was reported by Nick Marino.
2017-02-28dialyzer: Minor fixHans Bolinder
2017-02-03dialyzer: Fix a Dialyzer warningHans Bolinder
2017-02-01dialyzer: Optimize typesigHans Bolinder
dialyzer_typesig:traverse_scc() now resets the context for each element of the SCC. Since the results of traversing the elements are saved in the 'cmap' table, there is no need to create an SCC conjunction. For huge SCCs this saves quite some time: the lift_lists() function added one element at a time, which made the calculation of deps very slow.
2017-02-01dialyzer: Optimize evaluation of complex codeHans Bolinder
Improve the evaluation of long lists of constraints.
2017-01-11dialyzer: Compact 'file' annotations in Core codeHans Bolinder
File annotations {file, File} in Core Erlang code is replaced by {file, FakeFile}, where FakeFile is "0", "1", ..., in order to save memory. When a warning message is created, FakeFile is translated to the original File (a bit awkward but easy to do). The Core code stored in ETS tables needs less space, but more important is that a less heap memory is used in the dataflow, warnings, and typesig phases, allowing more parallelism.
2017-01-11dialyzer: Try to reduce memory usageHans Bolinder
The translation from forms to types is done in a separate process in an attempt to reduce peak memory usage. Expect further optimizations as it is probably not feasible in the long run to keep all type information on the heap.
2017-01-11dialyzer: Use less memory when translating contractsHans Bolinder
2017-01-11dialyzer: Use maps instaed of dictHans Bolinder
2017-01-11dialyzer: Use maps instead of dict for module contracts mapHans Bolinder
2017-01-11dialyzer: Compress a few more ETS tablesHans Bolinder
2017-01-11dialyzer: Optimize memory consumptionHans Bolinder
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.
2017-01-11dialyzer: Reduce memory consumption during 'remote' phaseHans Bolinder
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.
2017-01-11dialyzer: Update code for finding parallelismHans Bolinder
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.
2017-01-11dialyzer: Reduce ETS usage during the typesig phaseHans Bolinder
The condensed graph of SCCs occupies less ETS memory. A table translating to and from SCC to a unique integer is introduced.
2017-01-11dialyzer: Optimize graph condensationHans Bolinder
By not using ETS when calculating the condensation of graphs, peak heap memory consumption is reduced.
2017-01-11dialyzer: Do not send full PLTs as messagesHans Bolinder
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).
2016-12-07Update copyright-yearErlang/OTP
2016-11-22dialyzer: Substitute 'opacity' for 'opaqueness'Hans Bolinder
Suggested by Kostis.
2016-11-22dialyzer: Improve a warning messageHans Bolinder
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".
2016-11-22dialyzer: Improve a warning messageHans Bolinder
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.
2016-11-22dialyzer: Correct a warnings messageHans Bolinder
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".
2016-10-21dialyzer: Fix error handling of bad -dialyzer() attributesHans Bolinder
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.
2016-08-31dialyzer: Remove a check that always failsHans Bolinder
2016-07-26Improve format_warning/1 specBrujo Benavides
Let it handle `dial_warning()` input as well, to match what `format_warning/2` expects.
2016-07-04dialyzer: Suppress warns on generated case stmtsMagnus Lång
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).
2016-06-09dialyzer: Minor adjustmentsHans Bolinder
2016-06-09dialyzer: Suppress unmatched_return for send/2Hans Bolinder
2016-06-09dialyzer: Use a cache when translating forms to typesHans Bolinder
2016-06-09dialyzer: Correct typesHans Bolinder
2016-06-09Merge branch 'stavros/dialyzer/fix_call_site_analysis/OTP-13655/PR-1092'Hans Bolinder
* stavros/dialyzer/fix_call_site_analysis/OTP-13655/PR-1092: Fix a bug in Dialyzer related to call-site analysis
2016-06-08Fix a bug in Dialyzer related to call-site analysisStavros Aronis
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.
2016-06-08Dialyzer: Fix a bug that caused Dialyzer to go into an infinite loop.Hans Bolinder
Dialyzer failed to remove all loops among constraints.
2016-05-16Merge branch 'kostis/dialyzer/opaque_type/OTP-13586/PR-1047'Hans Bolinder
* kostis/dialyzer/opaque_type/OTP-13586/PR-1047: Declare the erl_types:var_table() type as opaque
2016-05-13Use the newly defined types in a record declarationKostis Sagonas
2016-05-13Strengthen the spec of analyze/1Kostis Sagonas
2016-05-13Fix dependency calculation when encountering an erroneous 'apply'Kostis Sagonas
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).
2016-05-04Declare the erl_types:var_table() type as opaqueKostis Sagonas
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...
2016-05-04dialyzer: Update runtime dependenciesHans Bolinder
2016-05-04dialyzer: Use maps instead of dictHans Bolinder
Optimization: A few dictionaries are maps instead of dicts.
2016-05-04dialyzer: Optimize the evaluation of SCC:s in module typesigHans Bolinder
The evaluation of a single SCC has been optimized. The parallelism when evaluating a single SCC has been removed.
2016-05-04Merge branch 'experimental/correct_dialyzer_spelling/PR-1007/OTP-13544'Hans Bolinder
* experimental/correct_dialyzer_spelling/PR-1007/OTP-13544: Correct mispelling in Dialyzer's acronym definition
2016-04-28dialyzer_typesig: Fix bad external typeMagnus Lång
28a4a5057ab9 mistakenly used the non-existing type cerl:tree() instead of cerl:cerl().
2016-04-28dialyzer: Fix another pattern literal bugMagnus Lång
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.
2016-04-28dialyzer: Improve map pattern typesettingMagnus Lång