Commit 42281dcb authored by Erick's avatar Erick

Added the --show-instructions to stklos-compile.

parent 01311a87
......@@ -43,6 +43,9 @@ defining new syntaxes).
.IP "--line-info, -l"
Generate line informations to ease debugging (incurs a small
performance penalty).
.IP "--show-instructions, -S"
Produce the VM instructions in the generated file. Actually,
it is probably only useful if you want to hack the VM.
.IP "--prepend-load-path=<dir>, -L <dir>"
Prepend the directory <dir> to the compiler loading path.
......
......@@ -21,7 +21,7 @@
;;;;
;;;; Author: Erick Gallesio [eg@unice.fr]
;;;; Creation date: 01-Jan-2000 15:04 (eg)
;;;; Last file update: 18-Oct-2009 00:06 (eg)
;;;; Last file update: 20-Dec-2009 11:57 (eg)
;;;;
(include "runtime.stk") ; Definition necessary for the bootstrap
......@@ -196,7 +196,7 @@
;; Look at the debug flag
(when (> debug 0)
(compiler:warn-use-undefined #t) ; Signal usage of still undefined symbols
(compiler:gen-line-number #t) ; Generate line nuumbers
(compiler:gen-line-number #t) ; Generate line numbers
(when (> debug 1) ; Load-verbose when debug >= 2
(load-verbose 1)))
;; Try to load the user initialization file except if "--no-init-file"
......
;;;;
;;;; compfile.stk -- STklos File Compiler
;;;;
;;;; Copyright 2001-2007 Erick Gallesio - I3S-CNRS/ESSI <eg@unice.fr>
;;;; Copyright 2001-2009 Erick Gallesio - I3S-CNRS/ESSI <eg@unice.fr>
;;;;
;;;;
;;;; This program is free software; you can redistribute it and/or modify
......@@ -21,7 +21,7 @@
;;;;
;;;; Author: Erick Gallesio [eg@unice.fr]
;;;; Creation date: 17-Mar-2001 12:11 (eg)
;;;; Last file update: 26-Apr-2007 12:19 (eg)
;;;; Last file update: 20-Dec-2009 11:59 (eg)
;;;;
(select-module STKLOS-COMPILER)
......@@ -67,10 +67,11 @@
(format out "STklos ~S\n" (compute-file-informations globs))
(let ((code (assemble (reverse! *code-instr*))))
;;Write the assembly code and code vector
;;(format out "\n#|\n")
;;(disassemble-code code out)
;;(format out "\n~S\n|\#\n" code)
(when (compiler:show-assemby-code)
;;Write the assembly code and code vector
(format out "\n#|\n")
(disassemble-code code out)
(format out "\n~S\n|\#\n" code))
;; Write new constants as a vector
(format out "#~S\n" *code-constants*)
......
;;;;
;;;; c o m p i l e r . s t k -- STklos Compiler
;;;;
;;;; Copyright 2000-2007 Erick Gallesio - I3S-CNRS/ESSI <eg@unice.fr>
;;;; Copyright 2000-2009 Erick Gallesio - I3S-CNRS/ESSI <eg@unice.fr>
;;;;
;;;;
;;;; This program is free software; you can redistribute it and/or modify
......@@ -21,7 +21,7 @@
;;;;
;;;; Author: Erick Gallesio [eg@unice.fr]
;;;; Creation date: 26-Feb-2000 10:47 (eg)
;;;; Last file update: 5-Aug-2007 18:29 (eg)
;;;; Last file update: 20-Dec-2009 12:00 (eg)
;;;;
(define-module STKLOS-COMPILER
......@@ -99,6 +99,8 @@
(define compiler:gen-line-number (make-parameter #f))
(define compiler:warn-use-undefined (make-parameter #f))
(define compiler:warn-use-undefined-postpone (make-parameter #t))
(define compiler:show-assemby-code (make-parameter #f))
(define compiler:inline-common-functions
(let ((inlined *inline-symbols*))
(make-parameter #t
......
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
;;;;
;;;; stklos-compile.stk -- Call the stklos compiler
;;;;
;;;; Copyright 2001-2007 Erick Gallesio - I3S-CNRS/ESSI <eg@unice.fr>
;;;; Copyright 2001-2009 Erick Gallesio - I3S-CNRS/ESSI <eg@unice.fr>
;;;;
;;;;
;;;; This program is free software; you can redistribute it and/or modify
......@@ -21,7 +21,7 @@
;;;;
;;;; Author: Erick Gallesio [eg@unice.fr]
;;;; Creation date: 4-Dec-2001 18:12 (eg)
;;;; Last file update: 7-Mar-2007 16:01 (eg)
;;;; Last file update: 20-Dec-2009 12:04 (eg)
;;;;
;(require "match")
......@@ -129,10 +129,12 @@
"Compiling options"
(("evaluate" :alternate "e" :arg expr
:help "evaluate <expr> before compiling file")
:help "Evaluate <expr> before compiling file")
(set! *expr* expr))
(("line-info" :alternate "l" :help "Insert line numbers in generated file")
(compiler:gen-line-number #t))
(("show-instructions" :alternate "S" :help "Show instructions in generated file")
(compiler:show-assemby-code #t))
"Path options"
(("prepend-load-path" :alternate "L" :arg dir
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment