Address TODO

This commit is contained in:
Justin Ethier 2019-09-19 16:22:25 -04:00
parent 78a786a7a5
commit fd72c918b6

View file

@ -40,6 +40,7 @@
st:->var) st:->var)
(begin (begin
(define *cell-local-var* #f)
(define *optimize-well-known-lambdas* #f) (define *optimize-well-known-lambdas* #f)
(define (emit line) (define (emit line)
@ -836,6 +837,7 @@
(list (list
(string-append c-func "(" cv-name tdata-comma tdata))))) (string-append c-func "(" cv-name tdata-comma tdata)))))
(else (else
(if (> (string-length tptr) 0) (set! *cell-local-var* tptr))
(c-code/vars (c-code/vars
(string-append c-func "(" tdata tptr-comma tptr) (string-append c-func "(" tdata tptr-comma tptr)
(list tptr-decl)))))) (list tptr-decl))))))
@ -1657,13 +1659,16 @@
(string-append (string-append
cv-name sep "elements[" (number->string i) "] = " cv-name sep "elements[" (number->string i) "] = "
(if (and (ref? (cdr (car vars))) (if (and (ref? (cdr (car vars)))
(mutated-loop-var? (cdr (car vars)))) (mutated-loop-var? (cdr (car vars)))
TODO: don't want this, actually want the pair_type it is getting boxed into! (string? *cell-local-var*))
might be able to save the local when an instance of (cell ...) is compiled and ;TODO: don't want this, actually want the pair_type it is getting boxed into!
then ref it here (setting it back to #f) after. not pretty but would work to at ;might be able to save the local when an instance of (cell ...) is compiled and
least prove out the concept... ;then ref it here (setting it back to #f) after. not pretty but would work to at
;(tptr-type (mangle (gensym 'local))) ;least prove out the concept...
(string-append "&" cv-name) ;; Self-ref ;;(tptr-type (mangle (gensym 'local)))
(let ((result (string-append "&" *cell-local-var*))) ;; Self-ref
(set! *cell-local-var* #f)
result)
(car (car vars)) ) (car (car vars)) )
";\n" ";\n"
(loop (+ i 1) (cdr vars))))))))) (loop (+ i 1) (cdr vars)))))))))