From d45bcaeb76c2693834520f8f39785903ab85efd3 Mon Sep 17 00:00:00 2001 From: Tony Kelman Date: Mon, 22 Aug 2016 04:51:15 -0400 Subject: [PATCH] Revert "fix #18129, optimize some more cases of captured variables" This reverts commit 09f7005d48e3390333cfd2d381b6b34aa5a5bece. un-backports #18130 for now until there's a fix for #18173 (was breaking BaseTestDeprecated.jl) --- src/julia-syntax.scm | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/julia-syntax.scm b/src/julia-syntax.scm index aaf07bca7d74a..f762753a5f80f 100644 --- a/src/julia-syntax.scm +++ b/src/julia-syntax.scm @@ -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)