Changeset 9848
- Timestamp:
- Jun 30, 2008, 7:05:03 AM (13 years ago)
- Location:
- trunk/source
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/compiler/nx0.lisp
r9763 r9848 51 51 (defparameter *nx-hoist-declarations* t) 52 52 (defparameter *nx-loop-nesting-level* 0) 53 (defvar *nx-break-on-program-errors* t) 53 54 54 55 (defvar *nx1-vcells* nil) … … 1325 1326 (setf (afunc-acode p) (nx1-lambda '(&rest args) `(args ,(runtime-program-error-form c)) nil))) 1326 1327 (handler-bind ((warning (lambda (c) 1327 (nx1-whine :program-error c) 1328 (muffle-warning c))) 1329 (program-error (lambda (c) 1330 (when (typep c 'compile-time-program-error) 1331 (setq c (make-condition 'simple-program-error 1332 :format-control (simple-condition-format-control c) 1333 :format-arguments (simple-condition-format-arguments c)))) 1334 (nx1-whine :program-error c) 1335 (throw 'program-error-handler c)))) 1328 (nx1-whine :program-error c) 1329 (muffle-warning c))) 1330 (program-error (lambda (c) 1331 (when *nx-break-on-program-errors* 1332 (cerror "continue compilation ignoring this form" c)) 1333 (when (typep c 'compile-time-program-error) 1334 (setq c (make-condition 'simple-program-error 1335 :format-control (simple-condition-format-control c) 1336 :format-arguments (simple-condition-format-arguments c)))) 1337 (unless *nx-break-on-program-errors* 1338 (nx1-whine :program-error c)) 1339 (throw 'program-error-handler c)))) 1336 1340 (multiple-value-bind (body decls) 1337 1341 (with-program-error-handler (lambda (c) (runtime-program-error-form c)) -
trunk/source/level-1/sysutils.lisp
r9061 r9848 625 625 (unless muffled 626 626 (setq any-p t) 627 (unless (typep w 'style-warning) (setq harsh-p t)) 627 (unless (typep w 'style-warning) 628 (unless (eq harsh-p :very) 629 (setq harsh-p t) 630 (when (and (typep w 'compiler-warning) 631 (eq (compiler-warning-warning-type w) :program-error) 632 (typep (car (compiler-warning-args w)) 'error)) 633 (setq harsh-p :very)))) 628 634 (when (or init-p (not (equalp w-file last-w-file))) 629 635 (format s "~&;~A warnings " (if (null eval-p) "Compiler" "Interpreter")) -
trunk/source/lib/nfcomp.lisp
r9167 r9848 67 67 (defvar *fcomp-external-format* :default) 68 68 69 (defvar *fasl-break-on-program-errors* #+ccl-0711 nil #-ccl-0711 :defer 70 "Controls what happens when the compiler detects PROGRAM-ERROR's during file compilation. 71 72 If T, the compiler signals an error immediately when it detects the program-error. 73 74 If :DEFER, program errors are reported as compiler warnings, and in addition, an error 75 is signalled at the end of file compilation. This allows all warnings for the file 76 to be reported, but prevents the creation of a fasl file. 77 78 If NIL, program errors are treated the same as any other error condition detected by 79 the compiler, i.e. they are reported as compiler warnings and do not cause any 80 error to be signalled at compile time.") 81 82 69 83 (defvar *compile-print* nil ; Might wind up getting called *compile-FILE-print* 70 84 "The default for the :PRINT argument to COMPILE-FILE.") … … 110 124 (save-doc-strings *fasl-save-doc-strings*) 111 125 (save-definitions *fasl-save-definitions*) 112 (external-format :default) 126 (break-on-program-errors *fasl-break-on-program-errors*) 127 (external-format :default) 113 128 force) 114 129 "Compile INPUT-FILE, producing a corresponding fasl file and returning … … 121 136 (restart-case 122 137 (return (%compile-file src output-file verbose print load features 123 save-local-symbols save-doc-strings save-definitions force backend external-format)) 138 save-local-symbols save-doc-strings save-definitions 139 break-on-program-errors 140 force backend external-format)) 124 141 (retry-compile-file () 125 142 :report (lambda (stream) (format stream "Retry compiling ~s" src)) … … 131 148 132 149 (defun %compile-file (src output-file verbose print load features 133 save-local-symbols save-doc-strings save-definitions force target-backend external-format 150 save-local-symbols save-doc-strings save-definitions 151 break-on-program-errors 152 force target-backend external-format 134 153 &aux orig-src) 135 154 … … 166 185 (*fasl-save-doc-strings* save-doc-strings) 167 186 (*fasl-save-definitions* save-definitions) 187 (*fasl-break-on-program-errors* break-on-program-errors) 168 188 (*fcomp-warnings-header* nil) 169 189 (*compile-file-pathname* orig-src) … … 192 212 (multiple-value-bind (any harsh) (report-deferred-warnings) 193 213 (setq *fasl-warnings-signalled-p* (or *fasl-warnings-signalled-p* any) 194 *fasl-non-style-warnings-signalled-p* (or *fasl-non-style-warnings-signalled-p* harsh)))) 214 *fasl-non-style-warnings-signalled-p* (if (eq harsh :very) :very 215 (or *fasl-non-style-warnings-signalled-p* harsh))))) 216 (when (and *fasl-break-on-program-errors* (eq *fasl-non-style-warnings-signalled-p* :very)) 217 (cerror "create the output file despite the errors" 218 "Serious errors encountered during compilation of ~s" 219 src)) 195 220 (fasl-scan-forms-and-dump-file forms output-file lexenv))) 196 221 (when load (load output-file :verbose (or verbose *load-verbose*))) 197 222 (values (truename (pathname output-file)) 198 223 *fasl-warnings-signalled-p* 199 *fasl-non-style-warnings-signalled-p*))))224 (and *fasl-non-style-warnings-signalled-p* t))))) 200 225 201 226 (defvar *fcomp-locked-hash-tables*) … … 839 864 ;;; making an lfun, but it's simpler this way... 840 865 (defun fcomp-named-function (def name env) 841 (let* ((env (new-lexical-environment env))) 866 (let* ((env (new-lexical-environment env)) 867 (*nx-break-on-program-errors* (not (memq *fasl-break-on-program-errors* '(nil :defer))))) 842 868 (multiple-value-bind (lfun warnings) 843 869 (compile-named-function
Note: See TracChangeset
for help on using the changeset viewer.