Add simpler way of logging optimizations
This commit is contained in:
parent
10ffb52968
commit
67fba30c09
|
@ -1,11 +1,12 @@
|
|||
#lang racket/base
|
||||
|
||||
(require racket/string
|
||||
unstable/syntax unstable/logging
|
||||
(require racket/string
|
||||
unstable/syntax unstable/logging syntax/parse
|
||||
data/queue
|
||||
"../utils/tc-utils.rkt")
|
||||
|
||||
(provide log-optimization log-missed-optimization log-optimization-info
|
||||
log-opt log-opt-info
|
||||
with-tr-logging-to-queue
|
||||
(struct-out log-entry)
|
||||
(struct-out opt-log-entry)
|
||||
|
@ -35,6 +36,9 @@
|
|||
(emit-log-message
|
||||
(opt-log-entry kind msg stx (locate-stx stx) (syntax-position stx)))))
|
||||
|
||||
(define-syntax-rule (log-opt kind msg)
|
||||
(log-optimization kind msg this-syntax))
|
||||
|
||||
;;--------------------------------------------------------------------
|
||||
|
||||
;; Keep track of optimizations that "almost" happened, with the intention
|
||||
|
@ -79,6 +83,10 @@
|
|||
;; no actual message, since it's not meant for user consumption
|
||||
(info-log-entry kind "" stx (locate-stx stx) (syntax-position stx)))))
|
||||
|
||||
|
||||
(define-syntax-rule (log-opt-info kind)
|
||||
(log-optimization-info kind this-syntax))
|
||||
|
||||
;;--------------------------------------------------------------------
|
||||
|
||||
(define (line+col->string stx)
|
||||
|
|
Loading…
Reference in New Issue
Block a user