mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-23 20:15:05 +02:00
Reorganize, disable new code for now
This commit is contained in:
parent
27d4c3e95f
commit
0862070e52
1 changed files with 19 additions and 11 deletions
|
@ -1570,8 +1570,27 @@
|
|||
(analyze2 exp) ;; Second pass
|
||||
(analyze:find-inlinable-vars exp '()) ;; Identify variables safe to inline
|
||||
(analyze:find-recursive-calls2 exp)
|
||||
;(analyze:set-calls-self)
|
||||
)
|
||||
|
||||
(define (analyze:set-calls-self)
|
||||
(let ((idents (filter symbol? (hash-table-keys *adb*))))
|
||||
(for-each
|
||||
(lambda (id)
|
||||
(let ((var (adb:get/default id #f)))
|
||||
(when (and var (adbv:self-rec-call? var))
|
||||
(and-let*
|
||||
((a-value (adbv:assigned-value var))
|
||||
((pair? a-value))
|
||||
((ast:lambda? (car a-value)))
|
||||
(lid (ast:lambda-id (car a-value))))
|
||||
(trace:info `(TODO ,id ,lid ,a-value))
|
||||
(with-fnc! lid (lambda (fnc)
|
||||
(adbf:set-calls-self! fnc #t))))
|
||||
))
|
||||
)
|
||||
idents)))
|
||||
|
||||
;; NOTES:
|
||||
;;
|
||||
;; TODO: run CPS optimization (not all of these phases may apply)
|
||||
|
@ -2006,17 +2025,6 @@
|
|||
(when (equal? (car exp) def-sym)
|
||||
(trace:info `("recursive call" ,exp))
|
||||
(with-var! def-sym (lambda (var)
|
||||
|
||||
;; TODO: want to set on the fnc as well, problem is base.sld:list-tail (and other globals?) has an
|
||||
;; assigned value of (list ast-lamdda) instead of just ast-lambda - WTF?
|
||||
;; search for adbv-set-assigned-value-helper! - can we just get car of (define->exp)???
|
||||
;; (and-let*
|
||||
;; ((a-value (adbv:assigned-value var))
|
||||
;; ((ast:lambda? a-value))
|
||||
;; (lid (ast:lambda-id a-value)))
|
||||
;; (with-fnc! lid (lambda (fnc)
|
||||
;; (adbf:set-calls-self! fnc #t))))
|
||||
|
||||
(adbv:set-self-rec-call! var #t)))
|
||||
))
|
||||
(else #f)))
|
||||
|
|
Loading…
Add table
Reference in a new issue