aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrea Corallo2024-02-23 16:05:19 +0100
committerAndrea Corallo2024-02-23 16:10:33 +0100
commite8ef297bbeac81ff6c3fe85d022851c78051019d (patch)
tree6870df403c849a61540a2fd511b20d138070f70a
parentacb519975247ff2656737774fa3d7dcf98faccaa (diff)
downloademacs-scratch/func-type-decls.tar.gz
emacs-scratch/func-type-decls.zip
Clean-up now unnecessary 'comp-primitive-type-specifiers'scratch/func-type-decls
-rw-r--r--lisp/emacs-lisp/comp-common.el11
-rw-r--r--lisp/emacs-lisp/comp.el17
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."
68 :risky t 68 :risky t
69 :version "28.1") 69 :version "28.1")
70 70
71(defconst comp-primitive-type-specifiers
72 (let (res)
73 (mapatoms (lambda (atom)
74 (when-let ((f (symbol-function atom))
75 (primitive (subr-primitive-p f))
76 (type (subr-type f)))
77 (push `(,atom ,type) res))))
78 res)
79 "Alist used for type propagation.")
80
81
82(defconst comp-limple-calls '(call 71(defconst comp-limple-calls '(call
83 callref 72 callref
84 direct-call 73 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.
179Useful to hook into pass checkers.") 179Useful to hook into pass checkers.")
180 180
181(defconst comp-primitive-func-cstr-h 181(defconst comp-primitive-func-cstr-h
182 (cl-loop 182 (let ((comp-ctxt (make-comp-cstr-ctxt))
183 with comp-ctxt = (make-comp-cstr-ctxt) 183 (h (make-hash-table :test #'eq)))
184 with h = (make-hash-table :test #'eq) 184 (mapatoms (lambda (atom)
185 for (f type-spec) in comp-primitive-type-specifiers 185 (when-let ((f (symbol-function atom))
186 for cstr = (comp-type-spec-to-cstr type-spec) 186 (primitive (subr-primitive-p f))
187 do (puthash f cstr h) 187 (type (subr-type f)))
188 finally return h) 188 (puthash f (comp-type-spec-to-cstr type) h))))
189 "Hash table function -> `comp-constraint'.") 189 h)
190 "Hash table primtive -> `comp-constraint'.")
190 191
191(defun comp--get-function-cstr (function) 192(defun comp--get-function-cstr (function)
192 "Given FUNCTION return the corresponding `comp-constraint'." 193 "Given FUNCTION return the corresponding `comp-constraint'."