Changeset 11514 for trunk/source/lib/nfcomp.lisp
- Timestamp:
- Dec 12, 2008, 6:15:09 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/lib/nfcomp.lisp
r11420 r11514 143 143 (warn "Unknown :TARGET : ~S. Reverting to ~s ..." target *fasl-target*) 144 144 (setq target *fasl-target* backend *target-backend*)) 145 (loop 146 (restart-case 147 (return (%compile-file src output-file verbose print load features 148 save-local-symbols save-doc-strings save-definitions 149 save-source-locations break-on-program-errors 150 force backend external-format 151 compile-file-original-truename compile-file-original-buffer-offset)) 152 (retry-compile-file () 153 :report (lambda (stream) (format stream "Retry compiling ~s" src)) 154 nil) 155 (skip-compile-file () 156 :report (lambda (stream) (format stream "Skip compiling ~s" src)) 157 (return)))))) 145 (multiple-value-bind (output-file truename warnings-p serious-p) 146 (loop 147 (restart-case 148 (return (%compile-file src output-file verbose print features 149 save-local-symbols save-doc-strings save-definitions 150 save-source-locations break-on-program-errors 151 force backend external-format 152 compile-file-original-truename compile-file-original-buffer-offset)) 153 (retry-compile-file () 154 :report (lambda (stream) (format stream "Retry compiling ~s" src)) 155 nil) 156 (skip-compile-file () 157 :report (lambda (stream) 158 (if load 159 (format stream "Skip compiling and loading ~s" src) 160 (format stream "Skip compiling ~s" src))) 161 (return-from compile-file)))) 162 (when load (load output-file :verbose (or verbose *load-verbose*))) 163 (values truename warnings-p serious-p)))) 164 158 165 159 166 (defvar *fasl-compile-time-env* nil) 160 167 161 (defun %compile-file (src output-file verbose print loadfeatures168 (defun %compile-file (src output-file verbose print features 162 169 save-local-symbols save-doc-strings save-definitions 163 170 save-source-locations break-on-program-errors … … 165 172 compile-file-original-truename compile-file-original-buffer-offset) 166 173 (let* ((orig-src (merge-pathnames src)) 167 (output-default-type (backend-target-fasl-pathname target-backend))) 174 (output-default-type (backend-target-fasl-pathname target-backend)) 175 (*fasl-non-style-warnings-signalled-p* nil) 176 (*fasl-warnings-signalled-p* nil)) 168 177 (setq src (fcomp-find-file orig-src)) 169 178 (let* ((newtype (pathname-type src))) … … 171 180 (setq orig-src (merge-pathnames orig-src (make-pathname :type newtype :defaults nil))))) 172 181 (setq output-file (merge-pathnames 173 (if output-file ; full-pathname in case output-file is relative182 (if output-file ; full-pathname in case output-file is relative 174 183 (full-pathname (merge-pathnames output-file output-default-type) :no-error nil) 175 184 output-default-type) … … 179 188 (when (physical-pathname-p orig-src) ; only back-translate to things likely to exist at load time 180 189 (setq orig-src (back-translate-pathname orig-src '("home" "ccl")))) 181 (let* ((*fasl-non-style-warnings-signalled-p* nil) 182 (*fasl-warnings-signalled-p* nil)) 183 (when (and (not force) 184 (probe-file output-file) 185 (not (fasl-file-p output-file))) 186 (unless (y-or-n-p 187 (format nil 188 "Compile destination ~S is not ~A file! Overwrite it?" 189 output-file (pathname-type 190 (backend-target-fasl-pathname 191 *target-backend*)))) 192 (return-from %compile-file nil))) 190 (when (and (not force) 191 (probe-file output-file) 192 (not (fasl-file-p output-file))) 193 (cerror "overwrite it anyway" 194 "Compile destination ~S is not a ~A file!" 195 output-file (pathname-type 196 (backend-target-fasl-pathname 197 *target-backend*)))) 193 198 (let* ((*features* (append (if (listp features) features (list features)) (setup-target-features target-backend *features*))) 194 199 (*fasl-deferred-warnings* nil) ; !!! WITH-COMPILATION-UNIT ... … … 213 218 (lexenv (new-lexical-environment defenv)) 214 219 (*fasl-compile-time-env* (new-lexical-environment (new-definition-environment))) 215 (*fcomp-external-format* external-format) )216 (let ((forms nil))217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 (fasl-scan-forms-and-dump-file forms output-file lexenv)))238 ( when load (load output-file :verbose (or verbose *load-verbose*)))239 (values(truename (pathname output-file))220 (*fcomp-external-format* external-format) 221 (forms nil)) 222 (let* ((*outstanding-deferred-warnings* (%defer-warnings nil))) 223 (rplacd (defenv.type defenv) *outstanding-deferred-warnings*) 224 (setf (defenv.defined defenv) (deferred-warnings.defs *outstanding-deferred-warnings*)) 225 226 (setq forms (fcomp-file src 227 (or compile-file-original-truename orig-src) 228 compile-file-original-buffer-offset 229 lexenv)) 230 231 (setf (deferred-warnings.warnings *outstanding-deferred-warnings*) 232 (append *fasl-deferred-warnings* (deferred-warnings.warnings *outstanding-deferred-warnings*))) 233 (when *compile-verbose* (fresh-line)) 234 (multiple-value-bind (any harsh) (report-deferred-warnings) 235 (setq *fasl-warnings-signalled-p* (or *fasl-warnings-signalled-p* any) 236 *fasl-non-style-warnings-signalled-p* (if (eq harsh :very) :very 237 (or *fasl-non-style-warnings-signalled-p* harsh))))) 238 (when (and *fasl-break-on-program-errors* (eq *fasl-non-style-warnings-signalled-p* :very)) 239 (cerror "create the output file despite the errors" 240 "Serious errors encountered during compilation of ~s" 241 src)) 242 (fasl-scan-forms-and-dump-file forms output-file lexenv) 243 (values output-file 244 (truename (pathname output-file)) 240 245 *fasl-warnings-signalled-p* 241 246 (and *fasl-non-style-warnings-signalled-p* t)))))
Note: See TracChangeset
for help on using the changeset viewer.