From d208c95609135736509a7ad85a1da6565f5f866a Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Mon, 27 Apr 2015 18:18:07 -0400 Subject: [PATCH] WIP - help banner --- cyclone.scm | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/cyclone.scm b/cyclone.scm index 8c7e447c..81d136d6 100644 --- a/cyclone.scm +++ b/cyclone.scm @@ -82,9 +82,16 @@ (trace:info input-program) ;pretty-print + ;; TODO: do not run this if eval is in play, or (better) only do opts that are safe in that case (will be much more limited) + ;; because of this, programs such as icyc can only be so optimized. it would be much more beneficial if modules like + ;; eval.scm could be compiled separately and then linked to by a program such as icyc.scm. that would save a *lot* of compile + ;; time. in fact, it might be more beneficial than adding these optimizations. + ;; ;; TODO: run CPS optimization (not all of these phases may apply) ;; phase 1 - constant folding, function-argument expansion, beta-contraction of functions called once, - ;; and other "contractions" + ;; and other "contractions". some of this is already done in previous phases. we will leave + ;; that alone for now +; (set! input-program (cps-opt:contractions input-program)) ;; phase 2 - beta expansion ;; phase 3 - eta reduction ;; phase 4 - hoisting @@ -190,8 +197,18 @@ ((< (length args) 1) (display "cyclone: no input file") (newline)) - ((member "-h" args) - (display "TODO: display help text") + ((or (member "-h" args) + (member "--help" args)) + (write " -t Show intermediate trace output in generated C files") + (write " -d Only generate intermediate C files, do not compile them") + (write " -h, --help Display usage information") + (write " -v Display version information") + (write " --autogen Cyclone developer use only, create autogen.out file") + (newline)) + ((member "-v" args) + (display *version-banner*)) + ((member "--autogen" args) + (autogen "autogen.out") (newline)) ((member "-v" args) (display *version-banner*))