make @sizeOf lazy

This commit is contained in:
Andrew Kelley
2019-08-29 12:43:56 -04:00
parent 94bbb46ca6
commit d9f0446b1f
5 changed files with 134 additions and 51 deletions

View File

@@ -6845,6 +6845,7 @@ static void set_global_tls(CodeGen *g, ZigVar *var, LLVMValueRef global_value) {
}
static void do_code_gen(CodeGen *g) {
Error err;
assert(!g->errors.length);
generate_error_name_table(g);
@@ -6858,6 +6859,8 @@ static void do_code_gen(CodeGen *g) {
// Generate debug info for it but that's it.
ConstExprValue *const_val = var->const_value;
assert(const_val->special != ConstValSpecialRuntime);
if ((err = ir_resolve_lazy(g, var->decl_node, const_val)))
zig_unreachable();
if (const_val->type != var->var_type) {
zig_panic("TODO debug info for var with ptr casted value");
}
@@ -6875,6 +6878,8 @@ static void do_code_gen(CodeGen *g) {
// Generate debug info for it but that's it.
ConstExprValue *const_val = var->const_value;
assert(const_val->special != ConstValSpecialRuntime);
if ((err = ir_resolve_lazy(g, var->decl_node, const_val)))
zig_unreachable();
if (const_val->type != var->var_type) {
zig_panic("TODO debug info for var with ptr casted value");
}