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) {...@@ -1918,7 +1918,7 @@ static Error resolve_enum_zero_bits(CodeGen *g, ZigType *enum_type) {
1918 if (enum_type->data.enumeration.resolve_status != ResolveStatusInvalid) {1918 if (enum_type->data.enumeration.resolve_status != ResolveStatusInvalid) {
1919 enum_type->data.enumeration.resolve_status = ResolveStatusInvalid;1919 enum_type->data.enumeration.resolve_status = ResolveStatusInvalid;
1920 g->trace_err = add_node_error(g, decl_node,1920 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",
1922 buf_ptr(&enum_type->name)));1922 buf_ptr(&enum_type->name)));
1923 }1923 }
1924 return ErrorSemanticAnalyzeFail;1924 return ErrorSemanticAnalyzeFail;
...@@ -2095,7 +2095,7 @@ static Error resolve_struct_zero_bits(CodeGen *g, ZigType *struct_type) {...@@ -2095,7 +2095,7 @@ static Error resolve_struct_zero_bits(CodeGen *g, ZigType *struct_type) {
2095 if (struct_type->data.structure.resolve_status != ResolveStatusInvalid) {2095 if (struct_type->data.structure.resolve_status != ResolveStatusInvalid) {
2096 struct_type->data.structure.resolve_status = ResolveStatusInvalid;2096 struct_type->data.structure.resolve_status = ResolveStatusInvalid;
2097 g->trace_err = add_node_error(g, decl_node,2097 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",
2099 buf_ptr(&struct_type->name)));2099 buf_ptr(&struct_type->name)));
2100 }2100 }
2101 return ErrorSemanticAnalyzeFail;2101 return ErrorSemanticAnalyzeFail;
...@@ -2282,7 +2282,7 @@ static Error resolve_union_zero_bits(CodeGen *g, ZigType *union_type) {...@@ -2282,7 +2282,7 @@ static Error resolve_union_zero_bits(CodeGen *g, ZigType *union_type) {
2282 if (union_type->data.unionation.resolve_status != ResolveStatusInvalid) {2282 if (union_type->data.unionation.resolve_status != ResolveStatusInvalid) {
2283 union_type->data.unionation.resolve_status = ResolveStatusInvalid;2283 union_type->data.unionation.resolve_status = ResolveStatusInvalid;
2284 g->trace_err = add_node_error(g, decl_node,2284 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",
2286 buf_ptr(&union_type->name)));2286 buf_ptr(&union_type->name)));
2287 }2287 }
2288 return ErrorSemanticAnalyzeFail;2288 return ErrorSemanticAnalyzeFail;
src/ir.cpp+6-1
...@@ -10813,8 +10813,13 @@ ConstExprValue *ir_eval_const_value(CodeGen *codegen, Scope *scope, AstNode *nod...@@ -10813,8 +10813,13 @@ ConstExprValue *ir_eval_const_value(CodeGen *codegen, Scope *scope, AstNode *nod
10813 ConstExprValue *result = ir_exec_const_result(codegen, analyzed_executable);10813 ConstExprValue *result = ir_exec_const_result(codegen, analyzed_executable);
1081410814
10815 if (!allow_lazy) {10815 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 }
10817 return &codegen->invalid_instruction->value;10821 return &codegen->invalid_instruction->value;
10822 }
10818 }10823 }
1081910824
10820 return result;10825 return result;