Cleanup number optimizations.

This commit is contained in:
Eric Dobson 2013-09-04 21:46:59 -07:00
parent 64064f69d7
commit 50ee4c75b2

View File

@ -8,14 +8,11 @@
(provide number-opt-expr) (provide number-opt-expr)
(define-literal-syntax-class unary-op (+ * min max))
(define-syntax-class number-opt-expr (define-syntax-class number-opt-expr
#:commit #:commit
;; these cases are all identity ;; these cases are all identity
(pattern (#%plain-app (~and op (~or (~literal +) (~literal *) (pattern (#%plain-app op:unary-op f:opt-expr)
(~literal min) (~literal max))) #:do [(log-opt "unary number" "Identity elimination.")]
f:expr) #:with opt #'f.opt))
#:with opt
(begin (log-optimization "unary number" "Identity elimination."
this-syntax)
(add-disappeared-use #'op)
((optimize) #'f))))