[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
scratch/func-type-decls e8ef297bbea 6/6: Clean-up now unnecessary 'comp-
From: |
Andrea Corallo |
Subject: |
scratch/func-type-decls e8ef297bbea 6/6: Clean-up now unnecessary 'comp-primitive-type-specifiers' |
Date: |
Fri, 23 Feb 2024 10:12:13 -0500 (EST) |
branch: scratch/func-type-decls
commit e8ef297bbeac81ff6c3fe85d022851c78051019d
Author: Andrea Corallo <acorallo@gnu.org>
Commit: Andrea Corallo <acorallo@gnu.org>
Clean-up now unnecessary 'comp-primitive-type-specifiers'
---
lisp/emacs-lisp/comp-common.el | 11 -----------
lisp/emacs-lisp/comp.el | 17 +++++++++--------
2 files changed, 9 insertions(+), 19 deletions(-)
diff --git a/lisp/emacs-lisp/comp-common.el b/lisp/emacs-lisp/comp-common.el
index 3aa0da60440..683cf9166c8 100644
--- a/lisp/emacs-lisp/comp-common.el
+++ b/lisp/emacs-lisp/comp-common.el
@@ -68,17 +68,6 @@ Used to modify the compiler environment."
:risky t
:version "28.1")
-(defconst comp-primitive-type-specifiers
- (let (res)
- (mapatoms (lambda (atom)
- (when-let ((f (symbol-function atom))
- (primitive (subr-primitive-p f))
- (type (subr-type f)))
- (push `(,atom ,type) res))))
- res)
- "Alist used for type propagation.")
-
-
(defconst comp-limple-calls '(call
callref
direct-call
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index 83130bb3a18..9da2548c54a 100644
--- a/lisp/emacs-lisp/comp.el
+++ b/lisp/emacs-lisp/comp.el
@@ -179,14 +179,15 @@ Each function in FUNCTIONS is run after PASS.
Useful to hook into pass checkers.")
(defconst comp-primitive-func-cstr-h
- (cl-loop
- with comp-ctxt = (make-comp-cstr-ctxt)
- with h = (make-hash-table :test #'eq)
- for (f type-spec) in comp-primitive-type-specifiers
- for cstr = (comp-type-spec-to-cstr type-spec)
- do (puthash f cstr h)
- finally return h)
- "Hash table function -> `comp-constraint'.")
+ (let ((comp-ctxt (make-comp-cstr-ctxt))
+ (h (make-hash-table :test #'eq)))
+ (mapatoms (lambda (atom)
+ (when-let ((f (symbol-function atom))
+ (primitive (subr-primitive-p f))
+ (type (subr-type f)))
+ (puthash f (comp-type-spec-to-cstr type) h))))
+ h)
+ "Hash table primtive -> `comp-constraint'.")
(defun comp--get-function-cstr (function)
"Given FUNCTION return the corresponding `comp-constraint'."
- scratch/func-type-decls updated (1d630a5e08a -> e8ef297bbea), Andrea Corallo, 2024/02/23
- scratch/func-type-decls 4ae6ac9788b 3/6: Rename comp-primitive-type-specifiers, Andrea Corallo, 2024/02/23
- scratch/func-type-decls acb51997524 5/6: Update C-h f, Andrea Corallo, 2024/02/23
- scratch/func-type-decls 22da320285a 4/6: Make use of Lisp function declarations in the native compiler, Andrea Corallo, 2024/02/23
- scratch/func-type-decls 45e94db72df 2/6: Move remaning declared types out of comp-known-type-specifiers, Andrea Corallo, 2024/02/23
- scratch/func-type-decls e8ef297bbea 6/6: Clean-up now unnecessary 'comp-primitive-type-specifiers',
Andrea Corallo <=
- scratch/func-type-decls 202c30af99c 1/6: Add function type declarations for Lisp functions as well, Andrea Corallo, 2024/02/23