mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-03-15 09:20:23 -07:00
Moved the functions for printing C1FORMS from cmpbackend to cmppass
This commit is contained in:
parent
f4e36b921b
commit
113b2907e4
1 changed files with 23 additions and 1 deletions
|
|
@ -61,6 +61,10 @@
|
|||
|
||||
(in-package "COMPILER")
|
||||
|
||||
(defparameter *dump-output* (open "dump.log" :direction :output
|
||||
:if-exists :supersede
|
||||
:if-does-not-exist :create))
|
||||
|
||||
(defun execute-pass (pass)
|
||||
(format *dump-output* "~&;;; Executing pass ~A" pass)
|
||||
(loop with pending = (list *top-level-forms*)
|
||||
|
|
@ -71,6 +75,24 @@
|
|||
do (setf (fun-lambda f) (funcall pass f (fun-lambda f))
|
||||
pending (append (fun-child-funs f) pending))))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;;
|
||||
;;; OUTPUT C1FORMS
|
||||
;;;
|
||||
|
||||
(defun pprint-c1form (f &optional (stream t))
|
||||
(cond ((c1form-p f)
|
||||
(format stream "~&~4T~16A~4T~{~A ~}" (c1form-name f) (c1form-args f)))
|
||||
((tag-p f)
|
||||
(format stream "~&~A / ~A:" (tag-name f) (tag-label f)))
|
||||
(t
|
||||
(format stream "~&;;; Unknown form ~A" f)))
|
||||
(force-output stream)
|
||||
f)
|
||||
|
||||
(defun pprint-c1forms (forms &optional (stream t))
|
||||
(loop for f in forms do (pprint-c1form f stream)))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;;
|
||||
;;; DELETE UNUSED FORMS
|
||||
|
|
@ -201,7 +223,7 @@ forms are also suppressed."
|
|||
(defun pass-consistency (function forms)
|
||||
"We verify that all used variables that appear in a form contain this
|
||||
form in its read/set nodes, and add other consistency checks."
|
||||
;(pprint-c1forms forms)
|
||||
(pprint-c1forms forms *dump-output*)
|
||||
(labels ((in-read-set-nodes (tree form)
|
||||
(cond ((var-p tree)
|
||||
(or (member form (var-read-nodes tree) :test #'eq)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue