0
Fork 0
mirror of https://codeberg.org/ziglang/zig synced 2026-11-18 07:05:05 +00:00
zig/test
Andrew Kelley a0e195120d stage2: implement slicing
* New AIR instruction: slice, which constructs a slice out of a pointer
   and a length.
 * AstGen: use `coerced_ty` for start and end expressions, use `none`
   for the sentinel, and don't try to load the result of the slice
   operation because it returns a by-value result.
 * Sema: pointer arithmetic is extracted into analyzePointerArithmetic
   and it is used by the implementation of slice.
   - Also I implemented comptime pointer addition.
 * Sema: extract logic into analyzeSlicePtr, analyzeSliceLen and use them
   inside the slice semantic analysis.
   - The approach in stage2 is much cleaner than stage1 because it uses
     more granular analysis calls for obtaining the slice pointer, doing
     arithmetic on it, and checking if the length is comptime-known.
 * Sema: use the slice Value Tag for slices when doing coercion from
   pointer-to-array.
 * LLVM backend: detect when emitting a GEP instruction into a
   pointer-to-array and add the extra index that is required.
 * Type: ptrAlignment for c_void returns 0.
 * Implement Value.hash and Value.eql for slices.
 * Remove accidentally duplicated behavior test.
History 2021-10-20 21:45:11 -07:00
..
behavior stage2: implement slicing 2021-10-20 21:45:11 -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: implement switching on unions 2021-10-19 20:22:47 -07: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 AstGen: make the index variable of inline for a alloc_comptime 2021-10-20 15:34:10 -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 Sat shl neg rhs (#9949) 2021-10-15 13:56:27 -04:00
gen_h.zig run zig fmt on src/ and test/ 2020-10-31 12:21:49 +02:00
run_translated_c.zig translate_c: prevent a while under an if from stealing the else 2021-10-19 13:48:09 -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 translate-c: create inline fn for always_inline 2021-10-20 17:58:30 -04:00