aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrea Corallo2024-05-05 23:16:20 +0200
committerAndrea Corallo2024-05-05 23:58:31 +0200
commit77f87d4b489fcb332fc3d8d3d4a8080e7e1818fd (patch)
tree6995843ab1e3513ef39a6a4de79cfba4363b3827
parent44036b32ba398cf284320285b60be35874b6eea5 (diff)
downloademacs-77f87d4b489fcb332fc3d8d3d4a8080e7e1818fd.tar.gz
emacs-77f87d4b489fcb332fc3d8d3d4a8080e7e1818fd.zip
Fix intra compilation unit function type declaration
* lisp/emacs-lisp/comp.el (comp-func): Add 'slot'. (comp--intern-func-in-ctxt): Update. (comp--get-function-cstr): Update.
-rw-r--r--lisp/emacs-lisp/comp.el9
1 files changed, 7 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index d7cd6b79c86..b1e4b77ae40 100644
--- a/lisp/emacs-lisp/comp.el
+++ b/lisp/emacs-lisp/comp.el
@@ -194,8 +194,10 @@ Useful to hook into pass checkers.")
194 (when (symbolp function) 194 (when (symbolp function)
195 (let ((f (symbol-function function))) 195 (let ((f (symbol-function function)))
196 (or (gethash f comp-primitive-func-cstr-h) 196 (or (gethash f comp-primitive-func-cstr-h)
197 (when-let ((res (function-get function 'function-type))) 197 (when-let ((type (or (when-let ((f (comp--symbol-func-to-fun function)))
198 (comp-type-spec-to-cstr (car res))))))) 198 (comp-func-declared-type f))
199 (function-get function 'function-type))))
200 (comp-type-spec-to-cstr type))))))
199 201
200;; Keep it in sync with the `cl-deftype-satisfies' property set in 202;; Keep it in sync with the `cl-deftype-satisfies' property set in
201;; cl-macs.el. We can't use `cl-deftype-satisfies' directly as the 203;; cl-macs.el. We can't use `cl-deftype-satisfies' directly as the
@@ -523,6 +525,8 @@ CFG is mutated by a pass.")
523 :documentation "Optimization level (see `native-comp-speed').") 525 :documentation "Optimization level (see `native-comp-speed').")
524 (pure nil :type boolean 526 (pure nil :type boolean
525 :documentation "t if pure nil otherwise.") 527 :documentation "t if pure nil otherwise.")
528 (declared-type nil :type list
529 :documentation "Declared function type.")
526 (type nil :type (or null comp-mvar) 530 (type nil :type (or null comp-mvar)
527 :documentation "Mvar holding the derived return type.")) 531 :documentation "Mvar holding the derived return type."))
528 532
@@ -821,6 +825,7 @@ clashes."
821 (comp-func-lap func) lap 825 (comp-func-lap func) lap
822 (comp-func-frame-size func) (comp--byte-frame-size byte-func) 826 (comp-func-frame-size func) (comp--byte-frame-size byte-func)
823 (comp-func-speed func) (comp--spill-speed name) 827 (comp-func-speed func) (comp--spill-speed name)
828 (comp-func-declared-type func) (car (comp--spill-decl-spec name 'function-type))
824 (comp-func-pure func) (comp--spill-decl-spec name 'pure)) 829 (comp-func-pure func) (comp--spill-decl-spec name 'pure))
825 830
826 ;; Store the c-name to have it retrievable from 831 ;; Store the c-name to have it retrievable from