more missing srclocs

This commit is contained in:
Spencer Florence 2015-08-21 15:48:21 -05:00 committed by Vincent St-Amour
parent 1d2da49dfb
commit 9fb79b4e18

View File

@ -195,7 +195,7 @@
#:with opt (n-ary->binary this-syntax #'op.unsafe #'(fs.opt ...)))
(pattern (#%plain-app op:binary-float-comp f1:float-expr f2:float-expr)
#:do [(log-fl-opt "binary float comp")]
#:with opt #'(op.unsafe f1.opt f2.opt))
#:with opt (syntax/loc this-syntax (op.unsafe f1.opt f2.opt)))
(pattern (#%plain-app op:binary-float-comp
f1:float-expr
f2:float-expr
@ -227,13 +227,13 @@
(pattern (#%plain-app op:-^ f:float-expr)
#:do [(log-fl-opt "unary float")]
#:with opt #'(unsafe-fl* -1.0 f.opt))
#:with opt (syntax/loc this-syntax (unsafe-fl* -1.0 f.opt)))
(pattern (#%plain-app op:/^ f:float-expr)
#:do [(log-fl-opt "unary float")]
#:with opt #'(unsafe-fl/ 1.0 f.opt))
#:with opt (syntax/loc this-syntax (unsafe-fl/ 1.0 f.opt)))
(pattern (#%plain-app op:sqr^ f:float-expr)
#:do [(log-fl-opt "unary float")]
#:with opt #'(let ([tmp f.opt]) (unsafe-fl* tmp tmp)))
#:with opt (syntax/loc this-syntax (let ([tmp f.opt]) (unsafe-fl* tmp tmp))))
;; we can optimize exact->inexact if we know we're giving it an Integer
(pattern (#%plain-app op:->float^ n:int-expr)
@ -250,19 +250,19 @@
(pattern (#%plain-app op:zero?^ f:float-expr)
#:do [(log-fl-opt "float zero?")]
#:with opt #'(unsafe-fl= f.opt 0.0))
#:with opt (syntax/loc this-syntax (unsafe-fl= f.opt 0.0)))
(pattern (#%plain-app op:add1^ n:float-expr)
#:do [(log-fl-opt "float add1")]
#:with opt #'(unsafe-fl+ n.opt 1.0))
#:with opt (syntax/loc this-syntax (unsafe-fl+ n.opt 1.0)))
(pattern (#%plain-app op:sub1^ n:float-expr)
#:do [(log-fl-opt "float sub1")]
#:with opt #'(unsafe-fl- n.opt 1.0))
#:with opt (syntax/loc this-syntax (unsafe-fl- n.opt 1.0)))
(pattern (#%plain-app op:random-op prng:opt-expr)
#:when (subtypeof? #'prng -Pseudo-Random-Generator)
#:do [(log-fl-opt "float random")]
#:with opt #'(unsafe-flrandom prng.opt))
#:with opt (syntax/loc this-syntax (unsafe-flrandom prng.opt)))
(pattern (#%plain-app op:random^) ; random with no args
#:do [(log-fl-opt "float 0-arg random")
;; We introduce a reference to `current-pseudo-random-generator',
@ -270,7 +270,7 @@
;; from triggering down the line (see hidden-cost.rkt), so we need
;; to do the logging ourselves.
(log-optimization-info "hidden parameter (random)" #'op)]
#:with opt #'(unsafe-flrandom (current-pseudo-random-generator)))
#:with opt (syntax/loc this-syntax (unsafe-flrandom (current-pseudo-random-generator))))
;; warn about (potentially) exact real arithmetic, in general
;; Note: These patterns don't perform optimization. They only produce logging
@ -278,15 +278,15 @@
(pattern (#%plain-app op:binary-float-op n:opt-expr ...)
#:when (maybe-exact-rational? this-syntax)
#:do [(log-opt-info "possible exact real arith")]
#:with opt #'(op n.opt ...))
#:with opt (syntax/loc this-syntax (op n.opt ...)))
(pattern (#%plain-app op:binary-float-comp n:opt-expr ...)
;; can't look at return type, since it's always bool
#:when (andmap maybe-exact-rational? (syntax->list #'(n ...)))
#:do [(log-opt-info "possible exact real arith")]
#:with opt #'(op n.opt ...))
#:with opt (syntax/loc this-syntax (op n.opt ...)))
(pattern (#%plain-app op:unary-float-op n:opt-expr ...)
#:when (maybe-exact-rational? this-syntax)
#:do [(log-opt-info "possible exact real arith")]
#:with opt #'(op n.opt ...))
#:with opt (syntax/loc this-syntax (op n.opt ...)))
)