aboutsummaryrefslogtreecommitdiff
path: root/src/analyze.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2016-12-28 01:31:46 -0500
committerAndrew Kelley <superjoe30@gmail.com>2016-12-28 01:31:46 -0500
commitf6ac2fa70e7e2eb5d3299dc90c581d139b0bea1b (patch)
treea5f5e4c0135f24aafd07c9c7799083c4d8f75140 /src/analyze.cpp
parent25a5fc32fe68f911f7ac34e513e98cacb0ca17b1 (diff)
downloadzig-f6ac2fa70e7e2eb5d3299dc90c581d139b0bea1b.tar.gz
zig-f6ac2fa70e7e2eb5d3299dc90c581d139b0bea1b.zip
IR: pass pointerToVoidReturnType test
Diffstat (limited to 'src/analyze.cpp')
-rw-r--r--src/analyze.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/analyze.cpp b/src/analyze.cpp
index 450bc2b3cd..d19bc56143 100644
--- a/src/analyze.cpp
+++ b/src/analyze.cpp
@@ -330,12 +330,7 @@ TypeTableEntry *get_pointer_to_type(CodeGen *g, TypeTableEntry *child_type, bool
TypeTableEntry *canon_child_type = get_underlying_type(child_type);
assert(canon_child_type->id != TypeTableEntryIdInvalid);
-
- if (type_is_complete(canon_child_type)) {
- entry->zero_bits = !type_has_bits(canon_child_type);
- } else {
- entry->zero_bits = false;
- }
+ entry->zero_bits = !type_has_bits(canon_child_type);
if (!entry->zero_bits) {
entry->type_ref = LLVMPointerType(child_type->type_ref, 0);
@@ -345,6 +340,8 @@ TypeTableEntry *get_pointer_to_type(CodeGen *g, TypeTableEntry *child_type, bool
assert(child_type->di_type);
entry->di_type = ZigLLVMCreateDebugPointerType(g->dbuilder, child_type->di_type,
debug_size_in_bits, debug_align_in_bits, buf_ptr(&entry->name));
+ } else {
+ entry->di_type = g->builtin_types.entry_void->di_type;
}
entry->data.pointer.child_type = child_type;
@@ -2895,6 +2892,7 @@ bool fn_eval_eql(Scope *a, Scope *b) {
bool type_has_bits(TypeTableEntry *type_entry) {
assert(type_entry);
assert(type_entry->id != TypeTableEntryIdInvalid);
+ assert(type_has_zero_bits_known(type_entry));
return !type_entry->zero_bits;
}