]> git.eshelyaron.com Git - emacs.git/commitdiff
disable propagation when non locals are present
authorAndrea Corallo <akrl@sdf.org>
Sat, 28 Dec 2019 12:51:46 +0000 (13:51 +0100)
committerAndrea Corallo <akrl@sdf.org>
Wed, 1 Jan 2020 10:38:18 +0000 (11:38 +0100)
lisp/emacs-lisp/comp.el

index 9272bcc002155fcc5c610f6ce79c8b4955b170fc..f63e5842bc5e8572e4eeacb1829ca999d0d9b404 100644 (file)
@@ -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))))
 
 \f
@@ -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))))
 
 \f