1.0.19.12: give a warning for newly deprecated stack-allcation optimization policies
authorNikodemus Siivola <nikodemus@random-state.net>
Fri, 1 Aug 2008 11:19:03 +0000 (11:19 +0000)
committerNikodemus Siivola <nikodemus@random-state.net>
Fri, 1 Aug 2008 11:19:03 +0000 (11:19 +0000)
 * Most importantly, keep the symbols around for a while, since otherwise reading
   code that tries to twiddle them causes a package-lock violation.

 * Make it a refence condition for good measure.

 * Prettify the output in from other policy-related warnings while at it.

package-data-list.lisp-expr
src/code/condition.lisp
src/compiler/policy.lisp
src/compiler/proclaim.lisp
version.lisp-expr

index 4469f3a..1062017 100644 (file)
@@ -867,6 +867,7 @@ possibly temporariliy, because it might be used internally."
                "SIMPLE-READER-ERROR"
                "SIMPLE-READER-PACKAGE-ERROR"
                "SIMPLE-REFERENCE-ERROR"
+               "SIMPLE-REFERENCE-WARNING"
                "SIMPLE-STREAM-ERROR"
                "SIMPLE-STORAGE-CONDITION"
                "SIMPLE-STYLE-WARNING"
index 830721d..9ec433e 100644 (file)
 (define-condition simple-reference-error (reference-condition simple-error)
   ())
 
+(define-condition simple-reference-warning (reference-condition simple-warning)
+  ())
+
 (define-condition duplicate-definition (reference-condition warning)
   ((name :initarg :name :reader duplicate-definition-name))
   (:report (lambda (c s)
index 2e19378..d5fe59d 100644 (file)
@@ -72,6 +72,16 @@ EXPERIMENTAL INTERFACE: Subject to change."
   (or (memq x *policy-qualities*)
       (assq x *policy-dependent-qualities*)))
 
+;;; Is it deprecated?
+(defun policy-quality-deprecation-warning (quality spec)
+  (when (member quality '(stack-allocate-dynamic-extent stack-allocate-vector
+                          stack-allocate-value-cells))
+    (make-instance 'simple-reference-warning
+                   :format-control "~@<Ignoring deprecated optimization quality ~S in:~_ ~S~:>"
+                   :format-arguments (list quality spec)
+                   :references (list '(:sbcl :variable *stack-allocate-dynamic-extent*)
+                                     '(:sbcl :node "Dynamic-extent allocation")))))
+
 ;;; *POLICY* holds the current global compiler policy information, as
 ;;; an alist mapping from optimization quality name to quality value.
 ;;; Inside the scope of declarations, new entries are added at the
index c215916..2f36e28 100644 (file)
               (destructuring-bind (quality raw-value) q-and-v-or-just-q
                 (values quality raw-value)))
         (cond ((not (policy-quality-name-p quality))
-               (compiler-warn "ignoring unknown optimization quality ~
-                               ~S in ~S"
-                               quality spec))
+               (let ((deprecation-warning (policy-quality-deprecation-warning quality spec)))
+                 (if deprecation-warning
+                     (compiler-warn deprecation-warning)
+                     (compiler-warn "~@<Ignoring unknown optimization quality ~S in:~_ ~S~:>"
+                                    quality spec))))
               ((not (typep raw-value 'policy-quality))
-               (compiler-warn "ignoring bad optimization value ~S in ~S"
+               (compiler-warn "~@<Ignoring bad optimization value ~S in:~_ ~S~:>"
                               raw-value spec))
               (t
                ;; we can't do this yet, because CLOS macros expand
index b877b12..ef7ab53 100644 (file)
@@ -17,4 +17,4 @@
 ;;; checkins which aren't released. (And occasionally for internal
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"1.0.19.11"
+"1.0.19.12"