Skip to content

Commit 2711962

Browse files
committed
define generate-bytecode feature for enbling bytecode compilation
1 parent 8b1cc4e commit 2711962

File tree

2 files changed

+24
-20
lines changed

2 files changed

+24
-20
lines changed

src/lisp/kernel/cmp/compile-file.lisp

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -301,24 +301,25 @@ Compile a Lisp source stream and return a corresponding LLVM module."
301301
image-startup-position optimize optimize-level))
302302
"See CLHS compile-file."
303303
(with-compilation-unit ()
304-
(let ((output-path (apply #'compile-file-pathname input-file args))
305-
(*compilation-module-index* 0) ; FIXME: necessary?
306-
(*readtable* *readtable*) (*package* *package*)
307-
(*optimize* *optimize*) (*policy* *policy*)
308-
(*compile-file-pathname*
309-
(pathname (merge-pathnames input-file)))
310-
(*compile-file-truename*
311-
(translate-logical-pathname *compile-file-pathname*))
312-
(*compile-file-source-debug-pathname*
313-
(if cfsdpp source-debug-pathname *compile-file-truename*))
314-
(*compile-file-file-scope*
315-
(core:file-scope *compile-file-source-debug-pathname*))
316-
;; bytecode compilation can't be done in parallel at the moment.
317-
;; we could possibly warn about it if execution was specified,
318-
;; but practically speaking it would mostly be noise.
319-
(execution (if (member output-type '(:bytecode :bytecodel))
320-
:serial
321-
execution)))
304+
(let* ((output-type (fixup-output-type output-type))
305+
(output-path (apply #'compile-file-pathname input-file args))
306+
(*compilation-module-index* 0) ; FIXME: necessary?
307+
(*readtable* *readtable*) (*package* *package*)
308+
(*optimize* *optimize*) (*policy* *policy*)
309+
(*compile-file-pathname*
310+
(pathname (merge-pathnames input-file)))
311+
(*compile-file-truename*
312+
(translate-logical-pathname *compile-file-pathname*))
313+
(*compile-file-source-debug-pathname*
314+
(if cfsdpp source-debug-pathname *compile-file-truename*))
315+
(*compile-file-file-scope*
316+
(core:file-scope *compile-file-source-debug-pathname*))
317+
;; bytecode compilation can't be done in parallel at the moment.
318+
;; we could possibly warn about it if execution was specified,
319+
;; but practically speaking it would mostly be noise.
320+
(execution (if (member output-type '(:bytecode :bytecodel))
321+
:serial
322+
execution)))
322323
(with-open-file (source-sin input-file
323324
:external-format external-format)
324325
(with-compilation-results ()

src/lisp/kernel/init.lisp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,12 @@
109109

110110
(if (member :generate-faso *features*)
111111
(setq core:*clasp-build-mode* :faso))
112-
113112

114-
(setq cmp:*default-object-type* core:*clasp-build-mode*)
113+
114+
(setq cmp:*default-object-type*
115+
(if (member :generate-bytecode *features*)
116+
:bytecode
117+
core:*clasp-build-mode*))
115118

116119
;;; ------------------------------------------------------------
117120
;;;

0 commit comments

Comments
 (0)