fix problem where --save-temps didn't work for 3m-generated file (due to lingering handler installed by 3m)

svn: r7320
This commit is contained in:
Matthew Flatt 2007-09-11 20:56:08 +00:00
parent 188186ca25
commit dec670ff75
2 changed files with 30 additions and 24 deletions

View File

@ -1370,11 +1370,20 @@
(when (compiler:option:verbose) (printf " [compiling native code to \"~a\"]~n" (when (compiler:option:verbose) (printf " [compiling native code to \"~a\"]~n"
obj-output-path)) obj-output-path))
(let ([clean-up
(lambda ()
(when (and (compiler:option:clean-intermediate-files)
input-path)
(if c3m-output-path
(delete-file c3m-output-path)
(delete-file c-output-path))))])
;; Compile ;; Compile
(let ([compile-thunk (let ([compile-thunk
(lambda () (lambda ()
(with-handlers (with-handlers
([void (lambda (exn) ([void (lambda (exn)
(clean-up)
(compiler:fatal-error (compiler:fatal-error
#f #f
(string-append (string-append
@ -1387,12 +1396,7 @@
(list (collection-path "compiler")))))]) (list (collection-path "compiler")))))])
(verbose-time compile-thunk)) (verbose-time compile-thunk))
;; clean-up (clean-up))
(when (and (compiler:option:clean-intermediate-files)
input-path)
(if c3m-output-path
(delete-file c3m-output-path)
(delete-file c-output-path)))
(if multi-o? (if multi-o?
(printf " [output to \"~a\"]~n" obj-output-path) (printf " [output to \"~a\"]~n" obj-output-path)

View File

@ -13,7 +13,9 @@
precompiling-header? precompiled-header precompiling-header? precompiled-header
show-info? output-depends-info? show-info? output-depends-info?
gc-variable-stack-through-funcs?) gc-variable-stack-through-funcs?)
(parameterize ([current-output-port (current-output-port)]) (parameterize ([current-output-port (current-output-port)] ; because we mutate these...
[error-escape-handler (error-escape-handler)]
[current-inspector (current-inspector)])
(begin-with-definitions (begin-with-definitions
(define power-inspector (current-inspector)) (define power-inspector (current-inspector))
(current-inspector (make-inspector)) (current-inspector (make-inspector))