Make ECL less verbose in its messages, eliminating certain notes and the note context when this is too imprecise.

This commit is contained in:
Juan Jose Garcia Ripoll 2009-08-04 11:22:45 +02:00
parent f2625c0330
commit e3f42a5c49
3 changed files with 22 additions and 12 deletions

View file

@ -285,7 +285,7 @@ each form it processes. The default value is NIL.")
"This variable controls whether the compiler should display messages about its
progress. The default value is T.")
(defvar *suppress-compiler-messages* nil
(defvar *suppress-compiler-messages* 'compiler-debug-note
"A type denoting which compiler messages and conditions are _not_ displayed.")
(defvar *suppress-compiler-notes* nil) ; Deprecated

View file

@ -106,7 +106,7 @@
(notany #'(lambda (v) (var-referenced-in-form v form)) all-vars)
(catch var
(replaceable var body)))
(cmpnote "Replacing variable ~A by its value ~A" (var-name var) form)
(cmpdebug "Replacing variable ~A by its value ~A" (var-name var) form)
(nsubst-var var form)
(go continue))
)
@ -350,7 +350,7 @@
(not (args-cause-side-effect fs)))
(catch var
(replaceable var body)))
(cmpnote "Replacing variable ~A by its value ~a" (var-name var) form)
(cmpdebug "Replacing variable ~A by its value ~a" (var-name var) form)
(nsubst-var var form)
(go continue))
)
@ -400,7 +400,7 @@
(case (c1form-name form)
(LOCATION
(when (can-be-replaced* var body (cdr fl))
(cmpnote "Replacing variable ~a by its value" (var-name var))
(cmpdebug "Replacing variable ~a by its value" (var-name var))
(setf (var-kind var) 'REPLACED
(var-loc var) (c1form-arg 0 form))))
(VAR
@ -413,7 +413,7 @@
(can-be-replaced* var body (cdr fl))
(not (var-changed-in-form-list var1 (rest fl)))
(not (var-changed-in-form var1 body)))
(cmpnote "Replacing variable ~a by its value" (var-name var))
(cmpdebug "Replacing variable ~a by its value" (var-name var))
(setf (var-kind var) 'REPLACED
(var-loc var) var1)))))
(unless env-grows

View file

@ -23,20 +23,27 @@
(form :initarg :form :initform *current-form* :accessor compiler-message-form))
(:REPORT
(lambda (c stream)
(let ((position (compiler-message-file-position c)))
(if position
(let ((*print-length* 3)
(*print-level* 2))
(let ((position (compiler-message-file-position c))
(prefix (compiler-message-prefix c))
(file (compiler-message-file c))
(form (compiler-message-form c)))
(if (and position
(not (minusp position))
(not (equalp form '|compiler preprocess|)))
(let* ((*print-length* 3)
(*print-level* 2))
(unless
(format stream "~A: in file ~A, position ~D, and form ~% ~A~%"
(compiler-message-prefix c)
(compiler-message-file c) position (compiler-message-form c)))
(format stream "~A: " (compiler-message-prefix c)))
prefix file position form)))
(format stream "~A: " prefix))
(format stream "~?"
(simple-condition-format-control c)
(simple-condition-format-arguments c))))))
(define-condition compiler-note (compiler-message) ())
(define-condition compiler-debug-note (compiler-note) ())
(define-condition compiler-warning (compiler-message simple-condition style-warning)
((prefix :initform "Warning")))
@ -195,6 +202,9 @@
(defun cmpnote (string &rest args)
(do-cmpwarn 'compiler-note :format-control string :format-arguments args))
(defun cmpdebug (string &rest args)
(do-cmpwarn 'compiler-debug-note :format-control string :format-arguments args))
(defun print-current-form ()
(when *compile-print*
(let ((*print-length* 2)