This website requires JavaScript.
About
Status
₊˚⊹Discord
Explore
Register
Sign in
Reference in a new issue
Blame
Copy permalink
Reference in a new issue
Copy permalink
DKB
/
zig
Star
0
Fork
You've already forked zig
0
mirror of
https://codeberg.org/ziglang/zig
synced
2026-11-18 07:05:05 +00:00
Code
Issues
Releases
Packages
Activity
ad5533fdfb
zig
/
test
/
behavior
/
basic.zig
294 lines
5.9 KiB
Raw
Normal View
History
stage2: implement `@truncate`
2021-08-01 16:13:58 -07:00
move behavior tests that are passing for stage2
2021-10-13 21:43:19 -07:00
stage2: std.mem.eql works now * The `indexable_ptr_len` ZIR instruction now uses a `none_or_ref` ResultLoc. This prevents an unnecessary `ref` instruction from being emitted. * Sema: Fix `analyzeCall` using the incorrect ZIR object for the generic function callee. * LLVM backend: `genTypedValue` supports a `Slice` type encoded with the `decl_ref` `Value`.
2021-08-04 23:02:13 -07:00
stage2: implement `@truncate`
2021-08-01 16:13:58 -07:00
stage2: fix Decl addrspace being undefined
2021-10-22 15:53:59 -07:00
stage2: implement `@truncate`
2021-08-01 16:13:58 -07:00
Sema: implement comptime variables Sema now properly handles alloc_inferred and alloc_inferred_mut ZIR instructions inside a comptime execution context. In this case it creates Decl objects and points to them with the new `decl_ref_mut` Value Tag. `storePtr` is updated to mutate such Decl types and values. In this case it destroys the old arena and makes a new one, preventing memory growth during comptime code execution. Additionally: * Fix `storePtr` to emit a compile error for a pointer comptime-known to be undefined. * Fix `storePtr` to emit runtime instructions for all the cases that a pointer is comptime-known but does not support comptime dereferencing, such as `@intToPtr` on a hard-coded address, or an extern function. * Fix `ret_coerce` not coercing inside inline function call context.
2021-08-01 12:27:22 -07:00
stage2: implement `@truncate`
2021-08-01 16:13:58 -07:00
C backend: implement trunc for unsigned non-pow2 ints
2021-10-28 18:33:13 -07:00
C backend: implement signed trunc
2021-10-29 21:04:54 -04:00
C backend: implement trunc for unsigned non-pow2 ints
2021-10-28 18:33:13 -07:00
C backend: Improve lowering of Zig types to C types 1. Changed Zig pointers to functions to be typedef'd so then we can treat them the same as other types. 2. Distinguished between const slices (zig_L prefix) and mut slices (zig_M prefix). 3. Changed lowering of Zig "const pointers" (e.g. *const u8) to to C "pointers to const" (e.g. const char *) rather than C "const pointers" (e.g. char * const) 4. Ensured that all typedefs are "linked" even if the decl doesn't require any forward declarations 5. Added test that exercises function pointer type rendering 6. Changed .slice_ptr instruction to allocate pointer local rather than a uintptr_t local
2021-11-02 22:43:51 +00:00