~ chicken-core (chicken-5) 818276d5e8a71b05b2c94147cae7e442f32fbdca
commit 818276d5e8a71b05b2c94147cae7e442f32fbdca Author: felix <felix@call-with-current-continuation.org> AuthorDate: Sat Oct 27 13:23:31 2012 +0200 Commit: Peter Bex <peter.bex@xs4all.nl> CommitDate: Sat Oct 27 14:03:18 2012 +0200 Enable "scrutiny" (simple intraprocedural flow-analysis) by default. Signed-off-by: Peter Bex <peter.bex@xs4all.nl> diff --git a/batch-driver.scm b/batch-driver.scm index 099548e2..467a2eb2 100644 --- a/batch-driver.scm +++ b/batch-driver.scm @@ -90,7 +90,7 @@ (uunit (memq 'unit options)) (a-only (memq 'analyze-only options)) (dynamic (memq 'dynamic options)) - (do-scrutinize (memq 'scrutinize options)) + (do-scrutinize #t) (do-lfa2 (memq 'lfa2 options)) (dumpnodes #f) (start-time #f) @@ -191,8 +191,7 @@ (not a-only)) (set! all-import-libraries #t)) (set! enable-module-registration (not (memq 'no-module-registration options))) - (when (or enable-specialization - (memq 'scrutinize options)) + (when enable-specialization (set! do-scrutinize #t)) (when (memq 't debugging-chicken) (##sys#start-timer)) (when (memq 'b debugging-chicken) (set! time-breakdown #t)) @@ -219,8 +218,7 @@ (set! ##sys#notices-enabled #t)) (when (memq 'strict-types options) (set! strict-variable-types #t) - (set! enable-specialization #t) - (set! do-scrutinize #t)) + (set! enable-specialization #t)) (when (memq 'no-warnings options) (dribble "Warnings are disabled") (set! ##sys#warnings-enabled #f) @@ -345,9 +343,11 @@ (set! disable-stack-overflow-checking (memq 'disable-stack-overflow-checks options)) (set! bootstrap-mode (feature? #:chicken-bootstrap)) (when (memq 'm debugging-chicken) (set-gc-report! #t)) - (unless (memq 'no-usual-integrations options) - (set! standard-bindings default-standard-bindings) - (set! extended-bindings default-extended-bindings) ) + (cond ((memq 'no-usual-integrations options) + (set! do-scrutinize #f)) + (else + (set! standard-bindings default-standard-bindings) + (set! extended-bindings default-extended-bindings) )) (dribble "debugging info: ~A" (if emit-trace-info "calltrace" diff --git a/c-platform.scm b/c-platform.scm index 04a48799..fa96c81b 100644 --- a/c-platform.scm +++ b/c-platform.scm @@ -87,7 +87,9 @@ compile-syntax tag-pointers accumulate-profile disable-stack-overflow-checks raw specialize emit-external-prototypes-first release local inline-global - analyze-only dynamic scrutinize no-argc-checks no-procedure-checks + analyze-only dynamic + scrutinize ; OBSOLETE + no-argc-checks no-procedure-checks no-procedure-checks-for-toplevel-bindings module no-bound-checks no-procedure-checks-for-usual-bindings no-compiler-syntax no-parentheses-synonyms no-symbol-escape r5rs-syntax emit-all-import-libraries diff --git a/csc.scm b/csc.scm index a981233d..21c416e4 100644 --- a/csc.scm +++ b/csc.scm @@ -138,7 +138,8 @@ -block -disable-interrupts -fixnum-arithmetic -to-stdout -profile -raw -accumulate-profile -check-syntax -case-insensitive -shared -compile-syntax -no-lambda-info -dynamic -disable-stack-overflow-checks -local - -emit-external-prototypes-first -inline -release -scrutinize + -emit-external-prototypes-first -inline -release + -scrutinize ; OBSOLETE -analyze-only -keep-shadowed-macros -inline-global -ignore-repository -no-symbol-escape -no-parentheses-synonyms -r5rs-syntax -no-argc-checks -no-bound-checks -no-procedure-checks -no-compiler-syntax @@ -160,7 +161,7 @@ (define-constant shortcuts '((-h "-help") (-s "-shared") - (-S "-scrutinize") + (-S "-scrutinize") ; OBSOLETE (-M "-module") (|-P| "-check-syntax") (-f "-fixnum-arithmetic") @@ -368,7 +369,6 @@ Usage: #{csc} FILENAME | OPTION ... append mode -profile-name FILENAME name of the generated profile information file - -S -scrutinize perform local flow analysis -types FILENAME load additional type database Optimization options: diff --git a/manual/Types b/manual/Types index 1daee16f..07235fe8 100644 --- a/manual/Types +++ b/manual/Types @@ -24,9 +24,6 @@ efficient code by omitting unnecessary type-checks. CHICKEN provides an intra-procedural flow-analysis pass and two compiler options for using type-information in this manner: -{{-scrutinize}} will look for possibly incorrectly typed arguments to -library procedure calls and generate warnings in such cases. - {{-specialize}} will replace certain generic library procedure calls with faster type-specific operations. diff --git a/manual/Using the compiler b/manual/Using the compiler index a1a0ff7e..1bfc36c5 100644 --- a/manual/Using the compiler +++ b/manual/Using the compiler @@ -151,9 +151,7 @@ the source text should be read from standard input. ; -setup-mode : When locating extension, search the current directory first. By default, extensions are located first in the ''extension repository'', where {{chicken-install}} stores compiled extensions and their associated metadata. -; -scrutinize : Enable simple flow-analysis to catch common type errors and argument/result mismatches. You can also use the {{scrutinize}} declaration to enable scrutiny. - -; -specialize : Enable simple flow-analysis for doing some type-directed optimizations. Implies {{-scrutinize}}. +; -specialize : Enable simple flow-analysis for doing some type-directed optimizations. ; -strict-types : Assume that the type of variables is not changed by assignments. This gives more type-information during specialization, but violating this assumption will result in unsafe and incorrectly behaving code. diff --git a/support.scm b/support.scm index 9c4cedc1..c0ff51f4 100644 --- a/support.scm +++ b/support.scm @@ -1670,7 +1670,6 @@ Usage: chicken FILENAME OPTION ... -accumulate-profile executable emits profiling information in append mode -no-lambda-info omit additional procedure-information - -scrutinize perform local flow analysis for static checks -types FILENAME load additional type database -emit-type-file FILENAME write type-declaration information into fileTrap