aboutsummaryrefslogtreecommitdiff
path: root/src/analyze.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2019-06-25 11:31:38 -0400
committerAndrew Kelley <andrew@ziglang.org>2019-06-25 11:31:38 -0400
commitc61e0a078cea2a6845ed7b03189409829d2cdf24 (patch)
tree8a64733d2ecf5121dbdf0db998f4d69a4e5629e6 /src/analyze.cpp
parent3021e5ca67acca6cf7420bc5e2400aa6965596f9 (diff)
downloadzig-c61e0a078cea2a6845ed7b03189409829d2cdf24.tar.gz
zig-c61e0a078cea2a6845ed7b03189409829d2cdf24.zip
fix union init with void payload
all std lib tests passing now
Diffstat (limited to 'src/analyze.cpp')
-rw-r--r--src/analyze.cpp14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/analyze.cpp b/src/analyze.cpp
index 85e390f2e0..d3a9376c5d 100644
--- a/src/analyze.cpp
+++ b/src/analyze.cpp
@@ -5001,12 +5001,9 @@ void init_const_undefined(CodeGen *g, ConstExprValue *const_val) {
field_val->type = wanted_type->data.structure.fields[i].type_entry;
assert(field_val->type);
init_const_undefined(g, field_val);
- ConstParent *parent = get_const_val_parent(g, field_val);
- if (parent != nullptr) {
- parent->id = ConstParentIdStruct;
- parent->data.p_struct.struct_val = const_val;
- parent->data.p_struct.field_index = i;
- }
+ field_val->parent.id = ConstParentIdStruct;
+ field_val->parent.data.p_struct.struct_val = const_val;
+ field_val->parent.data.p_struct.field_index = i;
}
} else {
const_val->special = ConstValSpecialUndef;
@@ -5842,11 +5839,6 @@ void expand_undef_array(CodeGen *g, ConstExprValue *const_val) {
zig_unreachable();
}
-// Deprecated. Reference the parent field directly.
-ConstParent *get_const_val_parent(CodeGen *g, ConstExprValue *value) {
- return &value->parent;
-}
-
static const ZigTypeId all_type_ids[] = {
ZigTypeIdMetaType,
ZigTypeIdVoid,