Rewriting types into ints at typechecking phase
This commit is contained in:
12
ccodegen.cpp
12
ccodegen.cpp
@@ -825,19 +825,17 @@ typedef struct String{
|
||||
}
|
||||
}
|
||||
|
||||
Scratch scratch;
|
||||
for(S64 i = 0; i < pctx->type_map.cap; i++){
|
||||
Map_Key_Value *it = pctx->type_map.data + i;
|
||||
if(!it->occupied) continue;
|
||||
Ast_Type *type = (Ast_Type *)it->value;
|
||||
For(pctx->all_types){
|
||||
Scratch scratch;
|
||||
Ast_Type *type = it;
|
||||
|
||||
if(type->kind == TYPE_SLICE){
|
||||
genln("typedef struct Slice%llu{", type->type_id);
|
||||
global_indent++;
|
||||
genln("S64 len;");
|
||||
genln("");
|
||||
gen_simple_decl(type->base);
|
||||
gen(" data;");
|
||||
gen_simple_decl(type_pointer(type->base), pctx->intern("data"_s));
|
||||
gen(";");
|
||||
global_indent--;
|
||||
genln("} Slice%llu;", type->type_id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user