summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/comp.el
diff options
context:
space:
mode:
authorAndrea Corallo <akrl@sdf.org>2019-12-28 13:51:46 +0100
committerAndrea Corallo <akrl@sdf.org>2020-01-01 11:38:18 +0100
commitf0290502f3354f9ed7e8ec84c24ac13a7bad2fc0 (patch)
treea45ff0e42676a40c2e6cc34905f92aeb45d34607 /lisp/emacs-lisp/comp.el
parent4946ed48fee637eba75b674b9ad568b9df26bac9 (diff)
downloademacs-f0290502f3354f9ed7e8ec84c24ac13a7bad2fc0.tar.gz
emacs-f0290502f3354f9ed7e8ec84c24ac13a7bad2fc0.tar.bz2
emacs-f0290502f3354f9ed7e8ec84c24ac13a7bad2fc0.zip
disable propagation when non locals are present
Diffstat (limited to 'lisp/emacs-lisp/comp.el')
-rw-r--r--lisp/emacs-lisp/comp.el32
1 files changed, 18 insertions, 14 deletions
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index 9272bcc0021..f63e5842bc5 100644
--- a/lisp/emacs-lisp/comp.el
+++ b/lisp/emacs-lisp/comp.el
@@ -1609,13 +1609,15 @@ Return t if something was changed."
(defun comp-propagate (_)
(when (>= comp-speed 2)
(maphash (lambda (_ f)
- (let ((comp-func f))
- (comp-basic-const-propagate)
- (cl-loop
- for i from 1
- while (comp-propagate*)
- finally (comp-log (format "Propagation run %d times\n" i) 2))
- (comp-log-func comp-func 3)))
+ ;; FIXME remove the following condition when tested.
+ (unless (comp-func-has-non-local f)
+ (let ((comp-func f))
+ (comp-basic-const-propagate)
+ (cl-loop
+ for i from 1
+ while (comp-propagate*)
+ finally (comp-log (format "Propagation run %d times\n" i) 2))
+ (comp-log-func comp-func 3))))
(comp-ctxt-funcs-h comp-ctxt))))
@@ -1780,13 +1782,15 @@ These are substituted with a normal 'set' op."
(when (>= comp-speed 2)
(maphash (lambda (_ f)
(let ((comp-func f))
- (cl-loop
- for i from 1
- while (comp-dead-assignments-func)
- finally (comp-log (format "dead code rm run %d times\n" i) 2)
- (comp-log-func comp-func 3))
- (comp-remove-type-hints-func)
- (comp-log-func comp-func 3)))
+ ;; FIXME remove the following condition when tested.
+ (unless (comp-func-has-non-local comp-func)
+ (cl-loop
+ for i from 1
+ while (comp-dead-assignments-func)
+ finally (comp-log (format "dead code rm run %d times\n" i) 2)
+ (comp-log-func comp-func 3))
+ (comp-remove-type-hints-func)
+ (comp-log-func comp-func 3))))
(comp-ctxt-funcs-h comp-ctxt))))