aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dialyzer/src
AgeCommit message (Collapse)Author
2015-06-18Change license text to APLv2Bruce Yinhe
2015-06-18dialyzer: Expand opaque types before other typesHans Bolinder
Opaque types need to be expanded before record field types, otherwise any() could be used for opaque types.
2015-06-15dialyzer: Simplify some codeHans Bolinder
Remove what it seems redundant checks.
2015-06-15dialyzer: Fix a bug in the expansion of formsHans Bolinder
The check that a modified type of a field is a subtype of the declared type has been moved outside of the expansion of forms to avoid loops.
2015-05-29Merge branch 'legoscia/dialyzer/cache-hipe-binaries/OTP-12779'Björn Gustavsson
* legoscia/dialyzer/cache-hipe-binaries/OTP-12779: Dialyzer to cache results of HiPE compilation Change hipe_bifs:system_crc/1 to hipe_bifs:system_crc/0
2015-05-28Dialyzer to cache results of HiPE compilationMagnus Henoch
Cache the results of native compilation in $XDG_CACHE_HOME/dialyzer_hipe_cache. This can reduce the startup time significantly. If XDG_CACHE_HOME is unset, it defaults to $HOME/.cache. See the XDG Base Directory spec for more details: http://standards.freedesktop.org/basedir-spec/basedir-spec-0.7.html Under that directory, create a subdirectory called ARCH-VERSION-CHECKSUM, where ARCH is the HiPE architecture, VERSION is the HiPE version number, and CHECKSUM is the return value of hipe_bifs:system_crc/0. Caching can be disabled by specifying --no_native_cache on the command line.
2015-05-25Update runtime_dependencies in application resource filesHans Bolinder
Applications that use the new erl_anno module are depending on STDLIB 2.5. Note that CosNotification, Megaco, SNMP, Xmerl, and Parsetools use the erl_anno module via the Yecc parsers only (the header file in lib/parsetools/include/yeccpre.hrl calls the erl_anno module). HiPE does not call the erl_anno module, but uses an exported type. We have chosen to make HiPE dependent on the erl_anno module.
2015-05-20dialyzer: Document dialyzer:gui() option 'check_plt'Hans Bolinder
* Mention the option 'check_plt' among gui() options. * No longer check a PLT twice when the analysis type is 'plt_check'. * No longer raise a case_clause error when checking a PLT finds warnings. Thanks to James Fish.
2015-05-05Fix a bug related to constraints generated for erlang:'*'/2Stavros Aronis
For Rst = A1 * A2, typesig for erlang:'*'/2 was constraining the arguments A1 and A2 in the 'reverse' direction by requiring that A2 is a subtype of Rst div A1, unless A1 is a hard zero. This is not correct: if for example both Rst and A1 are non_negative, such a constraint will first force A1 to be non-zero for the division to go through and then require A2 to be non_negative as non_negative div positive = non_negative, always (see commited test). In the fixed version, we are not constraining an argument if the other operand *may* be zero.
2015-04-30dialyzer: Use module erl_annoHans Bolinder
2015-04-27dialyzer: Add new option 'unknown'Hans Bolinder
Replace the undocumented option 'no_unknown' with the documented option 'unknown'.
2015-04-27dialyzer: Add new option 'no_missing_calls'Hans Bolinder
2015-04-01dialyzer: Update the PLT properly when a module is changedHans Bolinder
Thanks to James Fish for the bug report, and to Stavros Aronis for fixing the bug.
2015-03-20Merge branch 'rickard/time_api/OTP-11997'Rickard Green
* rickard/time_api/OTP-11997: (22 commits) Update primary bootstrap inets: Suppress deprecated warning on erlang:now/0 inets: Cleanup of multiple copies of functions Add inets_lib with common functions used by multiple modules inets: Update comments Suppress deprecated warning on erlang:now/0 Use new time API and be back-compatible in inets Remove unused functions and removed redundant test asn1 test SUITE: Eliminate use of now/0 Disable deprecated warning on erlang:now/0 in diameter_lib Use new time API and be back-compatible in ssh Replace all calls to now/0 in CT with new time API functions test_server: Replace usage of erlang:now() with usage of new API Replace usage of erlang:now() with usage of new API Replace usage of erlang:now() with usage of new API Replace usage of erlang:now() with usage of new API Replace usage of erlang:now() with usage of new API otp_SUITE: Warn for calls to erlang:now/0 Replace usage of erlang:now() with usage of new API Multiple timer wheels Erlang based BIF timer implementation for scalability Implement ethread events with timeout ... Conflicts: bootstrap/bin/start.boot bootstrap/bin/start_clean.boot bootstrap/lib/compiler/ebin/beam_asm.beam bootstrap/lib/compiler/ebin/compile.beam bootstrap/lib/kernel/ebin/auth.beam bootstrap/lib/kernel/ebin/dist_util.beam bootstrap/lib/kernel/ebin/global.beam bootstrap/lib/kernel/ebin/hipe_unified_loader.beam bootstrap/lib/kernel/ebin/inet_db.beam bootstrap/lib/kernel/ebin/inet_dns.beam bootstrap/lib/kernel/ebin/inet_res.beam bootstrap/lib/kernel/ebin/os.beam bootstrap/lib/kernel/ebin/pg2.beam bootstrap/lib/stdlib/ebin/dets.beam bootstrap/lib/stdlib/ebin/dets_utils.beam bootstrap/lib/stdlib/ebin/erl_tar.beam bootstrap/lib/stdlib/ebin/escript.beam bootstrap/lib/stdlib/ebin/file_sorter.beam bootstrap/lib/stdlib/ebin/otp_internal.beam bootstrap/lib/stdlib/ebin/qlc.beam bootstrap/lib/stdlib/ebin/random.beam bootstrap/lib/stdlib/ebin/supervisor.beam bootstrap/lib/stdlib/ebin/timer.beam erts/aclocal.m4 erts/emulator/beam/bif.c erts/emulator/beam/erl_bif_info.c erts/emulator/beam/erl_db_hash.c erts/emulator/beam/erl_init.c erts/emulator/beam/erl_process.h erts/emulator/beam/erl_thr_progress.c erts/emulator/beam/utils.c erts/emulator/sys/unix/sys.c erts/preloaded/ebin/erlang.beam erts/preloaded/ebin/erts_internal.beam erts/preloaded/ebin/init.beam erts/preloaded/src/erts_internal.erl lib/common_test/test/ct_hooks_SUITE_data/cth/tests/empty_cth.erl lib/diameter/src/base/diameter_lib.erl lib/kernel/src/os.erl lib/ssh/test/ssh_basic_SUITE.erl system/doc/efficiency_guide/advanced.xml
2015-03-20Replace usage of erlang:now() with usage of new APIRickard Green
2015-03-18Merge branch 'maint'Björn-Egil Dahlberg
2015-03-17dialyzer: Add missing clause for map in find_terminalsBjörn-Egil Dahlberg
Reported-by: Ali Sabil
2015-03-10[dialyzer] Correct handling of limited opaque typesHans Bolinder
2015-03-10[dialyzer] Fix the conversion of forms to typesHans Bolinder
In particular fix handling of records.
2015-01-14dialyzer: Introduce module local suppression of warningsHans Bolinder
The -dialyzer() attribute can be used for suppressing warnings in a module by specifying functions or warning options. It can also be used for requesting warnings in a module.
2014-10-21dialyzer: remove recognition of the compiler option 'asm'Hans Bolinder
The compiler option 'asm' has been replaced by 'from_asm' in Erlang/OTP 18.0.
2014-10-10Merge branch 'maint'Hans Bolinder
* maint: dialyzer: do a minor re-factoring dialyzer: Ignore ERL_COMPILER_OPTIONS when compiling dialyzer: fix bug concerning compiler option 'warnings_as_errors'
2014-10-08dialyzer: do a minor re-factoringHans Bolinder
A minor re-factoring and generalization.
2014-10-08dialyzer: Ignore ERL_COMPILER_OPTIONS when compilingHans Bolinder
If, for instance, 'warn_unused_import' is present in ERL_COMPILER_OPTIONS then many files in Erlang/OTP (Kernel, STDLIB, ...) cannot be analyzed by Dialyzer since the option is not present when compiling Erlang/OTP, but 'warnings_as_errors' is. The case that ERL_COMPILER_OPTIONS contains 'warnings_as_errors' can only be handled by ignoring ERL_COMPILER_OPTIONS.
2014-10-08dialyzer: fix bug concerning compiler option 'warnings_as_errors'Hans Bolinder
A typical scenario: the type digraph() is used in R16 (compilation with the option 'warnings_as_errors' results in no warning); then the module is analyzed by a 17 Dialyzer where digraph() is obsolete, and since the warning is turned into an error Dialyzer fails to load the module. Thanks to Michael Truog.
2014-09-09Merge branch 'maint'Henrik Nord
2014-09-09Merge branch 'fishcakez/dialyzer_beam_opts' into maintHenrik Nord
* fishcakez/dialyzer_beam_opts: Use compile options when dialyzing beam files
2014-08-21Merge branch 'maint'Hans Bolinder
* maint: dialyzer, hipe: Fix a bug concerning is_record/2,3
2014-08-21dialyzer, hipe: Fix a bug concerning is_record/2,3Hans Bolinder
Also fixed some cases where Dialyzer could crash due to reaching system limits.
2014-08-21Merge branch 'maint'Hans Bolinder
* maint: dialyzer: fix a -Wunderspecs bug
2014-08-20dialyzer: fix a -Wunderspecs bugHans Bolinder
Sometimes bogus warnings were generated for parametrized types. Thanks to Krzesimir Sarnecki for pointing the bug out. Also corrected warnings where the structure of opaque types were exposed (thanks to Kostis for pointing the bug out).
2014-07-16Use compile options when dialyzing beam filesJames Fish
Fetch the compile options from beam files, and use them when creating core from the abstract code. Previously the options were ignored. Test by Henrik Nordh
2014-06-17Merge branch 'maint'Hans Bolinder
* maint: [dialyzer] Correct a doc bug introduced in 0b041238 [dialyzer] Use the option 'dialyzer' to control the compiler [dialyzer] Fix handling of literal records
2014-06-17[dialyzer] Use the option 'dialyzer' to control the compilerHans Bolinder
2014-06-17[dialyzer] Fix handling of literal recordsHans Bolinder
This ticket is about records in Erlang code, and when to check the fields against the (optional) types given when defining records. Dialyzer operates on the Erlang Core format, where there are no trace of records. The fix implemented is a Real Hack: Given the new option 'dialyzer' erl_expand_records marks the line number of records in a way that is undone by v3_core, which in turn inserts annotations that can be recognized by Dialyzer.
2014-06-03Merge branch 'maint'Hans Bolinder
* maint: [dialyzer] Correct docs about options
2014-06-03[dialyzer] Correct docs about optionsHans Bolinder
2014-05-13Merge branch 'maint'Hans Bolinder
* maint: hipe: fix a bug concerning typed record fields
2014-05-13hipe: fix a bug concerning typed record fieldsHans Bolinder
When checking typed record fields Dialyzer failed to handle types containing remote types. Thanks to Erik Søe Sørensen for reporting this bug.
2014-05-05Remove pre-defined types dict(), digraph(), &cHans Bolinder
The pre-defined types array(), dict(), digraph(), gb_set(), gb_tree(), queue(), set(), and tid() have been removed.
2014-04-28Introduce the attribute -optional_callbacks in the context of behavioursHans Bolinder
2014-04-10Correct the name of a compiler option and fix the corresponding warningsKostis Sagonas
The option `warn_export_vars` was erroneously written as `warn_exported_vars` in Makefiles of dialyzer and typer. As a result, `erlc` was silent about such warnings (why on earth doesn't it complain on unrecognized options??) which were corrected as part of this change.
2014-03-31Merge branch 'ks/hipe-is_map-support/OTP-11831'Björn-Egil Dahlberg
* ks/hipe-is_map-support/OTP-11831: Reinstate native code compilation of cerl and erl_types Take out no_native compiler attribute Add support for the compilation of the is_map/1 guard to native code Add 'map' to the set of icode_type_test()s Support the translation of the is_map BEAM instruction to Icode
2014-03-28Reinstate native code compilation of cerl and erl_typesKostis Sagonas
2014-03-28Report wall clock time instead of runtime when crashingKostis Sagonas
On SMPs, the time reports that Dialyzer produced when crashing were inaccurate. Fix this by using wall_clock rather than runtime.
2014-03-28Dialyzer now plays nicely with funs that come as "external" argumentsStavros Aronis
Two steps are needed to make this work: 1) Avoid generating the additional "apply_constraint" in dialyzer_typesig by reporting every function argument as a potential external function (patch on dialyzer_dep). This will produce correct success typings for all functions in the test case, but dataflow would miss the key warnings that help identify the bugs. 2) Patch dialyzer_dataflow so that it uses the "handle just external" path as a fallback whenever there are any external calls. As a result, if we have info about some paths, then: a) use the old "handle known apply" code to mark these functions as used and b) ignore the generalized result and use the one found by typesig for the return value of the apply itself.
2014-03-24Correct some type declarationsKostis Sagonas
The types of some record fields were wrong. This file uses some module local format of race warnings and when the analysis is done transforms this format into the format of general dialyzer warnings. This change fixes the type declaration of the race_warning field of the #races{} record which was wrong. In addition, declared the type of the state field in some other record that, long ago, could not be declared since mutually recursive types were not supported by Dialyzer's analysis.
2014-03-24Use the ordsets:ordset(T) type instead of defining a local oneKostis Sagonas
2014-03-21dialyzer: generalize guard constraints in a new wayHans Bolinder
Guard constraints used to be limited to a certain depth, which handled mutually depending constraints safely, but also sometimes introduced unnecessary generalizations. This patch puts no explicit limit upon guard constraints (other than those that already exist in erl_types), but breaks cycles by replacing variables with the any() type. In some cases the old method resulted in more warnings, but since the limit was quite arbitrary and mutually depending guard constraints are (very) rare, the new method should been seen as an improvement since it handles cases that used to make Dialyzer loop or miss warnings.
2014-03-20Introduce runtime_dependencies in .app filesRickard Green
Most dependencies introduced are exactly the dependencies to other applications found by xref. That is, there might be real dependencies missing. There might also be pure debug dependencies listed that probably should be removed. Each application has to be manually inspected in order to ensure that all real dependencies are listed. All dependencies introduced are to application versions used in OTP 17.0. This since the previously used version scheme wasn't designed for this, and in order to minimize the work of introducing the dependencies.