aboutsummaryrefslogtreecommitdiff
path: root/src/codegen/c.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2021-10-14 17:44:46 -0700
committerAndrew Kelley <andrew@ziglang.org>2021-10-14 17:44:46 -0700
commit8b882747813878a40b63572636a6e86a59a8581e (patch)
tree82bb715d9575a81c7b06d1ff205ee43585a47de1 /src/codegen/c.zig
parented5a5e22936e5d90b6c9d255b17076f0db45c040 (diff)
downloadzig-8b882747813878a40b63572636a6e86a59a8581e.tar.gz
zig-8b882747813878a40b63572636a6e86a59a8581e.zip
stage2: improved union support
* `Module.Union.getFullyQualifiedName` returns a sentinel-terminated slice so that backends that need null-termination do not need an additional copy. * Module.Union: implement a `getLayout` function which returns information about ABI size and alignment so that the LLVM backend can properly lower union types into llvm types. * Sema: `resolveType` now returns `error.GenericPoison` rather than a Type with tag `generic_poison`. Callsites that want to allow that need to bypass this higher-level function. * Sema: implement coercion of enums and enum literals to unions. * Sema: fix comptime mutation of pointers to unions * LLVM backend: fully implement proper lowering of union types and values according to the union layout, and update the handling of AIR instructions that deal with unions to support union layouts. * LLVM backend: handle `decl_ref_mut` - Maybe this should be unreachable since comptime vars should be changed to be non-mutable when they go out of scope, but it's harmless for the LLVM backend to support lowering the value. * Type: fix `requiresComptime` for optionals, pointers, and some other types. This function is still wrong for structs, unions, and enums.
Diffstat (limited to 'src/codegen/c.zig')
0 files changed, 0 insertions, 0 deletions