mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-03-15 09:20:23 -07:00
New separate pass for assigning numbers to labels.
This commit is contained in:
parent
2dd36d0118
commit
ddc638fde4
3 changed files with 23 additions and 2 deletions
|
|
@ -34,8 +34,8 @@
|
|||
(when (plusp (tag-ref form))
|
||||
(let ((label (tag-label form)))
|
||||
(unless label
|
||||
(setf (tag-label form) (setf label (next-label))))
|
||||
(wt-label (tag-label form)))))
|
||||
(error "No label for tag ~A" form))
|
||||
(wt-label label))))
|
||||
((c1form-p form)
|
||||
(pprint-c1form form)
|
||||
(let* ((*file* (c1form-file form))
|
||||
|
|
|
|||
|
|
@ -225,3 +225,23 @@ form in its read/set nodes, and add other consistency checks."
|
|||
(error ";;; Inconsistent form ~S form with arguments~{~&;;; ~A~}"
|
||||
(c1form-name form) args)))
|
||||
forms))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;;
|
||||
;;; ASSIGN LABELS
|
||||
;;;
|
||||
|
||||
(defun pass-assign-labels (function forms)
|
||||
(loop with *last-label* = 0
|
||||
with last = nil
|
||||
for f in forms
|
||||
do (cond ((not (tag-p f))
|
||||
(setf last nil))
|
||||
(last
|
||||
(setf (tag-label f) last
|
||||
(tag-ref f) 0))
|
||||
(t
|
||||
(setf last (next-label)
|
||||
(tag-label f) last)))
|
||||
finally (setf (fun-last-label function) *last-label*))
|
||||
forms)
|
||||
|
|
|
|||
|
|
@ -152,6 +152,7 @@
|
|||
(execute-pass 'pass-delete-no-side-effects)
|
||||
(execute-pass 'pass-delete-unused-bindings)
|
||||
(execute-pass 'pass-decide-var-rep-types)
|
||||
(execute-pass 'pass-assign-labels)
|
||||
|
||||
;; Emit entry function
|
||||
(let ((*compile-to-linking-call* nil))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue