aboutsummaryrefslogtreecommitdiff
path: root/test/behavior/enum_llvm.zig
AgeCommit message (Collapse)Author
2022-01-26Sema: implement struct init is_ref=trueAndrew Kelley
Takes advantage of the pattern already established with array_init_anon. Also upgrades array_init (non-anon) to the pattern. Implements comptime struct value equality and pointer value hashing.
2021-12-27Sema: fix anytype parameters whose types require comptimeAndrew Kelley
2021-12-27Sema: implement `@tagName` for enum literalsAndrew Kelley
2021-12-27stage2: fix 0-bit function parametersAndrew Kelley
Before this commit, Zig would incorrectly emit `arg` AIR instructions for parameters whose types were 0-bit.
2021-12-27stage2: LLVM backend: fix const packed structsAndrew Kelley
When doing LLVM const bit shifting we must make sure the integer bit sizes are wide enough or else LLVM gives us a poison result.
2021-12-27stage2: LLVM backend: implement `@tagName` for enumsAndrew Kelley
Introduced a new AIR instruction: `tag_name`. Reasons to do this instead of lowering it in Sema to a switch, function call, array lookup, or if-else tower: * Sema is a bottleneck; do less work in Sema whenever possible. * If any optimization passes run, and the operand to becomes comptime-known, then it could change to have a comptime result value instead of lowering to a function or array or something which would then have to be garbage-collected. * Backends may want to choose to use a function and a switch branch, or they may want to use a different strategy. Codegen for `@tagName` is implemented for the LLVM backend but not any others yet. Introduced some new `Type` tags: * `const_slice_u8_sentinel_0` * `manyptr_const_u8_sentinel_0` The motivation for this was to make typeof() on the tag_name AIR instruction non-allocating. A bunch more enum tests are passing now.