aboutsummaryrefslogtreecommitdiffstats
path: root/lib/hipe/cerl
AgeCommit message (Collapse)Author
2011-12-09Merge branch 'hb/hipe/unify_optimization/OTP-9768'Hans Bolinder
* hb/hipe/unify_optimization/OTP-9768: Optimize erl_types:t_unify()
2011-12-08Merge branch 'egil/file-info-opt-utc/OTP-7687'Björn-Egil Dahlberg
* egil/file-info-opt-utc/OTP-7687: (39 commits) Remove time_t specific test in prim_file_SUITE Update prim_file.beam and prim_zip.beam Add types for posixtime_to_universaltime and the reverse Set BASEYEAR to 1902 Set lower limit of years handled to 1601 Emulate localtime, gmtime and mktime to enable negative time_t Document file:*_file_info/2 Fix compiler warning in unix_efile.c Change name of bif universaltime_to_seconds/1 Change options to prim_file:*_file_info/* Remove dead code Catch errors from prim_file:*_file_info Testcase for utc <-> seconds conversion Fix negative time in seconds_to_universaltime/1 Remove OS taint from datetime conversion Add utc <-> seconds conversions bifs Let prim_file validate ctime in file_info Teach #file_info spec unix epochs for file times Add file_info_opt tests in prim_file_SUITE unix_efile: Zero is a valid number in utime ... Conflicts: erts/emulator/beam/erl_time_sup.c erts/emulator/sys/win32/erl_win_sys.h erts/emulator/sys/win32/sys_time.c
2011-12-08Add types for posixtime_to_universaltime and the reversePatrik Nyblom
2011-12-08Optimize erl_types:t_unify()Hans Bolinder
Using a list rather than a dict() for unified variables saves quite some time. In particular Dialyzer is a heavy user of t_unify().
2011-12-05Merge branch 'sa/dialyzer-fixes'Henrik Nord
* sa/dialyzer-fixes: Correct callback spec in application module Refine warning about callback specs with extra ranges Cleanup autoimport compiler directives Fix Dialyzer's warnings in typer Fix Dialyzer's warning for its own code Fix bug in Dialyzer's behaviours analysis Fix crash in Dialyzer OTP-9776
2011-12-01Fix crash in DialyzerStavros Aronis
Variable substitution was not generalizing any unknown variables.
2011-11-30Add type info for erlang:system_info({allocator_sizes,ref(),any()})Björn Gustavsson
2011-09-29Merge branch 'dev' into majorHenrik Nord
2011-09-29Merge branch 'sa/dialyzer-bug-fixes' into devHenrik Nord
* sa/dialyzer-bug-fixes: Fix typer's crash for nonexisting files Remove unused macro Decrease tuple arity limit Fix bug in dataflow OTP-9597
2011-09-27Remove unused macroStavros Aronis
2011-09-27Decrease tuple arity limitStavros Aronis
This fixes a memory related crash.
2011-09-21Merge branch 'dev' into majorHenrik Nord
2011-09-21Merge branch 'ta/typer-quote-atoms' into devHenrik Nord
* ta/typer-quote-atoms: Update Dialyzer's reference results Quote atoms if necessary in types OTP-9560
2011-09-21Merge branch 'dev' into majorBjörn Gustavsson
* dev: erl_bif_types: Fix types for lists:key{search,find,member}/3 Fix build problems on MacOS 10.7 (Lion)
2011-09-21erl_bif_types: Fix types for lists:key{search,find,member}/3Björn Gustavsson
The types for lists:key{search,find,member}/3 was computed under the assumption that the key should be matched (=:=) to the keys in the list, while the actual implementation uses comparison (==). Thus erl_bif_types:types/4 would wrongly report that lists:keyfind(42, 1, [{42.0,a}]) would always return 'false'.
2011-09-16Merge branch 'dev' into majorBjörn-Egil Dahlberg
* dev: Cleanup ETS bif's in hipe:erl_bif_types.erl (for dialyzer) Conflicts: erts/emulator/beam/erl_db.c
2011-09-16Quote atoms if necessary in typesTomas Abrahamsson
Atoms in some occurrences were not correctly quoted when formatted to strings, for instance by the typer program. Example: -module(tb). -export(['UPPERCASE-FUNCTION-NAME'/0, f1/0, f2/0, f3/0]). -record('UPPERCASE-RECORD-NAME', {x}). -record(r2, {'UPPERCASE-FIELD-NAME'}). -type 'UPPERCASE-TYPE-NAME'() :: integer(). 'UPPERCASE-FUNCTION-NAME'() -> ok. f1() -> #'UPPERCASE-RECORD-NAME'{x=1}. f2() -> #r2{'UPPERCASE-FIELD-NAME'=1}. -spec f3() -> 'UPPERCASE-TYPE-NAME'(). f3() -> 1. Given the program above, the output from typer --plt some.plt tb.erl resulted in the following specs being printed: -spec UPPERCASE-FUNCTION-NAME() -> 'ok'. -spec f1() -> #UPPERCASE-RECORD-NAME{x::1}. -spec f2() -> #r2{UPPERCASE-FIELD-NAME::1}. -spec f3() -> UPPERCASE-TYPE-NAME(). This commit changes the output to become the following: -spec 'UPPERCASE-FUNCTION-NAME'() -> 'ok'. -spec f1() -> #'UPPERCASE-RECORD-NAME'{x::1}. -spec f2() -> #r2{'UPPERCASE-FIELD-NAME'::1}. -spec f3() -> 'UPPERCASE-TYPE-NAME'().
2011-09-12Cleanup ETS bif's in hipe:erl_bif_types.erl (for dialyzer)Patrik Nyblom
2011-09-08Merge branch 'dev' into majorHenrik Nord
2011-09-08Merge branch 'sa/dialyzer-dev' into devHenrik Nord
* sa/dialyzer-dev: Add origin information to #fun_var closures Suppress some warnings about generation of non-returning funs Enhance Dialyzer's inference on comparisons Fix infinite loop in dataflow Minor fix in dead code Update r9c/{inets,mnesia} results in dialyzer's test suite OTP-9529
2011-08-29Enhance Dialyzer's inference on comparisonsStavros Aronis
This patch makes Dialyzer aware of Erlang's total ordering of terms, enabling discrepancy detection in cases where e.g. integer() < tuple() is treated as a comparison that might also return false (when it is certain to always return true).
2011-08-27Add erlang:external_size/2 BIFFilipe David Manana
This BIF's second parameter is a list of options. Currently the only allowed option is {minor_version, Version} where version is either 0 (default) or 1.
2011-08-26Merge branch 'dev' into majorBjörn Gustavsson
* dev: code: Optimize purge/1 and soft_purge/1 using check_old_code/1 Add erlang:check_old_code/1 check_process_code/2: Quickly return 'false' if there is no old code
2011-08-25Add erlang:check_old_code/1Björn Gustavsson
Add erlang:check_old_code/1 to quickly check whether a module has old code. If there is no old code, there is no need to call erlang:check_process_code/2 for all processes, which will save some time if there are many processes.
2011-08-16emulator: Add a fourth element in exception stacktracesBjörn Gustavsson
This commit is a preparation for introducing location information (filename/line number) in stacktraces in exceptions. Currently a stack trace looks like: [{Mod1,Function1,Arity1}, . . . {ModN,FunctionN,ArityN}] Add a forth element to each tuple that can be used indication the filename and line number of the source file: [{Mod1,Function1,Arity1,Location1}, . . . {ModN,FunctionN,ArityN,LocationN}] In this commit, the fourth element will just be an empty list, and we will change all code that look at or manipulate stacktraces.
2011-07-06Remove deprecated concat_binary/1Björn Gustavsson
concat_binary/1 was deprecated in R13B04, but already in the R10B-2 release, the documentation recommends using list_to_binary/1 instead.
2011-06-20Add more specs and typesHans Bolinder
An incorrect spec, rpc:yield/1, has been fixed.
2011-05-23Fix erroneous definition of t_binary_compiled_pattern()Kostis Sagonas
While at it: 1. Moved types in their proper place 2. Did minor cleanups and 3. Took out an unused function
2011-05-02Fix handling of <<_:N,_:_*M>> type expressionsKostis Sagonas
2011-05-02Fix the argument of erlang:list_to_bitstring/1Kostis Sagonas
2011-05-02Move function to its proper placeKostis Sagonas
2011-05-02Remove unneeded function 'sequence/2'Stavros Aronis
Same functionality provided by string:join/2.
2011-03-04Merge branch 'ks/process_status' into devNiclas Axelsson
* ks/process_status: Document exiting and garbage_collecting process statuses OTP-9102
2011-03-02Document exiting and garbage_collecting process statusesKostis Sagonas
2011-01-31Sanitize the specs of the code moduleKostis Sagonas
After the addition of unicode_binary() to the file:filename() type, dialyzer started complaining about erroneous or incomplete specs in some functions of the 'code' module. The culprit was hard-coded information in erl_bif_types for functions of this module, which were not updated. Since these functions have proper specs these days and code duplication (pun intended) is never a good idea, their type information was removed from erl_bif_types. While doing this, some erroneous comments were fixed in the code module and also made sure that the code now runs without dialyzer warnings even when the -Wunmatched_returns option is used. Some cleanups were applied to erl_bif_types too.
2011-01-17Merge branch 'bjorn/beam-loader/OTP-9030' into devBjörn Gustavsson
* bjorn/beam-loader/OTP-9030: (43 commits) c: Reduce memory footprint erl_posix_msg: Reduce memory footprint Introduce a few more variations of the move instructions Combine a move + jump sequence into the move_jump instruction Optimize and clean-up the exact equality/non-equality instructions Optimize addition of a small integer to a variable Introduce a special instruction for select_val with two values Introduce a few more specialized put_list instructions Eliminate the "put_list c n Dst" instructions Eliminate the specific move_sd instruction Eliminate use of GetArg1() in the badmatch and case_end instructions Eliminate use of GetArg2() in the i_element instruction Eliminate use of GetArg1() in the fast_element instruction Eliminate use of GetArg1() in the jump_on_val* instructions Eliminate use of GetArg1() in the select_val instruction beam_emu: Eliminate sloppy use of tmp_arg1 and tmp_arg2 beam_emu: Don't inline helper functions into process_main() beam_emu: Clean up calling of the error_handler module Simplify a select_val instruction that selects only one value Optimize creation of tuples ...
2011-01-17Add erts_debug:instructions/0 for listing all specific instructionsBjörn Gustavsson
erts_debug:instructions/0 is useful for finding which specific instructions that are not used at all.
2010-12-21Merge branch 'ja/fix-hipe-spec-ets-new' into devNiclas Axelsson
2010-12-16Set types correctly for open_port({spawn_executable, ...Patrik Nyblom
2010-12-16Fix type specification of the ets:new/2 BIFJesper Louis Andersen
The options for the ets:new/2 call has changed recently. There are read_concurrency hints as well as compressed tables. The hipe/dialyzer did not take this into account. This patch corrects the problem by going through the documentation and altering the type specification. The error fixed is with the dialyzer. When constructing an ETS table with, e.g., {read_concurrency, true}, the dialyzer will report that the caller of ets:new/2 will not return. ; First, we update the documentation from the ets man page. ; Second, we reorder the type specification of keypos so they appear in the same order as in the documentation. ; Finally, we add the missing read_concurrency and compressed Tweak options.
2010-12-13Fix native code compiler infinite loop and update type info for 're'Kostis Sagonas
The introduction of filenames being unicode binaries revealed a problem in the type analysis of the native code compiler which resulted in an infinite loop when compiling the 'filename' module. In addition, the hard-coded type information for the built-in functions of the 're' module was out-of-date, which resulted in erroneous type information for 'filelib' functions being stored in the PLT.
2010-12-03Merge branch 'ks/erl_bif_types-cleanup/OTP-8961' into devPatrik Nyblom
* ks/erl_bif_types-cleanup/OTP-8961: Fix type information of 'file' and 'code' modules Conflicts: lib/hipe/cerl/erl_bif_types.erl
2010-12-03Merge branch 'pan/unicode-filenames/OTP-8887' into devPatrik Nyblom
* pan/unicode-filenames/OTP-8887: (27 commits) Test and correct filelib and filename Add documentation to erlang.xml and slight correction to unicode_usage.xml Add section about Unicode file names to stdlib users guide Correct bug in file_name_SUITE making it fail on Unix instead of Windows7 Add documentation about raw filenames and Unicode file name translation mode Make filelib not crash on re codepoints beyond 255 in re when filename is raw Mend on_load_embedded testcase which did not handle windows links Correct testcase regarding windows versions supporting soft links. Teach filelib to use re in unicode mode when filenames are not raw Treat soft links on Windows correctly in file_name_SUITE Adapt new soft and hard link routines on Windos to Unicode Corrected testcases broken by unicode filenames Update preloaded prim_file Teach prim_file not to accept atoms and not to throw exceptions Adapt inet_drv to Visual Studio 2008 Teach spawn_executable about Unicode Convert filenames read on MacOSX to canonical form Teach file to accept codepoints beyond 255. Add testcases Correct shell utilities to handle unicode and possibly binaries ...
2010-12-01Merge branch 'lukas/hipe/decode_packet_type' into devLukas Larsson
* lukas/hipe/decode_packet_type: Update httppacket type to return both strings and binaries
2010-11-30Corrected testcases broken by unicode filenamesPatrik Nyblom
Also corrected type-info for bifs
2010-11-29Fix type information of 'file' and 'code' modulesKostis Sagonas
Dialyzer for a long time now has had hard-coded type information about key functions of the 'file' and 'code' modules in 'erl_bif_types'. Some of this information was not up-to-date according to the published Erlang/OTP documentation, while some other part contained small errors. Now that specs are available, this information should be moved to the corresponding files, not be hard-coded in erl_bif_types. This change takes out all information for the 'file' module and fixes some small errors in type information for the 'code' module.
2010-11-22Merge branch 'ks/file_open-mode' into devBjörn Gustavsson
* ks/file_open-mode: Add the {encoding, _} options to file:open/2's modes
2010-11-22erl_types: Fix pretty rare crashes and an infinite loopKostis Sagonas
- Fixed pretty rare crash when taking the infimum of two tuple_sets (initial fix by Kostis Sagonas but then a better fix was provided by Stavros Aronis and this is the one adopted). - Fixed pretty rare crash when using parameterized types containing unbound variables (thanks to Nicolas Trangez for reporting it). - Fixed pretty rare infinite loop when refining the types of an SCC whose functions all returned none() (thanks to Stavros Aronis).
2010-10-29Deeper unfolding of recursive typesKostis Sagonas
The change of taking out some hard-coded information about the file module uncovered that the unfolding of recursive types was probably too shallow. This has been fixed by unfolding it until a deeper limit (REC_TYPE_LIMIT). While at erl_types.erl also did some cleanup changes and fixed an erroneous io:format message.
2010-10-15Update httppacket type to return both strings and binariesLukas Larsson