mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
New features:
* Functions can have parameters in semantic analysis. Codegen
is not implemented yet.
* Support for i8, i16, i32, i64, u8, u16, u32, u64 primitive
identifiers.
* New ZIR instructions: arg, block, and breakvoid
Implementation details:
* Move Module.Body to ir.Body
* Scope.Block gains a parent field and an optional Label field
* Fix bug in integer type equality comparison.
Here's the test case I'm working towards:
```
@void = primitive(void)
@i32 = primitive(i32)
@fnty = fntype([@i32, @i32], @void)
@0 = str("entry")
@1 = export(@0, "entry")
@entry = fn(@fnty, {
%0 = arg(0)
%1 = arg(1)
%2 = add(%0, %1)
%3 = int(7)
%4 = block("if", {
%neq = cmp(%2, neq, %3)
%5 = condbr(%neq, {
%6 = unreachable()
}, {
%7 = breakvoid("if")
})
})
%11 = returnvoid()
})
```
$ ./zig-cache/bin/zig build-obj test.zir
test.zir:9:12: error: TODO implement function parameters for Arch.x86_64
That's where I left off.
|
||
|---|---|---|
| .. | ||
| codegen | ||
| clang.zig | ||
| clang_options.zig | ||
| clang_options_data.zig | ||
| codegen.zig | ||
| dep_tokenizer.zig | ||
| introspect.zig | ||
| ir.zig | ||
| libc_installation.zig | ||
| link.zig | ||
| llvm.zig | ||
| main.zig | ||
| Module.zig | ||
| Package.zig | ||
| print_targets.zig | ||
| stage2.zig | ||
| test.zig | ||
| tracy.zig | ||
| translate_c.zig | ||
| type.zig | ||
| TypedValue.zig | ||
| value.zig | ||
| windows_sdk.zig | ||
| zir.zig | ||