X-Git-Url: https://git.distorted.org.uk/~mdw/sod/blobdiff_plain/75dbacfca91031ad04d2464926239e329ffc5ca4..ed00691544c3b6d4ad15b1c7ef975964ea72b0b6:/src/codegen-proto.lisp diff --git a/src/codegen-proto.lisp b/src/codegen-proto.lisp index 743c89f..7c8f65c 100644 --- a/src/codegen-proto.lisp +++ b/src/codegen-proto.lisp @@ -49,7 +49,7 @@ ;; Root class. -(export 'temporary-name) +(export '(temporary-name temp-tag)) (defclass temporary-name () ((tag :initarg :tag :reader temp-tag)) (:documentation @@ -74,6 +74,8 @@ (make-instance 'temporary-name :tag "sod__ap")) (defparameter *sod-master-ap* (make-instance 'temporary-name :tag "sod__master_ap")) +(defparameter *sod-tmp-ap* + (make-instance 'temporary-name :tag "sod__tmp_ap")) ;;;-------------------------------------------------------------------------- ;;; Instructions. @@ -165,7 +167,10 @@ (format stream "~@<~@{~S ~@_~S~^ ~_~}~:>" ,@(mappend #'list keys args))) (progn ,@body)))) - ,@(and export `((export '(,class-name ,constructor-name)))) + ,@(and export `((export '(,class-name ,constructor-name + ,@(mapcar (lambda (arg) + (symbolicate 'inst- arg)) + args))))) ',code))) ;; Important instruction classes. @@ -261,6 +266,14 @@ (:method (codegen insts) (dolist (inst insts) (emit-inst codegen inst)))) +(export '(emit-decl emit-decls)) +(defgeneric emit-decl (codegen inst) + (:documentation + "Add INST to the end of CODEGEN's list of declarations.")) +(defgeneric emit-decls (codegen insts) + (:documentation + "Add a list of INSTS to the end of CODEGEN's list of declarations.")) + (export 'codegen-push) (defgeneric codegen-push (codegen) (:documentation