authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-08-22 12:55:09-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-08-22 12:56:35-04:00
log0d6a6c76eabcd020c5f58dc4667766b0e2756dfa
treefbdea15f00c303d136f38bfc9025baa736251227
parent8460d5617cc12d614abf39f55ab85c783c4b35a8
signaturelock-open Commit is signed but in an unrecognized format.

add missing "referenced here" notes for lazy values


2 files changed, 9 insertions(+), 4 deletions(-)

src/analyze.cpp+3-3
......@@ -1918,7 +1918,7 @@ static Error resolve_enum_zero_bits(CodeGen *g, ZigType *enum_type) {
19181918 if (enum_type->data.enumeration.resolve_status != ResolveStatusInvalid) {
19191919 enum_type->data.enumeration.resolve_status = ResolveStatusInvalid;
19201920 g->trace_err = add_node_error(g, decl_node,
1921 buf_sprintf("circular dependency: whether enum '%s' has non-zero size",
1921 buf_sprintf("dependency loop: whether enum '%s' has non-zero size",
19221922 buf_ptr(&enum_type->name)));
19231923 }
19241924 return ErrorSemanticAnalyzeFail;
......@@ -2095,7 +2095,7 @@ static Error resolve_struct_zero_bits(CodeGen *g, ZigType *struct_type) {
20952095 if (struct_type->data.structure.resolve_status != ResolveStatusInvalid) {
20962096 struct_type->data.structure.resolve_status = ResolveStatusInvalid;
20972097 g->trace_err = add_node_error(g, decl_node,
2098 buf_sprintf("circular dependency: whether struct '%s' has non-zero size",
2098 buf_sprintf("dependency loop: whether struct '%s' has non-zero size",
20992099 buf_ptr(&struct_type->name)));
21002100 }
21012101 return ErrorSemanticAnalyzeFail;
......@@ -2282,7 +2282,7 @@ static Error resolve_union_zero_bits(CodeGen *g, ZigType *union_type) {
22822282 if (union_type->data.unionation.resolve_status != ResolveStatusInvalid) {
22832283 union_type->data.unionation.resolve_status = ResolveStatusInvalid;
22842284 g->trace_err = add_node_error(g, decl_node,
2285 buf_sprintf("circular dependency: whether union '%s' has non-zero size",
2285 buf_sprintf("dependency loop: whether union '%s' has non-zero size",
22862286 buf_ptr(&union_type->name)));
22872287 }
22882288 return ErrorSemanticAnalyzeFail;
src/ir.cpp+6-1
......@@ -10813,8 +10813,13 @@ ConstExprValue *ir_eval_const_value(CodeGen *codegen, Scope *scope, AstNode *nod
1081310813 ConstExprValue *result = ir_exec_const_result(codegen, analyzed_executable);
1081410814
1081510815 if (!allow_lazy) {
10816 if ((err = ir_resolve_lazy(codegen, node, result)))
10816 if ((err = ir_resolve_lazy(codegen, node, result))) {
10817 if (codegen->trace_err != nullptr) {
10818 codegen->trace_err = add_error_note(codegen, codegen->trace_err, source_node,
10819 buf_create_from_str("referenced here"));
10820 }
1081710821 return &codegen->invalid_instruction->value;
10822 }
1081810823 }
1081910824
1082010825 return result;