Commit graph

80 commits

Author SHA1 Message Date
Eli Zaretskii
acfd261a61 Merge from origin/emacs-29
0d8b69e0ad Don't ding when completion succeeded
f11e2d3699 ; * admin/git-bisect-start: Update failing commits
9855a3ea74 ; * src/xdisp.c (redisplay_tool_bar): Fix a typo in a com...
f4ee696b88 Improve documentation of color-related functions
90eadc3e23 Revert "* package.el (package--get-activatable-pkg): Pref...
65f355ea0a ; Update my mail address
a3a69ec234 Fix connection-local user options handling (bug#63300)
240803cc3e Document 'startup-redirect-eln-cache'
026afb2298 ; * etc/PROBLEMS: Entry about crashes due to anti-virus (...
bcc222251e Fix `emacs-lisp-native-compile-and-load' for C-h f (bug#5...
07c8211ca3 Add 'infer' as a keyword to typescript-ts-mode (bug#63880)
dd2d8ff2f5 ; * etc/NEWS: Mention the issue with PGTK on WSL (bug#633...
fa8135f891 Revert changes to the order in which package descs are lo...
27fcfa2c0a ; * etc/NEWS: Improve instructions for grammar libraries.
2a84ab905c Handle point in last file-name component in minibuffer co...
05f25238b7 Merge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/...
4bc043ff45 Avoid asking redundant question in emacsbug.el
2eadf328d0 * test/infra/Dockerfile.emba (emacs-base): Don't install ...
583ba1db7e typescript-ts-mode: Add a rule for function_signature

# Conflicts:
#	etc/NEWS
#	lisp/minibuffer.el
2023-06-10 06:42:43 -04:00
Andrea Corallo
65f355ea0a ; Update my mail address
* lisp/emacs-lisp/comp-cstr.el: Update author mail.
* lisp/emacs-lisp/comp.el: Likewise.
* src/comp.c: Likewise.
* test/lisp/emacs-lisp/comp-cstr-tests.el: Likewise.
* test/src/comp-resources/comp-test-funcs-dyn.el: Likewise.
* test/src/comp-resources/comp-test-funcs.el: Likewise.
* test/src/comp-resources/comp-test-pure.el: Likewise.
* test/src/comp-tests.el: Likewise.
2023-06-08 11:04:10 +02:00
Andrea Corallo
5d3d84066f * lisp/emacs-lisp/comp-cstr.el (cl-macs): Require it. 2023-06-04 16:43:13 +02:00
Andrea Corallo
9ed24bfb04 * Have `comp-cstr-to-type-spec' handle comp-cstr-f as well
* lisp/emacs-lisp/comp-cstr.el (comp--simple-cstr-to-type-spec): New
function.
(comp-cstr-to-type-spec): Make use of.
2023-06-04 12:53:38 +02:00
Andrea Corallo
56a8d57d03 comp: Recompute type slots after byte compilation for user types
* lisp/emacs-lisp/comp-cstr.el (comp--compute-typeof-types)
(comp--compute--pred-type-h): New functions.
(comp-cstr-ctxt): Make use of.
(comp-cstr-ctxt-update-type-slots): New function.

* lisp/emacs-lisp/comp.el (comp-spill-lap): Use
`comp-cstr-ctxt-update-type-slots'.
2023-05-29 18:04:30 +02:00
Andrea Corallo
6c781b5d25 comp: Propagate pre slot access type check
* lisp/loadup.el (max-lisp-eval-depth): Increase
`max-lisp-eval-depth' to 3400.

* lisp/emacs-lisp/comp.el (comp-add-cond-cstrs): Pattern match pre
slot access type check and add constraint.

* lisp/emacs-lisp/comp-cstr.el (comp-cstr-cl-tag-p)
(comp-cstr-cl-tag): New functions.

* lisp/emacs-lisp/comp.el (make-comp-mvar): Add neg parameter.
2023-05-23 16:39:06 +02:00
Andrea Corallo
d03dd07774 comp: Make use of predicates in propagation for non builtin types
* lisp/emacs-lisp/comp-cstr.el (comp-cstr-ctxt): Add `pred-type-h'
slot.
* lisp/emacs-lisp/comp.el (comp-known-predicate-p)
(comp-pred-to-cstr): Update.
2023-05-23 16:39:06 +02:00
Andrea Corallo
92ccb6ba83 comp: Account non builtin types in type hierarchy
* lisp/emacs-lisp/cl-macs.el (cl--struct-all-parents): Add comment.

* lisp/emacs-lisp/cl-preloaded.el (cl--struct-get-class): Likewise.

* lisp/emacs-lisp/comp-cstr.el (comp--cl-class-hierarchy)
(comp--all-classes): New functions.
(comp-cstr-ctxt): Add `typeof-types' field.

* lisp/emacs-lisp/comp-cstr.el (comp-supertypes)
(comp-union-typesets): Update to use non builtin types.
2023-05-23 16:39:05 +02:00
Stefan Kangas
4f9862e435 ; Fix typo 2023-02-18 13:39:28 +01:00
Eli Zaretskii
cae528457c ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
Stefan Kangas
db2ed9f333 ; Fix several symbol name typos 2022-10-26 23:04:23 +02:00
Andrea Corallo
0bd96806ef * Rename `comp--typeof-builtin-types'
* lisp/emacs-lisp/comp-cstr.el (comp--typeof-builtin-types): Rename.
(comp-normalize-valset, comp-common-supertype-2): Update.
2022-08-18 23:41:39 +02:00
Andrea Corallo
715f1ebea3 * lisp/emacs-lisp/comp-cstr.el (comp--all-builtin-types): Remove 2022-08-18 23:36:19 +02:00
Andrea Corallo
2ba42e596a ; Fix two mail addresses
;* lisp/emacs-lisp/comp.el: Fix author's mail address.
;* lisp/emacs-lisp/comp-cstr.el: Likewise.
2022-05-16 09:54:15 +02:00
Stefan Kangas
35bf8d4a02 Merge from origin/emacs-28
69e82968d7 Fix integer arithmetic miss-compilation (bug#53451)
31af9bca99 Mark flymake as compatible with emacs-26.1
2022-02-10 06:56:22 +01:00
Andrea Corallo
69e82968d7 Fix integer arithmetic miss-compilation (bug#53451)
* lisp/emacs-lisp/comp-cstr.el (comp-cstr-set-range-for-arithm):
When one of the two sources is negated revert to set dst as
number.
* test/src/comp-tests.el (comp-tests-type-spec-tests): Add test to
verify this is effective.
2022-02-09 17:58:57 +01:00
Eli Zaretskii
dcd76bd48d Merge from origin/emacs-28
836be7a112 ; * etc/refcards/ru-refcard.tex: Update Copyright year.
86cbc6ee4a * lisp/net/tramp-sh.el: Adapt copyright year
ebe8772f65 ; Minor fixes related to copyright years
23c1ee6989 ; * test/manual/etags/ETAGS.good_N: Adjust to copyright ye...
8d3fc7ec89 * src/xfaces.c (face_for_font): Make 'hash' be uintptr_t.
19dcb237b5 ; Add 2022 to copyright years.

# Conflicts:
#	etc/NEWS
#	etc/refcards/ru-refcard.tex
#	lib/cdefs.h
#	lisp/erc/erc-dcc.el
#	lisp/erc/erc-imenu.el
#	lisp/erc/erc-replace.el
#	lisp/image-dired.el
#	lisp/progmodes/xref.el
#	m4/alloca.m4
#	m4/byteswap.m4
#	m4/errno_h.m4
#	m4/getopt.m4
#	m4/gnulib-common.m4
#	m4/inttypes.m4
#	m4/stddef_h.m4
#	m4/stdint.m4
#	m4/sys_socket_h.m4
2022-01-01 07:03:03 -05:00
Eli Zaretskii
19dcb237b5 ; Add 2022 to copyright years. 2022-01-01 02:45:51 -05:00
Andrea Corallo
fd86829e66 Make use of `comp-cstr-shallow-copy'
* lisp/emacs-lisp/comp.el (comp-mvar-propagate): Remove.
(comp-fwprop-call, comp-fwprop-insn): Use `comp-cstr-shallow-copy'.

* lisp/emacs-lisp/comp-cstr.el (comp-cstr-set-cmp-range)
(comp-cstr-union-1-no-mem, comp-cstr-union-1)
(comp-cstr-intersection-no-mem, comp-cstr-intersection)
(comp-cstr-negation): Use `comp-cstr-shallow-copy'.
2021-12-01 22:21:04 +01:00
Andrea Corallo
f3284d5acd * Redefine `comp-cstr-shallow-copy'
* lisp/emacs-lisp/comp-cstr.el (comp-cstr): Don't synthesize copier
function.
(comp-cstr-shallow-copy): New function.
(comp-cstr-=): Use `copy-sequence'.
2021-12-01 22:21:04 +01:00
Lars Ingebrigtsen
85e9e5f616 Don't quote nil and t in doc strings and comments
* test/src/minibuf-tests.el (test-try-completion-ignore-case):
* test/lisp/url/url-auth-tests.el
(url-auth-test-digest-auth-retrieve-cache):
* test/lisp/subr-tests.el (subr-tests-add-hook-depth):
* test/lisp/so-long-tests/so-long-tests.el
(so-long-tests-invisible-buffer-function):
* test/lisp/emacs-lisp/tabulated-list-test.el (tabulated-list-sort):
* src/xfaces.c:
* src/process.c (Finterrupt_process):
(syms_of_process):
* src/minibuf.c (Fread_from_minibuffer):
(Fcompleting_read):
(syms_of_minibuf):
* src/dispnew.c (syms_of_display):
* src/data.c:
* lisp/so-long.el (so-long--hack-local-variables):
* lisp/progmodes/elisp-mode.el (elisp--xref-find-definitions):
(elisp--xref-find-definitions):
* lisp/org/ox-html.el (org-html-htmlize-output-type):
* lisp/org/org-agenda.el (org-agenda-do-in-region):
* lisp/net/tramp.el:
* lisp/minibuffer.el (set-minibuffer-message):
* lisp/isearch.el (isearch-wrap-pause):
(isearch-repeat-on-direction-change):
* lisp/emacs-lisp/timer.el (timer):
* lisp/emacs-lisp/package.el (package-read-archive-contents):
* lisp/emacs-lisp/faceup.el (faceup-next-property-change):
* lisp/emacs-lisp/comp.el (comp-func):
* lisp/emacs-lisp/comp-cstr.el (comp-cstr-empty-p):
* lisp/emacs-lisp/cl-macs.el (cl-do):
(cl-do*):
(cl--self-tco):
* lisp/emacs-lisp/bytecomp.el (byte-compile-unresolved-functions):
(byte-compile-cond-jump-table): Don't quote t and nil.
2021-09-21 22:11:43 +02:00
Stefan Kangas
0cabf8bc36 ; Fix typos 2021-09-03 13:05:32 +02:00
Andrea Corallo
39ebc2689b * Improve `comp-normalize-valset' reproducibility (bug#48021)
* lisp/emacs-lisp/comp-cstr.el (comp-normalize-valset): Make
	it more reproducible.
2021-04-29 21:07:07 +02:00
Andrea Corallo
4e1e0b9dec Have `comp-cstr-intersection-no-mem' intersect pos neg value sets
* lisp/emacs-lisp/comp-cstr.el (comp-cstr-intersection-no-mem):
	intersect pos and neg value sets
	* test/lisp/emacs-lisp/comp-cstr-tests.el
	(comp-cstr-typespec-tests-alist): Add two tests and fix some
	test number.
2021-04-27 22:58:41 +02:00
Andrea Corallo
40c71e574a * lisp/emacs-lisp/comp-cstr.el (comp-ctxt): Initialize it. 2021-04-26 23:13:41 +02:00
Andrea Corallo
edf42af2cc Rework where `comp-ctxt' is defined.
* test/lisp/emacs-lisp/comp-cstr-tests.el (comp-ctxt): Remove
	`comp-ctxt' definition.
	* lisp/emacs-lisp/comp.el (comp-ctxt): Likewise.
	* lisp/emacs-lisp/comp-cstr.el (comp-ctxt): Define it here.
2021-04-26 23:01:39 +02:00
Glenn Morris
b7c22fab7d ; Add 2021 to copyright years 2021-04-25 17:24:48 -07:00
Andrea Corallo
70adc28e97 * lisp/emacs-lisp/comp-cstr.el (comp-cstr-union-1-no-mem): (not null) => t. 2021-04-13 12:05:33 +02:00
Andrea Corallo
3062480309 * lisp/emacs-lisp/comp-cstr.el (comp-normalize-valset): Remove duplicates. 2021-04-13 12:05:33 +02:00
Andrea Corallo
08682ccc31 ; Remove two unnecessary quotes
* lisp/emacs-lisp/comp-cstr.el (comp-cstr-=): Remove unnecessary
	quote.
	* lisp/emacs-lisp/comp.el (comp-compile-ctxt-to-file): Likewise.
2021-03-21 09:28:25 +01:00
Andrea Corallo
9809f7ed2c Use `length=' and family where possible in native comp code
* lisp/emacs-lisp/comp-cstr.el (comp-intersect-typesets)
	(comp-cstr-imm): Use Use `length=' and family where possible.
	* lisp/emacs-lisp/comp.el (comp-add-cond-cstrs-target-block)
	(comp-compute-dominator-frontiers)
	(batch-byte-native-compile-for-bootstrap): Likewise.
2021-03-07 21:33:53 +01:00
Andrea Corallo
c60f2f458a Fix `comp-cstr-intersection-no-hashcons' for negated result cstr
* lisp/emacs-lisp/comp-cstr.el
	(comp-cstr-intersection-no-hashcons): When negated and
	necessary relax dst to t.
	* test/src/comp-tests.el (comp-tests-type-spec-tests): Add a test.
2021-03-06 23:17:14 +01:00
Andrea Corallo
05259c4a23 Fix `=' propagation to handle -0.0 0.0 case
* lisp/emacs-lisp/comp-cstr.el
	(comp-cstr-intersection-homogeneous): Fix indent + use `memql'.
	(comp-cstr-=): Handle 0.0 -0.0 idiosyncrasy
	* test/src/comp-tests.el (comp-tests-type-spec-tests): Add two
	tests and fix enumeration.
2021-03-06 20:38:00 +01:00
Andrea Corallo
0c5ba41b72 Fix two compiler ICEs dealing with nan and infinity
* lisp/emacs-lisp/comp-cstr.el (comp-cstr-=): Don't crash when
	truncate fails.
	* test/src/comp-test-funcs.el (comp-test-=-nan): Add two functions
	to be compiled.
2021-03-03 20:36:12 +01:00
Andrea Corallo
8c7228e8cd Fix = propagation semantic for constrained inputs
* lisp/emacs-lisp/comp-cstr.el (comp-cstr): Synthesize
	`comp-cstr-shallow-copy'.
	(comp-cstr-=): Relax inputs before intersecting them.
	* test/src/comp-tests.el (comp-tests-type-spec-tests): Add three
	tests.
2021-03-02 14:36:09 +01:00
Andrea Corallo
3d014e1bf4 Fix eql' equal' propagation of non hash consed values (bug#46843)
Extend assumes allowing the following form:

(assume dst (and-nhc src1 src2))

`and-nhc' assume operator allow for constraining correctly
intersections where non hash consed values are not propagated as
values but rather promoted to their types.

	* lisp/emacs-lisp/comp-cstr.el
	(comp-cstr-intersection-no-hashcons): New function.
	* lisp/emacs-lisp/comp.el (comp-emit-assume): Logic update to emit
	`and-nhc' operator (implemented in fwprop by
	`comp-cstr-intersection-no-hashcons').
	(comp-add-cond-cstrs): Map `eq' to `and' assume operator and
	`equal' `eql' into `and-nhc'.
	(comp-fwprop-insn): Update to handle `and-nhc'.
	* test/src/comp-tests.el (comp-tests-type-spec-tests): Add two
	tests covering `eql' and `equal' propagation of non hash consed
	values.
2021-03-01 18:09:40 +01:00
Andrea Corallo
5bc08559e8 Don't treat '=' as simple equality emitting constraints (bug#46812)
Extend assumes allowing the following form

(assume dst (= src1 src2))

to caputure '=' semanting during fwprop handling float integer
conversions.

	* lisp/emacs-lisp/comp.el (comp-equality-fun-p): Don't treat '=' as
	simple equality.
	(comp-arithm-cmp-fun-p, comp-negate-arithm-cmp-fun)
	(comp-reverse-arithm-fun): Rename and add '=' '!='.
	(comp-emit-assume, comp-add-cond-cstrs, comp-fwprop-insn): Update
	for new function nameing and to handle '='.
	* lisp/emacs-lisp/comp-cstr.el (comp-cstr-=): New function.
	* test/src/comp-tests.el (comp-tests-type-spec-tests): Add a bunch
	of '=' specific tests.
2021-02-28 23:30:03 +01:00
Andrea Corallo
2acc46b55b Migrate and rename a bunch of functions from comp.el to comp-cstr.el
* lisp/emacs-lisp/comp-cstr.el (comp-cstr-imm-vld-p)
	(comp-cstr-imm, comp-cstr-fixnum-p, comp-cstr-symbol-p)
	(comp-cstr-cons-p): Move and rename from 'comp.el'.
	* lisp/emacs-lisp/comp.el (comp-mvar-type-hint-match-p)
	(make-comp-mvar, comp-emit-assume, comp-fwprop-prologue)
	(comp-function-foldable-p, comp-function-call-maybe-fold)
	(comp-fwprop-call, comp-fwprop-insn, comp-call-optim-func)
	(comp-compute-function-type): Update for renamed functions.
	* src/comp.c (emit_mvar_rval): Likewise.
	* test/src/comp-tests.el (comp-tests-mentioned-p-1)
	(comp-tests-cond-rw-checker-val): Likewise.
2021-02-28 23:29:49 +01:00
Andrea Corallo
d6227f6edc * Fix union constraint for mixed pos/neg constraints
* lisp/emacs-lisp/comp-cstr.el (comp-cstr-union-1-no-mem): Fix neg
	type shadowing pos values.
	* test/lisp/emacs-lisp/comp-cstr-tests.el
	(comp-cstr-typespec-tests-alist): Add testcase.
	* test/src/comp-tests.el (comp-tests-type-spec-tests): Fix testcase.
2021-02-22 13:59:56 +01:00
Andrea Corallo
1fe5994bcb Fix inverted logic in constraint comparison (bug#46540)
* lisp/emacs-lisp/comp-cstr.el (comp-cstr->, comp-cstr->=)
	(comp-cstr-<, comp-cstr-<=): Fix inverted logic.
	* test/src/comp-tests.el (comp-tests-type-spec-tests): Add
	three integer constrain tests.
2021-02-17 22:03:41 +01:00
Andrea Corallo
0ffb3dfaa4 Do not add unnecesary arg constraints (bug#45812 bug#45705 bug#45751).
These have the effect of bloating the IR for no effect killing compile
time.  The typical cases for that are extremely long backuoted lists.

	* lisp/emacs-lisp/comp-cstr.el (comp-cstr-t): New var.
	* lisp/emacs-lisp/comp.el (comp-add-call-cstr): No need to add
	arg call constraints if this is t.
2021-01-19 21:58:53 +01:00
Andrea Corallo
5074447ef4 Fix type inference for bug#45635
* lisp/emacs-lisp/comp-cstr.el (comp-cstr-union-1-no-mem): Fix
	missing mixed pos neg handling.
	* test/lisp/emacs-lisp/comp-cstr-tests.el
	(comp-cstr-typespec-tests-alist): Add a test.
	* test/src/comp-tests.el (45635): New testcase.
	* test/src/comp-test-funcs.el (comp-test-45635-f): New function.
2021-01-04 22:31:40 +01:00
Andrea Corallo
43d0e8483e Fix `functionp' contraining (bug#45576)
* lisp/emacs-lisp/comp.el (comp-known-predicates)
	(comp-known-predicates-h): New constants.
	(comp-known-predicate-p, comp-pred-to-cstr): New functions.
	* lisp/emacs-lisp/cl-macs.el (cl-deftype-satisfies): Don't define.
	* test/src/comp-tests.el (comp-test-45576): New testcase.
	* test/src/comp-test-funcs.el (comp-test-45576-f): New function.
2021-01-02 13:07:41 +01:00
Andrea Corallo
e9f5fadb0e * Fix two predicates for missing negation handling
* lisp/emacs-lisp/comp-cstr.el (comp-cstr-empty-p)
	(comp-cstr-null-p): Fix missing negation handling.
2021-01-01 12:29:50 +01:00
Andrea Corallo
a3b816ff8c * lisp/emacs-lisp/comp-cstr.el (comp-cstr): Better `comp-value-to-cstr'. 2020-12-29 17:49:30 +01:00
Andrea Corallo
c4efb49a27 Constrain mvars under compare and branch with built-in predicates
* lisp/emacs-lisp/comp.el (comp-emit-assume): Update.
	(comp-known-predicate-p): New function.
	(comp-add-cond-cstrs): Extend to pattern match predicate calls.
	* lisp/emacs-lisp/comp-cstr.el (comp-cstr-null-p)
	(comp-pred-to-cstr): New function.
	* test/src/comp-tests.el (comp-tests-type-spec-tests): Add a
	number of tests and fix comments.
2020-12-29 17:49:30 +01:00
Andrea Corallo
ba41a183dd * lisp/emacs-lisp/comp-cstr.el (comp-cstr): Better `comp-type-to-cstr'. 2020-12-29 14:46:23 +01:00
Andrea Corallo
42fb6de0b3 Add 1+ 1- integer range propagation support
* lisp/emacs-lisp/comp-cstr.el (comp-cstr-one): New special var.
	* lisp/emacs-lisp/comp.el (comp-fwprop-call): Propagate integer
	ranges on +1 -1.
	* test/src/comp-tests.el (comp-tests-type-spec-tests): Add two tests.
2020-12-27 21:50:34 +01:00
Andrea Corallo
7d07a71841 Add sum/subtraction integer range propagation support
* lisp/emacs-lisp/comp-cstr.el (comp-range-+, comp-range--): New
	functions.
	(comp-cstr-set-range-for-arithm): New macro.
	(comp-cstr-add-2, comp-cstr-sub-2, comp-cstr-add, comp-cstr-sub):
	New function.
	* lisp/emacs-lisp/comp.el (comp-fwprop-call): Wire-up + - integer
	range propagation.
2020-12-27 21:34:03 +01:00
Andrea Corallo
92af4e8fc9 * lisp/emacs-lisp/comp-cstr.el (comp-cstr-set-cmp-range): Improve. 2020-12-27 21:33:42 +01:00