From 7d4370a6cf1df8bacbead0511e4a9a1b6941003e Mon Sep 17 00:00:00 2001 From: DeaDDooMER Date: Mon, 24 Jul 2017 22:41:17 +0300 Subject: [PATCH] =?utf8?q?=D0=9F=D0=BE=D0=BF=D1=80=D0=B0=D0=B2=D0=BB=D0=B5?= =?utf8?q?=D0=BD=D1=8B=20=D0=BF=D0=BE=D0=B2=D1=82=D0=BE=D1=80=D0=BD=D1=8B?= =?utf8?q?=D0=B5=20=D0=BE=D0=BF=D0=B5=D1=80=D0=B5=D0=B6=D0=B0=D1=8E=D1=89?= =?utf8?q?=D0=B8=D0=B5=20=D0=BE=D0=B1=D1=8A=D1=8F=D0=B2=D0=BB=D0=B5=D0=BD?= =?utf8?q?=D0=B8=D1=8F=20=D0=BF=D1=80=D0=BE=D1=86=D0=B5=D0=B4=D1=83=D1=80,?= =?utf8?q?=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=BE=20?= =?utf8?q?=D0=B8=D0=BC=D0=B5=D0=BD=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20?= =?utf8?q?=D0=B3=D0=B5=D0=BD=D0=B5=D1=80=D0=B8=D1=80=D1=83=D0=B5=D0=BC?= =?utf8?q?=D1=8B=D1=85=20=D1=81=D1=82=D1=80=D1=83=D0=BA=D1=82=D1=83=D1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- generator.c | 6 +++++- notes | 5 ++++- oberon.c | 4 ++-- oberon.h | 1 + 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/generator.c b/generator.c index 419a2b2..b17a8cd 100644 --- a/generator.c +++ b/generator.c @@ -103,7 +103,11 @@ oberon_generator_init_type(oberon_context_t * ctx, oberon_type_t * type) } else if(type -> class == OBERON_TYPE_RECORD) { - gcc_struct = gcc_jit_context_new_opaque_struct(gcc_context, NULL, ""); + char name[32]; + snprintf(name, 32, "RECORD%u", gen_context -> record_count); + gen_context -> record_count += 1; + + gcc_struct = gcc_jit_context_new_opaque_struct(gcc_context, NULL, name); gcc_type = gcc_jit_struct_as_type(gcc_struct); } else if(type -> class == OBERON_TYPE_POINTER) diff --git a/notes b/notes index 0bf5789..ec0a69c 100644 --- a/notes +++ b/notes @@ -2,7 +2,7 @@ - нету процедуры NEW - нету открытых массивов -- нету секции import +- нету секции import + identdef + qualident - нету операторов if, while и т.д. @@ -16,3 +16,6 @@ - libgccjit не умеет в локальные функции (опять пилить костыли как в jvm) - не понятен результат присваивания статических/разыменованных структур (* reca := recb; *) - не понятен результат присваивания статических/разыменованных массивов (* arr1 := arr2; *) + +- нету счёта строк +- любая ошибка фатальна diff --git a/oberon.c b/oberon.c index 4eb240b..c3a6f86 100644 --- a/oberon.c +++ b/oberon.c @@ -1540,9 +1540,9 @@ oberon_proc_decl(oberon_context_t * ctx) { oberon_error(ctx, "mult procedure definition"); } - - oberon_compare_signatures(ctx, proc -> type, signature); } + + oberon_compare_signatures(ctx, proc -> type, signature); } else { diff --git a/oberon.h b/oberon.h index f84d332..30c4cbe 100644 --- a/oberon.h +++ b/oberon.h @@ -38,6 +38,7 @@ struct gen_context_s gcc_jit_context * gcc_context; gcc_jit_result * gcc_result; gen_block_t * block; + unsigned record_count; }; typedef struct oberon_type_s oberon_type_t; -- 2.29.2