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

@@ -63,6 +63,12 @@ type aBuilder struct {
Func Function
Pkg Package
Prog Program
async bool
asyncToken Expr
promise Expr
onSuspBlk func(blk BasicBlock) (susp BasicBlock, next BasicBlock, clean BasicBlock)
blkOffset int
}
// Builder represents a builder for creating instructions in a function.
@@ -288,7 +294,7 @@ func (b Builder) Times(n Expr, loop func(i Expr)) {
}
// -----------------------------------------------------------------------------
/*
type caseStmt struct {
v llvm.Value
blk llvm.BasicBlock
@@ -326,7 +332,7 @@ func (b Builder) Switch(v Expr, defb BasicBlock) Switch {
}
return &aSwitch{v.impl, defb.first, nil}
}
*/
// -----------------------------------------------------------------------------
// Phi represents a phi node.