; primary entry-points for the frontend (in-package "VERRAZANO-FRONTEND") ; generate the intermediate representation (defun generate-intermediate-representation (cfg xml-file mac-file) (let ((dom (read-xml-nodes xml-file)) (macs (read-macros mac-file))) (convert-to-ir cfg dom macs))) ; simplify the intermediate representation (defun simplify-intermediate-representation (ir cfg) (name-anonymous-elements ir) (mark-morally-virtual-functions ir) (annotate-object-offsets ir) (unnest-definitions ir) (lower-special-functions ir) (categorize-composite-types ir) (annotate-class-vtables ir) (lift-methods ir) (disambiguate-overloading ir) (mark-artificial-types ir) (mark-node-orders ir) (when (not (member :foreign-names (configuration-options cfg))) (translate-element-names ir)) (resolve-casing-conflicts ir) (fixup-c-names ir)) ; generate an order list of definitions (defun generate-definition-queue (ir) (let ((defs (make-array 1 :fill-pointer 0))) (queue-definitions ir defs) (unmark-graph ir) (generate-ordered-queue defs))) ; queue up all the definitions in the IR (defun queue-definitions (ir defs) (apply-to-nodes #'(lambda (n) (queue-node-definitions n defs)) ir '(defines))) ; queue the definitions of a node (defun queue-node-definitions (node defs) (apply-to-outgoing #'(lambda (e) (vector-push-extend (list node e (edge-target e)) defs)) node '(defines))) ; generate an ordered queue of definitions (defun generate-ordered-queue (defs) (sort defs #'< :key #'(lambda (seqelt) (node-order (caddr seqelt)))))