impc:ir:compiler:stack-alloc-with-size   scheme


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/runtime/llvmir.xtm

Implementation

(define impc:ir:compiler:stack-alloc-with-size
  (lambda (ast types hint?)
    (let* ((os (make-string 0)))
      (let* ((idx-str (impc:ir:compiler (cadr ast) types))
             (idx (impc:ir:gname))
             (t (impc:ir:get-type-str (impc:ir:pointer-- (car hint?)))))
        (emit idx-str os)
        (emit (string-append (impc:ir:gname "dat" (string-append t "*")) " = alloca " t ", " (cadr idx) " " (car idx) ", align 16\n") os)
        (impc:ir:strip-space os)))))


Back to Index