From 2b655af885b5df15014b6cec8e17189540f64bfd Mon Sep 17 00:00:00 2001 From: Vincent St-Amour Date: Fri, 1 Jul 2011 12:11:04 -0400 Subject: [PATCH] Use locate-stx earlier in the logging process, for nicer display in the tool. original commit: d3db388c05529e86363f43373d7ab779fd964935 --- collects/typed-scheme/optimizer/logging.rkt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/collects/typed-scheme/optimizer/logging.rkt b/collects/typed-scheme/optimizer/logging.rkt index ebee253e..0a2f92df 100644 --- a/collects/typed-scheme/optimizer/logging.rkt +++ b/collects/typed-scheme/optimizer/logging.rkt @@ -31,7 +31,8 @@ (define (log-optimization kind msg stx) - (let ([new-entry (opt-log-entry kind msg stx (syntax-position stx))]) + (let* ([stx (locate-stx stx)] + [new-entry (opt-log-entry kind msg stx (syntax-position stx))]) (set! log-so-far (cons new-entry log-so-far)))) ;;-------------------------------------------------------------------- @@ -91,9 +92,10 @@ ;; Attempts to merge the incoming missed optimization with existing ones. ;; Otherwise, adds the new one to the log. (define (log-missed-optimization kind msg stx [irritants '()]) - ;; for convenience, if a single irritant is given, wrap it in a list - ;; implicitly - (let* ([irritants (if (list? irritants) irritants (list irritants))] + (let* ([stx (locate-stx stx)] + ;; for convenience, if a single irritant is given, wrap it in a list + ;; implicitly + [irritants (if (list? irritants) irritants (list irritants))] [new (missed-opt-log-entry kind msg stx (syntax-position stx) irritants '() 1)] @@ -184,7 +186,7 @@ ;; For command-line printing purposes. ;; Not as user friendly as what's produced by the DrRacket tool. (define (format-log-entry entry) - (define stx (locate-stx (log-entry-stx entry))) + (define stx (log-entry-stx entry)) (define msg (format "~a ~a ~s -- ~a" (syntax-source-file-name stx)