1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

* Allow for modifying insn-cell inside `comp-loop-insn-in-block'

* lisp/emacs-lisp/comp.el (comp-loop-insn-in-block): Update.
This commit is contained in:
Andrea Corallo 2020-12-15 17:45:53 +01:00
parent 02551085c1
commit 23791cf74d

View file

@ -759,14 +759,15 @@ VERBOSITY is a number between 0 and 3."
(defmacro comp-loop-insn-in-block (basic-block &rest body)
"Loop over all insns in BASIC-BLOCK executing BODY.
Inside BODY `insn' can be used to read or set the current
instruction."
Inside BODY `insn' and `insn-cell'can be used to read or set the
current instruction or its cell."
(declare (debug (form body))
(indent defun))
(let ((sym-cell (gensym "cell-")))
`(cl-symbol-macrolet ((insn (car ,sym-cell)))
(cl-loop for ,sym-cell on (comp-block-insns ,basic-block)
do ,@body))))
`(cl-symbol-macrolet ((insn (car insn-cell)))
(let ((insn-cell (comp-block-insns ,basic-block)))
(while insn-cell
,@body
(setf insn-cell (cdr insn-cell))))))
;;; spill-lap pass specific code.