0
Fork 0
mirror of https://codeberg.org/ziglang/zig synced 2026-11-18 07:05:05 +00:00
zig/test
Andrew Kelley 6d6cf59847 stage2: support nested structs and arrays and sret
* Add AIR instructions: ret_ptr, ret_load
   - This allows Sema to be blissfully unaware of the backend's decision
     to implement by-val/by-ref semantics for struct/union/array types.
     Backends can lower these simply as alloc, load, ret instructions,
     or they can take advantage of them to use a result pointer.
 * Add AIR instruction: array_elem_val
   - Allows for better codegen for `Sema.elemVal`.
 * Implement calculation of ABI alignment and ABI size for unions.
 * Before appending the following AIR instructions to a block,
   resolveTypeLayout is called on the type:
   - call - return type
   - ret - return type
   - store_ptr - elem type
 * Sema: fix memory leak in `zirArrayInit` and other cleanups to this
   function.
 * x86_64: implement the full x86_64 C ABI according to the spec
 * Type: implement `intInfo` for error sets.
 * Type: implement `intTagType` for tagged unions.

The Zig type tag `Fn` is now used exclusively for function bodies.
Function pointers are modeled as `*const T` where `T` is a `Fn` type.
 * The `call` AIR instruction now allows a function pointer operand as
   well as a function operand.
 * Sema now has a coercion from function body to function pointer.
 * Function type syntax, e.g. `fn()void`, now returns zig tag type of
   Pointer with child Fn, rather than Fn directly.
   - I think this should probably be reverted. Will discuss the lang
     specs before doing this. Idea being that function pointers would
     need to be specified as `*const fn()void` rather than `fn() void`.

LLVM backend:
 * Enable calling the panic handler (previously this just
   emitted `@breakpoint()` since the backend could not handle the panic
   function).
 * Implement sret
 * Introduce `isByRef` and implement it for structs and arrays. Types
   that are `isByRef` are now passed as pointers to functions, and e.g.
   `elem_val` will return a pointer instead of doing a load.
 * Move the function type creating code from `resolveLlvmFunction` to
   `llvmType` where it belongs; now there is only 1 instance of this
   logic instead of two.
 * Add the `nonnull` attribute to non-optional pointer parameters.
 * Fix `resolveGlobalDecl` not using fully-qualified names and not using
   the `decl_map`.
 * Implement `genTypedValue` for pointer-like optionals.
 * Fix memory leak when lowering `block` instruction and OOM occurs.
 * Implement volatile checks where relevant.
History 2021-10-11 11:39:12 -07:00
..
behavior stage2: support nested structs and arrays and sret 2021-10-11 11:39:12 -07:00
src migrate from std.Target.current to @import("builtin").target 2021-10-04 23:48:55 -07:00
stage1/c_abi stage1: Expand SysV C ABI support for small structs 2021-07-28 18:13:17 -04:00
stage2 stage2: add astgen errors for untyped union fields and union field values without inferred tag type 2021-10-09 20:39:50 -04:00
standalone migrate from std.Target.current to @import("builtin").target 2021-10-04 23:48:55 -07:00
assemble_and_link.zig migrate from std.Target.current to @import("builtin").target 2021-10-04 23:48:55 -07:00
behavior.zig stage2: support nested structs and arrays and sret 2021-10-11 11:39:12 -07:00
cases.zig Fix failing tests and windows link dependencies 2021-09-22 14:39:02 -05:00
cli.zig migrate from std.Target.current to @import("builtin").target 2021-10-04 23:48:55 -07:00
compare_output.zig migrate from std.Target.current to @import("builtin").target 2021-10-04 23:48:55 -07:00
compile_errors.zig migrate from std.Target.current to @import("builtin").target 2021-10-04 23:48:55 -07:00
gen_h.zig run zig fmt on src/ and test/ 2020-10-31 12:21:49 +02:00
run_translated_c.zig Spelling corrections (#9833) 2021-09-24 13:39:20 -04:00
runtime_safety.zig fix unused variable errors in runtime safety test cases 2021-06-23 10:44:46 -07:00
stack_traces.zig overhaul elf csu (c-runtime startup) logic 2021-05-23 15:38:57 -04:00
standalone.zig migrate from std.Target.current to @import("builtin").target 2021-10-04 23:48:55 -07:00
tests.zig migrate from std.Target.current to @import("builtin").target 2021-10-04 23:48:55 -07:00
translate_c.zig migrate from std.Target.current to @import("builtin").target 2021-10-04 23:48:55 -07:00