]> git.eshelyaron.com Git - emacs.git/commitdiff
fix compilation for comp.el
authorAndrea Corallo <akrl@sdf.org>
Wed, 18 Sep 2019 22:07:10 +0000 (00:07 +0200)
committerAndrea Corallo <akrl@sdf.org>
Wed, 1 Jan 2020 10:37:50 +0000 (11:37 +0100)
lisp/emacs-lisp/comp.el

index 583a77815e9f625cdbb6095fc5e853d4c146fcf6..ad64ee76183188e074aa10941a3b48cdc765fb78 100644 (file)
@@ -396,6 +396,34 @@ If INPUT is a string this is the file path to be compiled."
 \f
 ;;; Limplification pass specific code.
 
+(defmacro comp-sp ()
+  "Current stack pointer."
+  '(comp-limplify-sp comp-pass))
+
+(defmacro comp-with-sp (sp &rest body)
+  "Execute BODY setting the stack pointer to SP.
+Restore the original value afterwards."
+  (declare (debug (form body))
+           (indent defun))
+  (let ((sym (gensym)))
+    `(let ((,sym (comp-sp)))
+       (setf (comp-sp) ,sp)
+       (progn ,@body)
+       (setf (comp-sp) ,sym))))
+
+(defmacro comp-slot-n (n)
+  "Slot N into the meta-stack."
+  (declare (debug (form)))
+  `(aref (comp-limplify-frame comp-pass) ,n))
+
+(defmacro comp-slot ()
+  "Current slot into the meta-stack pointed by sp."
+  '(comp-slot-n (comp-sp)))
+
+(defmacro comp-slot+1 ()
+  "Slot into the meta-stack pointed by sp + 1."
+  '(comp-slot-n (1+ (comp-sp))))
+
 (cl-defstruct (comp-limplify (:copier nil))
   "Support structure used during function limplification."
   (sp 0 :type fixnum
@@ -445,34 +473,6 @@ If INPUT is a string this is the file path to be compiled."
            do (aset v i mvar)
            finally (return v)))
 
-(defmacro comp-sp ()
-  "Current stack pointer."
-  '(comp-limplify-sp comp-pass))
-
-(defmacro comp-with-sp (sp &rest body)
-  "Execute BODY setting the stack pointer to SP.
-Restore the original value afterwards."
-  (declare (debug (form body))
-           (indent defun))
-  (let ((sym (gensym)))
-    `(let ((,sym (comp-sp)))
-       (setf (comp-sp) ,sp)
-       (progn ,@body)
-       (setf (comp-sp) ,sym))))
-
-(defmacro comp-slot-n (n)
-  "Slot N into the meta-stack."
-  (declare (debug (form)))
-  `(aref (comp-limplify-frame comp-pass) ,n))
-
-(defmacro comp-slot ()
-  "Current slot into the meta-stack pointed by sp."
-  '(comp-slot-n (comp-sp)))
-
-(defmacro comp-slot+1 ()
-  "Slot into the meta-stack pointed by sp + 1."
-  '(comp-slot-n (1+ (comp-sp))))
-
 (defun comp-emit (insn)
   "Emit INSN into current basic block."
   (push insn (comp-block-insns comp-block)))
@@ -1111,7 +1111,7 @@ Top level forms for the current context are rendered too."
              (cl-loop for insn in (comp-block-insns bb)
                       when (and (comp-assign-op-p (car insn))
                                 (= slot-n (comp-mvar-slot (cadr insn))))
-                      do (return t))))
+                      do (cl-return t))))
 
     (cl-loop for i from 0 below (comp-func-frame-size comp-func)
              ;; List of blocks with a definition of mvar i