;;; -*- Mode:Common-Lisp; Package:L; Base:10; Patch-file:TOP-LEVEL -*-
;;;
;;; top level patches for preasm
;;;
;;; jsp 5/10/88



;;; run the code stream through the back end
;;;
;;; 5/2: handle the possibility that the code stream has no
;;; instructions in it (newasm complains)

(defun pass-to-backend (cs)
  (let ((*asm-env* *global-fn*)
	(normal-cs cs)
	(generic-cs (generic-entry-vector cs)))
    (when *run-backend*
      (when *enable-generic-calls*
	(when generic-cs
	  (newasm generic-cs *asm-env*)))
      (when normal-cs
	(newasm normal-cs *asm-env*)))))



(defun ilcode (function &optional (fn *global-fn*) (stream t))
  (format stream "~{ ~& ~a ~}" (fn-il-nodes  (declaration-value (get-declaration function fn)))))


(defun il-code (function &optional (fn *global-fn*) (stream t))
  (fn-il-nodes  (declaration-value (get-declaration function fn))))


(defun il-dump (function &optional (fn *global-fn*) (stream t))
  (fn-il-dump  (declaration-value (get-declaration function fn))))

