cl: compile async functions

This commit is contained in:
Li Jie
2024-08-04 09:54:34 +08:00
parent 806193fc6e
commit efa771f3ff
18 changed files with 1127 additions and 1103 deletions

View File

@@ -232,6 +232,13 @@ func (b Builder) ArrayAlloca(telem Type, n Expr) (ret Expr) {
return
}
func (b Builder) OffsetPtr(ptr, offset Expr) Expr {
if debugInstr {
log.Printf("OffsetPtr %v, %v\n", ptr.impl, offset.impl)
}
return Expr{llvm.CreateGEP(b.impl, ptr.Type.ll, ptr.impl, []llvm.Value{offset.impl}), ptr.Type}
}
/* TODO(xsw):
// ArrayAlloc allocates zero initialized space for an array of n elements of type telem.
func (b Builder) ArrayAlloc(telem Type, n Expr) (ret Expr) {