chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-hackers] [PATCH] enable scrutiny by default


From: Felix
Subject: Re: [Chicken-hackers] [PATCH] enable scrutiny by default
Date: Sat, 27 Oct 2012 07:52:08 -0400 (EDT)

From: Felix <address@hidden>
Subject: [PATCH] enable scrutiny by default
Date: Sat, 27 Oct 2012 07:31:48 -0400 (EDT)

> This patch implements CR #932.
> 

Now, "which patch?", you will ask. Well, this one, of course.


cheers,
felix


>From 646b34db81f2a853cf7c4344f316f8de673850a6 Mon Sep 17 00:00:00 2001
From: felix <address@hidden>
Date: Sat, 27 Oct 2012 13:23:31 +0200
Subject: [PATCH] Enable "scrutiny" (simple intraprocedural flow-analysis) by 
default.

---
 batch-driver.scm          |   16 ++++++++--------
 c-platform.scm            |    4 +++-
 csc.scm                   |    6 +++---
 manual/Types              |    3 ---
 manual/Using the compiler |    4 +---
 support.scm               |    1 -
 6 files changed, 15 insertions(+), 19 deletions(-)

diff --git a/batch-driver.scm b/batch-driver.scm
index 099548e..467a2eb 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 04a4879..fa96c81 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 a981233..21c416e 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 1daee16..07235fe 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 a1a0ff7..1bfc36c 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 9c4cedc..c0ff51f 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 file
 
-- 
1.7.0.4


reply via email to

[Prev in Thread] Current Thread [Next in Thread]