authorgravatar for alex_naskos@hotmail.comAlexandros Naskos <alex_naskos@hotmail.com> 2020-02-28 02:43:33+02:00
committergravatar for alex_naskos@hotmail.comAlexandros Naskos <alex_naskos@hotmail.com> 2020-02-28 02:43:33+02:00
logc020bc27ac8a8b18fe46c59f0dfb969b032fb303
treeac16110b8fe4965d7619d813aa06ce3521585bf5
parent95a1d2feb496d64094d81c9477465cafc73ce49b

More fixes, removed debug prints


1 files changed, 2 insertions(+), 14 deletions(-)

src/ir.cpp+2-14
......@@ -17037,15 +17037,6 @@ static IrInstGen *ir_analyze_tuple_cat(IrAnalyze *ira, IrInst* source_instr,
1703717037 }
1703817038 }
1703917039 IrInstGen *result = ir_get_deref(ira, source_instr, new_struct_ptr, nullptr);
17040 if (instr_is_comptime(result))
17041 return result;
17042
17043 if (is_comptime) {
17044 ir_add_error(ira, &first_non_const_instruction->base,
17045 buf_sprintf("unable to evaluate constant expression"));
17046 return ira->codegen->invalid_inst_gen;
17047 }
17048
1704917040 return result;
1705017041}
1705117042
......@@ -18906,10 +18897,7 @@ static IrInstGen *ir_analyze_store_ptr(IrAnalyze *ira, IrInst* source_instr,
1890618897 }
1890718898
1890818899 if (ptr->value->type->data.pointer.is_const && !allow_write_through_const) {
18909 // @TODO
18910 fprintf(stderr, "store ptr\n");
18911 ptr->src();
18912 ir_add_error(ira, source_instr, buf_sprintf("cannot assign to constant [FOO]"));
18900 ir_add_error(ira, source_instr, buf_sprintf("cannot assign to constant"));
1891318901 return ira->codegen->invalid_inst_gen;
1891418902 }
1891518903
......@@ -23050,7 +23038,7 @@ static IrInstGen *ir_analyze_instruction_container_init_list(IrAnalyze *ira,
2305023038 const_ptrs.deinit();
2305123039
2305223040 IrInstGen *result = ir_get_deref(ira, &instruction->base.base, result_loc, nullptr);
23053 // If the result is a tuple, we are allowed to use ConstValSpecialRuntime fields.
23041 // If the result is a tuple, we are allowed to return a struct that uses ConstValSpecialRuntime fields at comptime.
2305423042 if (instr_is_comptime(result) || is_tuple(container_type))
2305523043 return result;
2305623044