Have inlining reporting produce report entries directly.

This commit is contained in:
Vincent St-Amour 2012-11-25 17:58:11 -05:00
parent 4933d9f00f
commit 6d7f1627b8
2 changed files with 30 additions and 22 deletions

View File

@ -180,23 +180,30 @@
;; Produce as many log entries as necessary.
(define (emit e) (set! produced-entries (cons e produced-entries)))
(define start (sub1 pos))
(define end (+ start (syntax-span stx)))
(define (emit-near-miss msg badness)
(emit (missed-opt-log-entry
kind
(emit (report-entry
(list (missed-opt-report-entry
located-stx
(format "Missed Inlining ~a\n~a~a"
(format-aggregation-string pruned-log)
(if msg (format "~a\n" msg) "")
recommendation)
stx located-stx pos provenance
'() '()
;; uses ceiling to never go down to 0
;; both badness and badness-multiplier are non-0
(ceiling (* badness badness-multiplier)))))
provenance
badness
'())) ; no irritants to highlight
start end
badness)))
(define (emit-success)
(emit (opt-log-entry
kind
(format "Inlining ~a" (format-aggregation-string pruned-log))
stx located-stx pos provenance)))
(emit (report-entry
(list (opt-report-entry
located-stx
(format "Inlining ~a"
(format-aggregation-string pruned-log))
provenance))
start end
0)))
(define inside-hot-function?
(and profile (memq profile-entry hot-functions)))

View File

@ -10,13 +10,14 @@
(define (generate-report this profile)
(define-values (TR-log mzc-log info-log) (generate-logs this))
(define hot-functions (and profile (prune-profile profile)))
(append
(log->report
(append (causality-merging
(prune-cold-TR-failures TR-log profile hot-functions))
(report-inlining mzc-log profile hot-functions)
(if profile
(report-hidden-costs info-log profile hot-functions)
'()))))
'())))
(report-inlining mzc-log profile hot-functions)))
;; Returns a report-entry or #f, which means prune.