diff --git a/src/cmp/cmpbackend-cxx/cmpbackend-cxx.lsp b/src/cmp/cmpbackend-cxx/cmpbackend-cxx.lsp index ff12e25f6..043755393 100644 --- a/src/cmp/cmpbackend-cxx/cmpbackend-cxx.lsp +++ b/src/cmp/cmpbackend-cxx/cmpbackend-cxx.lsp @@ -528,33 +528,7 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdS ") -;;; Code generation - -(defun compiler-pass/generate-cxx (c-pathname h-pathname data-pathname init-name source) - (with-cxx-env () - ;; After this step we still can add new objects, but objects that are - ;; already stored in VV or VVtemp must not change the location. - (optimize-cxx-data *referenced-objects*) - (setq *compiler-phase* 't2) - (with-open-file (*compiler-output1* c-pathname :direction :output - :if-does-not-exist :create - :if-exists :supersede) - (wt-comment-nl "Compiler: ~A ~A" (lisp-implementation-type) (lisp-implementation-version)) - #-ecl-min - (multiple-value-bind (second minute hour day month year) - (get-decoded-time) - (declare (ignore second)) - (wt-comment-nl "Date: ~D/~D/~D ~2,'0D:~2,'0D (yyyy/mm/dd)" year month day hour minute) - (wt-comment-nl "Machine: ~A ~A ~A" (software-type) (software-version) (machine-type))) - (wt-comment-nl "Source: ~A" source) - (with-open-file (*compiler-output2* h-pathname :direction :output - :if-does-not-exist :create - :if-exists :supersede) - (wt-nl1 "#include " *cmpinclude*) - (ctop-write init-name h-pathname data-pathname) - (terpri *compiler-output1*) - (terpri *compiler-output2*))) - (data-c-dump data-pathname))) +;;; Code assembly (defun compiler-pass/assemble-cxx (input-file output-file &key diff --git a/src/cmp/cmpbackend-cxx/cmppass2-top.lsp b/src/cmp/cmpbackend-cxx/cmppass2-top.lsp index 6171f4beb..48d28f3c1 100644 --- a/src/cmp/cmpbackend-cxx/cmppass2-top.lsp +++ b/src/cmp/cmpbackend-cxx/cmppass2-top.lsp @@ -1,6 +1,36 @@ (in-package #:compiler) + +(defun wt-print-header (source) + (wt-comment-nl "Compiler: ~A ~A" (lisp-implementation-type) (lisp-implementation-version)) + #-ecl-min + (multiple-value-bind (second minute hour day month year) + (get-decoded-time) + (declare (ignore second)) + (wt-comment-nl "Date: ~D/~D/~D ~2,'0D:~2,'0D (yyyy/mm/dd)" year month day hour minute) + (wt-comment-nl "Machine: ~A ~A ~A" (software-type) (software-version) (machine-type))) + (wt-comment-nl "Source: ~A" source)) + +(defun compiler-pass/generate-cxx (c-pathname h-pathname data-pathname init-name source) + (with-cxx-env () + ;; After this step we still can add new objects, but objects that are + ;; already stored in VV or VVtemp must not change the location. + (optimize-cxx-data *referenced-objects*) + (setq *compiler-phase* 't2) + (with-open-file (*compiler-output1* c-pathname :direction :output + :if-does-not-exist :create + :if-exists :supersede) + (with-open-file (*compiler-output2* h-pathname :direction :output + :if-does-not-exist :create + :if-exists :supersede) + (wt-print-header source) + (wt-nl1 "#include " *cmpinclude*) + (ctop-write init-name h-pathname data-pathname) + (terpri *compiler-output1*) + (terpri *compiler-output2*))) + (data-c-dump data-pathname))) + ;;;; CMPTOP -- Compiler top-level. (defun t2expr (form)