(define impc:ir:compiler:while-loop
(lambda (ast types)
(let* ((os (make-string 0))
(loop-num-string (number->string (llvm:count++)))
(loop (string-append "%loop" loop-num-string))
(after (string-append "%after" loop-num-string)))
(emit "; while loop\n" os)
;; initial test
(emit (impc:ir:compiler (car ast) types) os)
(emit "br i1 " (car (impc:ir:gname))
", label " loop
", label " after
"\n" os)