From: Nikodemus Siivola Date: Fri, 1 Aug 2008 11:19:03 +0000 (+0000) Subject: 1.0.19.12: give a warning for newly deprecated stack-allcation optimization policies X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=6bdf018a77fd4bbc25c783f330415d444ffaeab2;p=sbcl.git 1.0.19.12: give a warning for newly deprecated stack-allcation optimization policies * 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. --- diff --git a/package-data-list.lisp-expr b/package-data-list.lisp-expr index 4469f3a..1062017 100644 --- a/package-data-list.lisp-expr +++ b/package-data-list.lisp-expr @@ -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" diff --git a/src/code/condition.lisp b/src/code/condition.lisp index 830721d..9ec433e 100644 --- a/src/code/condition.lisp +++ b/src/code/condition.lisp @@ -903,6 +903,9 @@ (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) diff --git a/src/compiler/policy.lisp b/src/compiler/policy.lisp index 2e19378..d5fe59d 100644 --- a/src/compiler/policy.lisp +++ b/src/compiler/policy.lisp @@ -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 "~@" + :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 diff --git a/src/compiler/proclaim.lisp b/src/compiler/proclaim.lisp index c215916..2f36e28 100644 --- a/src/compiler/proclaim.lisp +++ b/src/compiler/proclaim.lisp @@ -45,11 +45,13 @@ (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 "~@" + quality spec)))) ((not (typep raw-value 'policy-quality)) - (compiler-warn "ignoring bad optimization value ~S in ~S" + (compiler-warn "~@" raw-value spec)) (t ;; we can't do this yet, because CLOS macros expand diff --git a/version.lisp-expr b/version.lisp-expr index b877b12..ef7ab53 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -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"