Doc
Try
Src
hello.co
1
2
3
4
5
6
7
8
9
10
(pkg "example"
(file "hello.co"
(<(int, int) -> int>fun foo ((<int>x <int>) (<int>y <int>)) -> <int>
(<nil>block
(while (<bool>GTR <int>x <i32>0)
(<nil>block
(assign (<int>x) -- ())
)
)
(return <int>y)
))
(<(int) -> bool>fun bar ((<int>x <int>)) -> <bool>
(<nil>block
(return (<bool>OROR (<bool>TypeConvExpr <int>x) (<bool>TypeConvExpr <i32>0)))
))
)
)
foo (int int)->int
b0:
v0 = Arg <i32> [0] // x; 1 use
v1 = Arg <i32> [1] // y; 1 use
v3 = ConstI32 <i32> [0] // 1 use
cont —> b1
b1: <— b0, b2 // while
v4 = GreaterS32 <bool> v0 v3 // 1 use
if v4 —> b2, b3
b2: <— b1 // then
cont —> b1
b3: <— b1 // endwhile
ret v1
bar (int)->bool
b0:
v0 = Arg <i32> [0] // x; 1 use
v1 = TruncI32toBool <bool> v0 // 1 use
v2 = ConstI32 <i32> [0] // 1 use
v5 = ConstBool <bool> [1] // 1 use
if v1 —> b2, b1
b1: <— b0
v3 = TruncI32toBool <bool> v2 // 1 use
cont —> b2
b2: <— b0, b1
v4 = Phi <bool> v5 v3 // 1 use
ret v4
compiling package with files ["hello.co"]
completed in 11.0ms
Optimize
Codegen