diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-11-24 02:14:21 -0500 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-11-24 02:14:21 -0500 |
| commit | 4c7b52503b064b8be2f2afd4152311aff1941d92 (patch) | |
| tree | 3f8ea590d0dc73dbfd94b0863aa1bb8c32e4d0b9 /src/analyze.cpp | |
| parent | 2dd20aa04a35f46a189d0aaa5d2d628e46a77999 (diff) | |
| download | zig-4c7b52503b064b8be2f2afd4152311aff1941d92.tar.gz zig-4c7b52503b064b8be2f2afd4152311aff1941d92.zip | |
all tests passing
Diffstat (limited to 'src/analyze.cpp')
| -rw-r--r-- | src/analyze.cpp | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/src/analyze.cpp b/src/analyze.cpp index d065f85c67..c41f5b652e 100644 --- a/src/analyze.cpp +++ b/src/analyze.cpp @@ -496,7 +496,7 @@ static void append_ptr_type_attrs(Buf *type_name, ZigType *ptr_type) { } else if (ptr_type->data.pointer.vector_index != VECTOR_INDEX_NONE) { buf_appendf(type_name, ":%" PRIu32, ptr_type->data.pointer.vector_index); } - buf_appendf(type_name, ")"); + buf_appendf(type_name, ") "); } buf_appendf(type_name, "%s%s%s", const_str, volatile_str, allow_zero_str); if (ptr_type->data.pointer.inferred_struct_field != nullptr) { @@ -861,22 +861,6 @@ ZigType *get_slice_type(CodeGen *g, ZigType *ptr_type) { entry->data.structure.fields[slice_len_index]->gen_index = 0; } - ZigType *child_type = ptr_type->data.pointer.child_type; - if (ptr_type->data.pointer.is_const || ptr_type->data.pointer.is_volatile || - ptr_type->data.pointer.explicit_alignment != 0 || ptr_type->data.pointer.allow_zero) - { - ZigType *peer_ptr_type = get_pointer_to_type_extra(g, child_type, false, false, - PtrLenUnknown, 0, 0, 0, false); - ZigType *peer_slice_type = get_slice_type(g, peer_ptr_type); - - entry->size_in_bits = peer_slice_type->size_in_bits; - entry->abi_size = peer_slice_type->abi_size; - entry->abi_align = peer_slice_type->abi_align; - - *parent_pointer = entry; - return entry; - } - if (type_has_bits(ptr_type)) { entry->size_in_bits = ptr_type->size_in_bits + g->builtin_types.entry_usize->size_in_bits; entry->abi_size = ptr_type->abi_size + g->builtin_types.entry_usize->abi_size; |
