Add function for replacing IR-TERMINATOR in IBLOCK
This commit is contained in:
parent
e302493800
commit
15898ab691
1 changed files with 11 additions and 0 deletions
|
@ -24,6 +24,17 @@
|
|||
(setf (start ib) new)
|
||||
(setf (next prev-inst) new))))
|
||||
|
||||
(defun replace-terminator (old new)
|
||||
(check-type old ir-terminator)
|
||||
(check-type new ir-terminator)
|
||||
(let ((iblock (iblock old))
|
||||
(before (previous old)))
|
||||
(setf (destinations old) '()
|
||||
(next before) new
|
||||
(end iblock) new
|
||||
(iblock new) iblock
|
||||
(previous new) before)))
|
||||
|
||||
(defun yank-instruction (instruction)
|
||||
"Removes INSTRUCTIONS without cleaning up, allowing it to be put back in."
|
||||
(check-type instruction (and ir-inst (not ir-terminator)))
|
||||
|
|
Loading…
Add table
Reference in a new issue