Changeset 11764
- Timestamp:
- 04/18/09 20:17:41 (14 years ago)
- Location:
- trunk/abcl/src/org/armedbear/lisp
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abcl/src/org/armedbear/lisp/compile-system.lisp
r11677 r11764 271 271 (time 272 272 (with-compilation-unit () 273 (let ((*compile-file-zip* zip)) 274 (%compile-system :output-path output-path)) 275 (when (zerop (+ jvm::*errors* jvm::*warnings*)) 276 (setf status 0)))) 273 (let ((*compile-file-zip* zip) 274 failure-p) 275 (handler-bind (((or warning 276 compiler-error) 277 #'(lambda (c) 278 (declare (ignore c)) 279 (setf failure-p t) 280 ;; only register that we had this type of signal 281 ;; defer the actual handling to another handler 282 nil))) 283 (%compile-system :output-path output-path)) 284 (unless failure-p 285 (setf status 0))))) 277 286 (when quit 278 287 (quit :status status)))) -
trunk/abcl/src/org/armedbear/lisp/compiler-pass2.lisp
r11763 r11764 1002 1002 (fix-boxing representation nil) 1003 1003 (emit-move-from-stack target representation)) 1004 1005 (defvar *style-warnings* nil)1006 (defvar *warnings* nil)1007 (defvar *errors* nil)1008 1009 (defvar *last-error-context* nil)1010 1011 (defun note-error-context ()1012 (let ((context *compiler-error-context*))1013 (when (and context (neq context *last-error-context*))1014 (fresh-line *error-output*)1015 (princ "; in " *error-output*)1016 (let ((*print-length* 2)1017 (*print-level* 2)1018 (*print-pretty* nil))1019 (prin1 context *error-output*))1020 (terpri *error-output*)1021 (terpri *error-output*)1022 (setf *last-error-context* context))))1023 1024 (defvar *resignal-compiler-warnings* nil) ; bind this to t inside slime compilation1025 1026 (defun handle-style-warning (condition)1027 (cond (*resignal-compiler-warnings*1028 (signal condition))1029 (t1030 (unless *suppress-compiler-warnings*1031 (fresh-line *error-output*)1032 (note-error-context)1033 (format *error-output* "; Caught ~A:~%; ~A~2%" (type-of condition) condition))1034 (incf *style-warnings*)1035 (muffle-warning))))1036 1037 (defun handle-warning (condition)1038 (cond (*resignal-compiler-warnings*1039 (signal condition))1040 (t1041 (unless *suppress-compiler-warnings*1042 (fresh-line *error-output*)1043 (note-error-context)1044 (format *error-output* "; Caught ~A:~%; ~A~2%" (type-of condition) condition))1045 (incf *warnings*)1046 (muffle-warning))))1047 1048 (defun handle-compiler-error (condition)1049 (fresh-line *error-output*)1050 (note-error-context)1051 (format *error-output* "; Caught ERROR:~%; ~A~2%" condition)1052 (incf *errors*)1053 (throw 'compile-defun-abort (funcall *compiler-error-bailout*)))1054 1004 1055 1005 ;; "In addition to situations for which the standard specifies that conditions … … 8698 8648 (defvar *catch-errors* t) 8699 8649 8650 (defvar *last-error-context* nil) 8651 8652 (defun note-error-context () 8653 (let ((context *compiler-error-context*)) 8654 (when (and context (neq context *last-error-context*)) 8655 (fresh-line *error-output*) 8656 (princ "; in " *error-output*) 8657 (let ((*print-length* 2) 8658 (*print-level* 2) 8659 (*print-pretty* nil)) 8660 (prin1 context *error-output*)) 8661 (terpri *error-output*) 8662 (terpri *error-output*) 8663 (setf *last-error-context* context)))) 8664 8665 8666 (defvar *resignal-compiler-warnings* nil 8667 "Bind this to t inside slime compilation") 8668 8669 (defun handle-warning (condition) 8670 (cond (*resignal-compiler-warnings* 8671 (signal condition)) 8672 (t 8673 (unless *suppress-compiler-warnings* 8674 (fresh-line *error-output*) 8675 (note-error-context) 8676 (format *error-output* "; Caught ~A:~%; ~A~2%" 8677 (type-of condition) condition)) 8678 (muffle-warning)))) 8679 8680 (defun handle-compiler-error (condition) 8681 (fresh-line *error-output*) 8682 (note-error-context) 8683 (format *error-output* "; Caught ERROR:~%; ~A~2%" condition) 8684 (throw 'compile-defun-abort (funcall *compiler-error-bailout*))) 8685 8700 8686 (defvar *in-compilation-unit* nil) 8701 8687 … … 8704 8690 8705 8691 (defun %with-compilation-unit (fn &key override) 8706 (handler-bind ((style-warning 'handle-style-warning) 8707 (warning 'handle-warning) 8708 (compiler-error 'handle-compiler-error)) 8709 (if (and *in-compilation-unit* (not override)) 8710 (funcall fn) 8711 (let ((*style-warnings* 0) 8712 (*warnings* 0) 8713 (*errors* 0) 8714 (*defined-functions* nil) 8715 (*undefined-functions* nil) 8716 (*in-compilation-unit* t)) 8717 (unwind-protect 8718 (funcall fn) 8719 (unless (or (and *suppress-compiler-warnings* (zerop *errors*)) 8720 (and (zerop (+ *errors* *warnings* *style-warnings*)) 8721 (null *undefined-functions*))) 8722 (format *error-output* "~%; Compilation unit finished~%") 8723 (unless (zerop *errors*) 8724 (format *error-output* "; Caught ~D ERROR condition~P~%" 8725 *errors* *errors*)) 8726 (unless *suppress-compiler-warnings* 8727 (unless (zerop *warnings*) 8728 (format *error-output* "; Caught ~D WARNING condition~P~%" 8729 *warnings* *warnings*)) 8730 (unless (zerop *style-warnings*) 8731 (format *error-output* "; Caught ~D STYLE-WARNING condition~P~%" 8732 *style-warnings* *style-warnings*)) 8733 (when *undefined-functions* 8734 (format *error-output* "; The following functions were used but not defined:~%") 8735 (dolist (name *undefined-functions*) 8736 (format *error-output* "; ~S~%" name)))) 8737 (terpri *error-output*))))))) 8692 (if (and *in-compilation-unit* (not override)) 8693 (funcall fn) 8694 (let ((style-warnings 0) 8695 (warnings 0) 8696 (errors 0) 8697 (*defined-functions* nil) 8698 (*undefined-functions* nil) 8699 (*in-compilation-unit* t)) 8700 (unwind-protect 8701 (handler-bind ((style-warning #'(lambda (c) 8702 (incf style-warnings) 8703 (handle-warning c))) 8704 (warning #'(lambda (c) 8705 (incf warnings) 8706 (handle-warning c))) 8707 (compiler-error #'(lambda (c) 8708 (incf errors) 8709 (handle-compiler-error c)))) 8710 (funcall fn)) 8711 (unless (or (and *suppress-compiler-warnings* (zerop errors)) 8712 (and (zerop (+ errors warnings style-warnings)) 8713 (null *undefined-functions*))) 8714 (format *error-output* 8715 "~%; Compilation unit finished~%") 8716 (unless (zerop errors) 8717 (format *error-output* 8718 "; Caught ~D ERROR condition~P~%" 8719 errors errors)) 8720 (unless *suppress-compiler-warnings* 8721 (unless (zerop warnings) 8722 (format *error-output* 8723 "; Caught ~D WARNING condition~P~%" 8724 warnings warnings)) 8725 (unless (zerop style-warnings) 8726 (format *error-output* 8727 "; Caught ~D STYLE-WARNING condition~P~%" 8728 style-warnings style-warnings)) 8729 (when *undefined-functions* 8730 (format *error-output* 8731 "; The following functions were used but not defined:~%") 8732 (dolist (name *undefined-functions*) 8733 (format *error-output* "; ~S~%" name)))) 8734 (terpri *error-output*)))))) 8738 8735 8739 8736 (defun get-lambda-to-compile (thing)
Note: See TracChangeset
for help on using the changeset viewer.