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,...@@ -17037,15 +17037,6 @@ static IrInstGen *ir_analyze_tuple_cat(IrAnalyze *ira, IrInst* source_instr,
17037 }17037 }
17038 }17038 }
17039 IrInstGen *result = ir_get_deref(ira, source_instr, new_struct_ptr, nullptr);17039 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
17049 return result;17040 return result;
17050}17041}
1705117042
...@@ -18906,10 +18897,7 @@ static IrInstGen *ir_analyze_store_ptr(IrAnalyze *ira, IrInst* source_instr,...@@ -18906,10 +18897,7 @@ static IrInstGen *ir_analyze_store_ptr(IrAnalyze *ira, IrInst* source_instr,
18906 }18897 }
1890718898
18908 if (ptr->value->type->data.pointer.is_const && !allow_write_through_const) {18899 if (ptr->value->type->data.pointer.is_const && !allow_write_through_const) {
18909 // @TODO18900 ir_add_error(ira, source_instr, buf_sprintf("cannot assign to constant"));
18910 fprintf(stderr, "store ptr\n");
18911 ptr->src();
18912 ir_add_error(ira, source_instr, buf_sprintf("cannot assign to constant [FOO]"));
18913 return ira->codegen->invalid_inst_gen;18901 return ira->codegen->invalid_inst_gen;
18914 }18902 }
1891518903
...@@ -23050,7 +23038,7 @@ static IrInstGen *ir_analyze_instruction_container_init_list(IrAnalyze *ira,...@@ -23050,7 +23038,7 @@ static IrInstGen *ir_analyze_instruction_container_init_list(IrAnalyze *ira,
23050 const_ptrs.deinit();23038 const_ptrs.deinit();
2305123039
23052 IrInstGen *result = ir_get_deref(ira, &instruction->base.base, result_loc, nullptr);23040 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.
23054 if (instr_is_comptime(result) || is_tuple(container_type))23042 if (instr_is_comptime(result) || is_tuple(container_type))
23055 return result;23043 return result;
2305623044