emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

scratch/func-type-decls 4ae6ac9788b 3/6: Rename comp-primitive-type-spec


From: Andrea Corallo
Subject: scratch/func-type-decls 4ae6ac9788b 3/6: Rename comp-primitive-type-specifiers
Date: Fri, 23 Feb 2024 10:12:12 -0500 (EST)

branch: scratch/func-type-decls
commit 4ae6ac9788be9a37cb60557aadef4f8e7d99e60f
Author: Andrea Corallo <acorallo@gnu.org>
Commit: Andrea Corallo <acorallo@gnu.org>

    Rename comp-primitive-type-specifiers
---
 lisp/emacs-lisp/comp-common.el | 10 +++-------
 lisp/emacs-lisp/comp.el        |  2 +-
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/lisp/emacs-lisp/comp-common.el b/lisp/emacs-lisp/comp-common.el
index f2806c16aca..8775c233b9d 100644
--- a/lisp/emacs-lisp/comp-common.el
+++ b/lisp/emacs-lisp/comp-common.el
@@ -68,11 +68,7 @@ Used to modify the compiler environment."
   :risky t
   :version "28.1")
 
-(defconst comp-known-type-specifiers
-  ;; Functions we can trust not to be redefined, or, if redefined,
-  ;; to expose the same type.  The vast majority of these are
-  ;; either pure or primitive; the original list is the union of
-  ;; pure + side-effect-free-fns + side-effect-and-error-free-fns:
+(defconst comp-primitive-type-specifiers
   (let (res)
     (mapatoms (lambda (atom)
                 (when-let ((f (symbol-function atom))
@@ -209,10 +205,10 @@ This function returns a cons cell whose car is the 
function
 specifier, and cdr is a symbol, either `inferred' or `know'.
 If the symbol is `inferred', the type specifier is automatically
 inferred from the code itself by the native compiler; if it is
-`know', the type specifier comes from `comp-known-type-specifiers'."
+`know', the type specifier comes from `comp-primitive-type-specifiers'."
   (let ((kind 'know)
         type-spec )
-    (when-let ((res (assoc function comp-known-type-specifiers)))
+    (when-let ((res (assoc function comp-primitive-type-specifiers)))
       (setf type-spec (cadr res)))
     (let ((f (and (symbolp function)
                   (symbol-function function))))
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index 12462abea91..7440051044a 100644
--- a/lisp/emacs-lisp/comp.el
+++ b/lisp/emacs-lisp/comp.el
@@ -182,7 +182,7 @@ Useful to hook into pass checkers.")
   (cl-loop
    with comp-ctxt = (make-comp-cstr-ctxt)
    with h = (make-hash-table :test #'eq)
-   for (f type-spec) in comp-known-type-specifiers
+   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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]