Fix reporting of struct constructors in TR.

This commit is contained in:
Vincent St-Amour 2013-09-28 10:53:29 -04:00
parent 1ccdc3a60d
commit 5f2dfa5144
2 changed files with 18 additions and 1 deletions

View File

@ -29,6 +29,8 @@
;; Log calls to struct constructors, so that OC can report those used in ;; Log calls to struct constructors, so that OC can report those used in
;; hot loops. ;; hot loops.
(pattern (#%plain-app op:id args:opt-expr ...) (pattern (#%plain-app op:id args:opt-expr ...)
#:when (struct-constructor? #'op) #:when (let ([constructor-for (syntax-property #'op 'constructor-for)])
(or (and constructor-for (struct-constructor? constructor-for))
(struct-constructor? #'op)))
#:do [(log-optimization-info "struct constructor" #'op)] #:do [(log-optimization-info "struct constructor" #'op)]
#:with opt #'(op args.opt ...))) #:with opt #'(op args.opt ...)))

View File

@ -0,0 +1,15 @@
#;#;
#<<END
TR info: struct-constructor.rkt 15:7 foo -- struct constructor
END
#<<END
END
#lang typed/racket
(provide (struct-out foo))
(struct: foo ())
(void (foo))