doc: update docs and sample files

This commit is contained in:
2026-01-19 14:20:04 +00:00
parent db1eba08b8
commit fb09facdda
18 changed files with 2516 additions and 268 deletions

View File

@@ -1,31 +1,15 @@
data @cout = external global id
ivy.module @test {
%cout = ivy.global-ref @cout
data @.str.0 = str "hello"
ivy.init-text {
%str = ivy.str.constant "hello"
%.str.0 = ivy.str.constant "done"
define void @init() static {
entry:
%0 = load str, ptr @.str.0
%str = alloca id
store str %0, ptr %str
ivy.for-each %c in %str {
ivy.msg to %cout, -put:%c
}
%1 = load id, ptr %str
%for.it = msg id, id %1, @_M8iteratorE
br label %for.cond
for.cond:
%for.value = msg id, id %for.it, @_M5valueE
%for.finished = cmp eq id %for.value, null
br i1 %for.finished, label %for.end, label %for.body
for.body:
%c = alloca id
store id %for.value, ptr %c
ivy.msg to %cout, -put:%.str.0
%2 = load id, ptr @cout
%3 = load id, ptr %c
msg void, id %2, @_M03putE [ id %3 ]
br label %for.inc
for.inc:
msg void, id %for.it, @_M8moveNextE
br label %for.cond
for.end:
ret void
}
}