From: Andrea Corallo Date: Wed, 18 Sep 2019 22:07:10 +0000 (+0200) Subject: fix compilation for comp.el X-Git-Tag: emacs-28.0.90~2727^2~1149 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=403a7e59d5c79d81ee018fd9e648a2af744211c1;p=emacs.git fix compilation for comp.el --- diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 583a77815e9..ad64ee76183 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -396,6 +396,34 @@ If INPUT is a string this is the file path to be compiled." ;;; 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