mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-08 05:27:33 +02:00
Added option for trace level, do not emit trans by default
This commit is contained in:
parent
ecf07517d2
commit
f4ce142cf1
3 changed files with 13 additions and 6 deletions
1
TODO
1
TODO
|
@ -1,6 +1,5 @@
|
|||
Working TODO list:
|
||||
|
||||
- make *trace-level* a command-line parameter, and by default do not emit scheme code transformations in comments
|
||||
- Reduction in size of generated code
|
||||
is there anything we can do?
|
||||
are closures being packed/unpacked unnecessarily?
|
||||
|
|
16
cyclone.scm
16
cyclone.scm
|
@ -163,7 +163,17 @@
|
|||
(string-append "gcc " src-file " -L. -lcyclone -lm -I. -g -o " exec-file)))))
|
||||
|
||||
;; Handle command line arguments
|
||||
(let ((args (command-line-arguments))) ;; TODO: port (command-line-arguments) to husk??
|
||||
(let* ((args (command-line-arguments)) ;; TODO: port (command-line-arguments) to husk??
|
||||
(non-opts (filter
|
||||
(lambda (arg)
|
||||
(not (and (> (string-length arg) 1)
|
||||
(equal? #\- (string-ref arg 0)))))
|
||||
args))
|
||||
(compile? #t))
|
||||
(if (member "-t" args)
|
||||
(set! *trace-level* 4)) ;; Show all trace output
|
||||
(if (member "-d" args)
|
||||
(set! compile? #f)) ;; Debug, do not run GCC
|
||||
(cond
|
||||
((< (length args) 1)
|
||||
(display "cyclone: no input file")
|
||||
|
@ -175,8 +185,6 @@
|
|||
(display *version-banner*))
|
||||
((member "--autogen" args)
|
||||
(autogen "autogen.out"))
|
||||
((member "-d" args)
|
||||
(run-compiler args #f)) ;; Debug, do not run GCC
|
||||
(else
|
||||
(run-compiler args #t))))
|
||||
(run-compiler non-opts compile?))))
|
||||
|
||||
|
|
|
@ -335,7 +335,7 @@
|
|||
(define *do-code-gen* #t) ; Generate C code?
|
||||
|
||||
;; Trace
|
||||
(define *trace-level* 4)
|
||||
(define *trace-level* 2)
|
||||
(define (trace level msg pp prefix)
|
||||
(if (>= *trace-level* level)
|
||||
(begin
|
||||
|
|
Loading…
Add table
Reference in a new issue