summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorAndrea Corallo <akrl@sdf.org>2020-07-05 18:32:32 +0100
committerAndrea Corallo <akrl@sdf.org>2020-07-09 16:22:48 +0100
commit3db6ace804472ccde368e173df21484f19049317 (patch)
tree5496652b74283dbec3e589e7454fa317c6f81063 /lisp/emacs-lisp
parente6ab4e3dfe2bfc6e935b4cfa7e8f686e5d926235 (diff)
downloademacs-3db6ace804472ccde368e173df21484f19049317.tar.gz
emacs-3db6ace804472ccde368e173df21484f19049317.tar.bz2
emacs-3db6ace804472ccde368e173df21484f19049317.zip
* Define `comp-symbol-func-to-fun'
* lisp/emacs-lisp/comp.el (comp-symbol-func-to-fun): New function. (comp-func-in-unit): Make use of the `comp-symbol-func-to-fun'.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/comp.el15
1 files changed, 8 insertions, 7 deletions
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index ef9dc5ba1d6..22575e415f1 100644
--- a/lisp/emacs-lisp/comp.el
+++ b/lisp/emacs-lisp/comp.el
@@ -443,13 +443,16 @@ structure.")
finally return t)
t))
+(defsubst comp-symbol-func-to-fun (symbol-funcion)
+ "Given a function called SYMBOL-FUNCION return its `comp-func'."
+ (gethash (gethash symbol-funcion (comp-ctxt-sym-to-c-name-h
+ comp-ctxt))
+ (comp-ctxt-funcs-h comp-ctxt)))
+
(defsubst comp-function-pure-p (f)
"Return t if F is pure."
(or (get f 'pure)
- (when-let ((func (gethash (gethash f
- (comp-ctxt-sym-to-c-name-h
- comp-ctxt))
- (comp-ctxt-funcs-h comp-ctxt))))
+ (when-let ((func (comp-symbol-func-to-fun f)))
(comp-func-pure func))))
(defsubst comp-alloc-class-to-container (alloc-class)
@@ -2110,9 +2113,7 @@ Backward propagate array placement properties."
"Given FUNC return the `comp-fun' definition in the current context.
FUNCTION can be a function-name or byte compiled function."
(if (symbolp func)
- (gethash (gethash func
- (comp-ctxt-sym-to-c-name-h comp-ctxt))
- (comp-ctxt-funcs-h comp-ctxt))
+ (comp-symbol-func-to-fun func)
(cl-assert (byte-code-function-p func))
(gethash func (comp-ctxt-byte-func-to-func-h comp-ctxt))))