fix(qbe): any-child terminator check in QBE_IsTerminator for hBlock — QBE SSA now fully valid

- QBE_IsTerminator(hBlock) checks ALL children, not just last
- Removed legacy c_backend.bux and nim_backend.bux from _selfhost/src/
- QBE self-hosting QBE phase: PASSES (SSA valid, assembled to .s)
- Remaining: linker errors from missing String_Eq/StringBuilder in runtime
This commit is contained in:
2026-06-02 13:56:12 +03:00
parent 6cb5528a4d
commit eb8179b6d0
142 changed files with 70706 additions and 1407 deletions
+33
View File
@@ -0,0 +1,33 @@
export
function w $main(w %argc, l %argv) {
@start
%fmt =l alloc8 8
storel 1663398693, %fmt # "%s%c"
%av0 =l add %argv, 8
%ac0 =w sub %argc, 1
@loop
%av =l phi @start %av0, @loop2 %av1
%ac =w phi @start %ac0, @loop2 %ac1
%c0 =w ceqw %ac, 0
jnz %c0, @end, @loop1
@loop1
%c1 =w ceqw %ac, 1
jnz %c1, @last, @nolast
@last
jmp @loop2
@nolast
jmp @loop2
@loop2
%sep =w phi @last 10, @nolast 32
%arg =l loadl %av
%r =w call $printf(l %fmt, ..., l %arg, w %sep)
%av1 =l add %av, 8
%ac1 =w sub %ac, 1
jmp @loop
@end
ret 0
}
# >>> output
# a b c
# <<<