| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
| |
* lisp/emacs-lisp/comp-cstr.el (comp-cstr-negation): Symplify (not
t) => nil and (not nil) => t.
* test/lisp/emacs-lisp/comp-cstr-tests.el
(comp-cstr-typespec-tests-alist): Add two tests.
|
|
|
|
|
|
|
|
|
|
|
| |
* lisp/emacs-lisp/comp-cstr.el (comp-cstr-value-negation): New
function.
* lisp/emacs-lisp/comp.el (comp-fwprop-insn): Use
`comp-cstr-value-negation'.
* test/src/comp-test-funcs.el (comp-test-45376-1-f): Rename.
(comp-test-45376-2-f): New funcion.
* test/src/comp-tests.el (bug-45376-1): Rename test.
(bug-45376-2): Add test.
|
|
|
|
|
|
|
| |
* lisp/emacs-lisp/comp-cstr.el (comp-cstr-union-homogeneous): Add
range parameter and handle the non range case.
(comp-cstr-union-1-no-mem, comp-cstr-intersection-no-mem): Update
`comp-cstr-union-homogeneous' call sites.
|
|
|
|
|
|
| |
* lisp/emacs-lisp/comp-cstr.el (comp-cstr-union-1)
(comp-cstr-intersection): Copy input before soting it into the
memoization hash table.
|
| |
|
|
|
|
|
|
|
| |
* lisp/emacs-lisp/comp-cstr.el (comp-cstr-union-1-no-mem): Logic
update.
* test/lisp/emacs-lisp/comp-cstr-tests.el
(comp-cstr-typespec-tests-alist): Add a test.
|
|
|
|
|
|
| |
* lisp/emacs-lisp/comp-cstr.el (comp-cstr-union-1-no-mem)
(comp-cstr-union-1, comp-cstr-intersection-no-mem)
(comp-cstr-intersection): Logic update.
|
|
|
|
|
|
|
| |
* lisp/emacs-lisp/comp-cstr.el (comp-cstr-intersection-no-mem):
Add logic.
* test/lisp/emacs-lisp/comp-cstr-tests.el
(comp-cstr-typespec-tests-alist): Add two tests.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lisp/emacs-lisp/comp-cstr.el (with-comp-cstr-accessors):
Simplify.
(comp-cstr-empty-p): New Funchion.
(comp-split-pos-neg): Minor.
(comp-normalize-typeset): Logic update.
(comp-union-typesets): Minor.
(comp-intersect-two-typesets): New functio.
(comp-intersect-typesets): Logic update.
(comp-range-union, comp-range-intersection): Minor.
(comp-cstr-union-homogeneous, comp-cstr-union-1-no-mem)
(comp-cstr-intersection-homogeneous)
(comp-cstr-intersection-no-mem, comp-cstr-negation)
(comp-type-spec-to-cstr, comp-cstr-to-type-spec): Logic update.
* lisp/emacs-lisp/comp-cstr.el (with-comp-cstr-accessors): Simplify.
|
|
|
|
|
|
|
|
|
| |
* lisp/emacs-lisp/comp-cstr.el (comp-cstr-ctxt): Add new slot
`intersection-mem'.
(comp-cstr-intersection-homogeneous): Fix non local exit target.
(comp-cstr-intersection-no-mem): Rename from
`comp-cstr-intersection'.
(comp-cstr-intersection): New function.
|
|
|
|
|
|
|
| |
* lisp/emacs-lisp/comp-cstr.el (comp-range-intersection): Cosmetic.
(comp-cstr-intersection-homogeneous): Rename from
`comp-cstr-intersection'.
(comp-cstr-intersection): New function.
|
|
|
|
|
|
|
|
|
|
|
| |
* lisp/emacs-lisp/comp-cstr.el (comp-normalize-valset)
(comp-union-valsets, comp-intersection-valsets)
(comp-normalize-typeset): New functions.
(comp-union-typesets, comp-intersect-typesets)
(comp-cstr-union-homogeneous-no-range, comp-cstr-union-1-no-mem):
Update to return normalized results.
* test/lisp/emacs-lisp/comp-cstr-tests.el
(comp-cstr-typespec-tests-alist): Normalize expected type specifiers.
|
|
|
|
|
| |
* lisp/emacs-lisp/comp-cstr.el (comp-split-pos-neg): New function.
(comp-cstr-union-1-no-mem): Update to call `comp-split-pos-neg'.
|
|
|
|
|
|
| |
* lisp/emacs-lisp/comp-cstr.el (comp-cstrs-homogeneous): New
function.
(comp-cstr-union-1-no-mem): Make use of.
|
|
|
|
|
| |
* lisp/emacs-lisp/comp-cstr.el (comp-cstr-union-1-no-mem): Define
a local function `give-up' as a common fall-back exit point.
|
|
|
|
|
|
|
|
|
| |
* lisp/emacs-lisp/comp-cstr.el (comp-cstr-union-1-no-mem):
Generalize disjoint pos types vs neg values conditions.
(comp-cstr-union-1-no-mem): Do not propagate ranges when we are
already returning integer as generic type.
* test/lisp/emacs-lisp/comp-cstr-tests.el
(comp-cstr-typespec-tests-alist): Add corresponding tests.
|
|
|
|
|
|
|
|
|
|
| |
* lisp/emacs-lisp/comp-cstr.el (comp-cstr): Do not synthesize the
copier.
(comp-cstr-ctxt): Add `union-1-mem-no-range' `union-1-mem-range'
slots.
(comp-cstr-copy): New function.
(comp-cstr-union-1-no-mem): Rename from `comp-cstr-union-1'.
(comp-cstr-union-1): New function.
|
|
|
|
|
|
|
| |
* lisp/emacs-lisp/comp-cstr.el (comp-cstr-union-1): Better handle
mixed positive/negated cases.
* test/lisp/emacs-lisp/comp-cstr-tests.el
(comp-cstr-typespec-tests-alist): Add a number of tests.
|
|
|
|
|
|
|
| |
* lisp/emacs-lisp/comp-cstr.el (comp-star-or-num-p): New predicate.
(comp-type-spec-to-cstr): Make use of.
(comp-cstr-to-type-spec): Output correctly type specifiers
as (not (or integer ...
|
|
|
|
|
|
| |
* lisp/emacs-lisp/comp-cstr.el (comp-cstr-union-1): Fix logic.
* test/lisp/emacs-lisp/comp-cstr-tests.el
(comp-cstr-typespec-tests-alist): Add a couple of tests.
|
|
|
|
|
| |
* lisp/emacs-lisp/comp-cstr.el (with-comp-cstr-accessors): New macro.
(comp-cstr-union-1): Make use of `with-comp-cstr-accessors'.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lisp/emacs-lisp/comp-cstr.el (comp-range-negation): New
function.
(comp-cstr-union-homogeneous-no-range): Rename from
`comp-cstr-union-no-range'.
(comp-cstr-union-homogeneous): Rename from `comp-cstr-union'.
(comp-cstr-union-1): New function.
(comp-cstr-union-no-range, comp-cstr-union): Rewrite in function
of `comp-cstr-union-1'.
* test/lisp/emacs-lisp/comp-cstr-tests.el
(comp-cstr-typespec-tests-alist): Add a bunch of tests.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* lisp/emacs-lisp/comp-cstr.el (comp-cstr): Add `neg' slot.
(comp-range-negation, comp-cstr-negation)
(comp-cstr-negation-make): New functions.
(comp-type-spec-to-cstr): Enable `not` in type specifiers.
(comp-cstr-to-type-spec): Update logic to handle negation.
* test/lisp/emacs-lisp/comp-cstr-tests.el
(comp-cstr-typespec-tests-alist): Add a test.
|
| |
|
|
As the constraint logic of the compiler is not trivial and largely
independent from the rest of the code move it into comp-cstr.el to
ease separation and maintainability.
This commit improve the conversion type
specifier -> constraint for generality.
Lastly this should help with bootstrap time as comp.el compilation
unit is slimmed down.
* lisp/emacs-lisp/comp-cstr.el: New file.
(comp--typeof-types, comp--all-builtin-types): Move from comp.el.
(comp-cstr, comp-cstr-f): Same + rename.
(comp-cstr-ctxt): New struct.
(comp-supertypes, comp-common-supertype-2)
(comp-common-supertype, comp-subtype-p, comp-union-typesets)
(comp-range-1+, comp-range-1-, comp-range-<, comp-range-union)
(comp-range-intersection): Move from comp.el.
(comp-cstr-union-no-range, comp-cstr-union): Move from comp.el and
rename.
(comp-cstr-union-make): New function.
(comp-type-spec-to-cstr, comp-cstr-to-type-spec): Move from
comp.el, rename it and rework it.
* lisp/emacs-lisp/comp.el (comp-known-func-cstr-h): Rework.
(comp-ctxt): Remove two fields and include `comp-cstr-ctxt'.
(comp-mvar, comp-fwprop-call): Update for `comp-cstr' being
renamed.
(comp-fwprop-insn): Use `comp-cstr-union-no-range' or
`comp-cstr-union'.
(comp-ret-type-spec): Use `comp-cstr-union' and rework.
* test/lisp/emacs-lisp/comp-cstr-tests.el: New file.
(comp-cstr-test-ts, comp-cstr-typespec-test): New functions.
(comp-cstr-typespec-tests-alist): New defconst to generate tests
on.
(comp-cstr-generate-tests): New macro.
* test/src/comp-tests.el (comp-tests-type-spec-tests): Update.
(ret-type-spec): Initialize constraint context.
|