aboutsummaryrefslogtreecommitdiff
path: root/src/analyze.cpp
diff options
context:
space:
mode:
authorTimon Kruiper <timonkruiper@gmail.com>2020-02-11 23:14:08 +0100
committerAndrew Kelley <andrew@ziglang.org>2020-02-18 15:26:37 -0500
commit7560fc716d968f2448bed370affd6162d1e784c4 (patch)
tree502f5c0acd20c1da8ebf6e611863fa76d71fd4a3 /src/analyze.cpp
parente8a84927ab989d3c8fb6668dd242ada0a8f99585 (diff)
downloadzig-7560fc716d968f2448bed370affd6162d1e784c4.tar.gz
zig-7560fc716d968f2448bed370affd6162d1e784c4.zip
Makes the declaration slice resolve lazely when using `@typeInfo`
This way all the declarations in a container won't be resolved untill the user actually uses the decls slice in the builtin TypeInfo union.
Diffstat (limited to 'src/analyze.cpp')
-rw-r--r--src/analyze.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/analyze.cpp b/src/analyze.cpp
index 98366bc87d..95b2c77129 100644
--- a/src/analyze.cpp
+++ b/src/analyze.cpp
@@ -1150,6 +1150,7 @@ Error type_val_resolve_zero_bits(CodeGen *g, ZigValue *type_val, ZigType *parent
case LazyValueIdInvalid:
case LazyValueIdAlignOf:
case LazyValueIdSizeOf:
+ case LazyValueIdTypeInfoDecls:
zig_unreachable();
case LazyValueIdPtrType: {
LazyValuePtrType *lazy_ptr_type = reinterpret_cast<LazyValuePtrType *>(type_val->data.x_lazy);
@@ -1209,6 +1210,7 @@ Error type_val_resolve_is_opaque_type(CodeGen *g, ZigValue *type_val, bool *is_o
case LazyValueIdInvalid:
case LazyValueIdAlignOf:
case LazyValueIdSizeOf:
+ case LazyValueIdTypeInfoDecls:
zig_unreachable();
case LazyValueIdSliceType:
case LazyValueIdPtrType:
@@ -1230,6 +1232,7 @@ static ReqCompTime type_val_resolve_requires_comptime(CodeGen *g, ZigValue *type
case LazyValueIdInvalid:
case LazyValueIdAlignOf:
case LazyValueIdSizeOf:
+ case LazyValueIdTypeInfoDecls:
zig_unreachable();
case LazyValueIdSliceType: {
LazyValueSliceType *lazy_slice_type = reinterpret_cast<LazyValueSliceType *>(type_val->data.x_lazy);
@@ -1303,6 +1306,7 @@ start_over:
case LazyValueIdInvalid:
case LazyValueIdAlignOf:
case LazyValueIdSizeOf:
+ case LazyValueIdTypeInfoDecls:
zig_unreachable();
case LazyValueIdSliceType: {
LazyValueSliceType *lazy_slice_type = reinterpret_cast<LazyValueSliceType *>(type_val->data.x_lazy);
@@ -1370,6 +1374,7 @@ Error type_val_resolve_abi_align(CodeGen *g, AstNode *source_node, ZigValue *typ
case LazyValueIdInvalid:
case LazyValueIdAlignOf:
case LazyValueIdSizeOf:
+ case LazyValueIdTypeInfoDecls:
zig_unreachable();
case LazyValueIdSliceType:
case LazyValueIdPtrType:
@@ -1412,6 +1417,7 @@ static OnePossibleValue type_val_resolve_has_one_possible_value(CodeGen *g, ZigV
case LazyValueIdInvalid:
case LazyValueIdAlignOf:
case LazyValueIdSizeOf:
+ case LazyValueIdTypeInfoDecls:
zig_unreachable();
case LazyValueIdSliceType: // it has the len field
case LazyValueIdOptType: // it has the optional bit