Skip to content

Commit

Permalink
Revert "fix #18129, optimize some more cases of captured variables"
Browse files Browse the repository at this point in the history
This reverts commit 09f7005.
un-backports #18130 for now until there's a fix for #18173
(was breaking BaseTestDeprecated.jl)
  • Loading branch information
tkelman committed Aug 22, 2016
1 parent fafdc7b commit d45bcae
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/julia-syntax.scm
Original file line number Diff line number Diff line change
Expand Up @@ -2721,27 +2721,25 @@ f(x) = yt(x)
(any vinfo:sa vi))
(let* ((leading
(filter (lambda (x) (and (pair? x)
(let ((cx (car x)))
(or (and (eq? cx 'method) (length> x 2))
(eq? cx '=)
(eq? cx 'call)))))
(or (and (eq? (car x) 'method)
(length> x 2))
(eq? (car x) '=))))
(take-statements-while
(lambda (e)
(or (atom? e)
(memq (car e) '(quote top core line inert local unnecessary
meta inbounds boundscheck simdloop
implicit-global global globalref
const newvar = null method call))))
const newvar = null method))))
(lam:body lam))))
(unused (map cadr (filter (lambda (x) (memq (car x) '(method =)))
leading)))
(unused (map cadr leading))
(def (table)))
;; TODO: reorder leading statements to put assignments where the RHS is
;; `simple-atom?` at the top.
(for-each (lambda (e)
(set! unused (filter (lambda (v) (not (expr-uses-var e v)))
unused))
(if (and (memq (car e) '(method =)) (memq (cadr e) unused))
(if (memq (cadr e) unused)
(put! def (cadr e) #t)))
leading)
(for-each (lambda (v)
Expand Down

0 comments on commit d45bcae

Please sign in to comment.