summaryrefslogtreecommitdiff
path: root/src/codegen/codegen_decl.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/codegen/codegen_decl.c')
-rw-r--r--src/codegen/codegen_decl.c51
1 files changed, 0 insertions, 51 deletions
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;
- }
}