From 5609bc8a7994ae50790454ed6966d83148edd83f Mon Sep 17 00:00:00 2001 From: Zuhaitz Méndez Fernández de Aránguiz Date: Sat, 17 Jan 2026 14:02:17 +0000 Subject: Solved duplicate and modified test script. --- src/codegen/codegen_decl.c | 51 ---------------------------------------------- 1 file changed, 51 deletions(-) (limited to 'src/codegen') diff --git a/src/codegen/codegen_decl.c b/src/codegen/codegen_decl.c index 0ee4cd6..11970a5 100644 --- a/src/codegen/codegen_decl.c +++ b/src/codegen/codegen_decl.c @@ -881,55 +881,4 @@ void print_type_defs(ParserContext *ctx, FILE *out, ASTNode *nodes) } local = local->next; } - - // THEN: Emit typedefs for instantiated generics - Instantiation *i = ctx->instantiations; - while (i) - { - if (i->struct_node->type == NODE_RAW_STMT) - { - fprintf(out, "%s\n", i->struct_node->raw_stmt.content); - } - else - { - fprintf(out, "typedef struct %s %s;\n", i->struct_node->strct.name, - i->struct_node->strct.name); - codegen_node(ctx, i->struct_node, out); - } - i = i->next; - } - - StructRef *sr = ctx->parsed_structs_list; - while (sr) - { - if (sr->node && sr->node->type == NODE_STRUCT && !sr->node->strct.is_template) - { - const char *keyword = sr->node->strct.is_union ? "union" : "struct"; - fprintf(out, "typedef %s %s %s;\n", keyword, sr->node->strct.name, - sr->node->strct.name); - } - - if (sr->node && sr->node->type == NODE_ENUM && !sr->node->enm.is_template) - { - fprintf(out, "typedef struct %s %s;\n", sr->node->enm.name, sr->node->enm.name); - } - sr = sr->next; - } - - // Also check instantiated_structs list. - ASTNode *inst_s = ctx->instantiated_structs; - while (inst_s) - { - if (inst_s->type == NODE_STRUCT && !inst_s->strct.is_template) - { - const char *keyword = inst_s->strct.is_union ? "union" : "struct"; - fprintf(out, "typedef %s %s %s;\n", keyword, inst_s->strct.name, inst_s->strct.name); - } - - if (inst_s->type == NODE_ENUM && !inst_s->enm.is_template) - { - fprintf(out, "typedef struct %s %s;\n", inst_s->enm.name, inst_s->enm.name); - } - inst_s = inst_s->next; - } } -- cgit v1.2.3