diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2022-03-14 21:11:49 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2022-03-14 21:43:03 -0700 |
| commit | 2f92d1a0264b6827cb67a55726c4c9a082337508 (patch) | |
| tree | d6691a25a828b44cb4c17365fb8549d339046810 /src/codegen/llvm.zig | |
| parent | 50a1ca24ca2a4311097132d660b8244f252da82f (diff) | |
| download | zig-2f92d1a0264b6827cb67a55726c4c9a082337508.tar.gz zig-2f92d1a0264b6827cb67a55726c4c9a082337508.zip | |
stage2: fixups for topolarity-comptime-memory-reinterp branch
* don't store `has_well_defined_layout` in memory.
* remove struct `hasWellDefinedLayout` logic. it's just
`layout != .Auto`. This means we only need one implementation, in
Type.
* fix some of the cases being wrong in `hasWellDefinedLayout`, such as
optional pointers.
* move `tag_ty_inferred` field into a position that makes it more
obvious how the struct layout will be done. Also we don't have a
compiler that intelligently moves fields around so this layout is
better.
* Sema: don't `resolveTypeLayout` in `zirCoerceResultPtr` unless
necessary.
* Rename `ComptimePtrLoadKit` `target` field to `pointee` to avoid
confusion with `target`.
Diffstat (limited to 'src/codegen/llvm.zig')
| -rw-r--r-- | src/codegen/llvm.zig | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig index 08cfe4a258..94dacf61e8 100644 --- a/src/codegen/llvm.zig +++ b/src/codegen/llvm.zig @@ -2829,7 +2829,10 @@ pub const DeclGen = struct { // (void) payload is the same. break :blk parent_llvm_ptr; } - const llvm_pl_index = if (layout.tag_size == 0) 0 else @boolToInt(layout.tag_align >= layout.payload_align); + const llvm_pl_index = if (layout.tag_size == 0) + 0 + else + @boolToInt(layout.tag_align >= layout.payload_align); const indices: [2]*const llvm.Value = .{ llvm_u32.constInt(0, .False), llvm_u32.constInt(llvm_pl_index, .False), |
