X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ast2firm.c;h=0d8f1eb5ae6b082090ef4adcad8dce864f88d960;hb=c91a949920b54a81853baa202dc1373194825def;hp=44e8a404d5783eb652432990f9fa7f826b2a6b11;hpb=e3034cdeaa5344032a608326016860154d6aeeee;p=cparser diff --git a/ast2firm.c b/ast2firm.c index 44e8a40..0d8f1eb 100644 --- a/ast2firm.c +++ b/ast2firm.c @@ -63,7 +63,6 @@ static label_t **all_labels; static entity_t **inner_functions; static ir_node *ijmp_list; static bool constant_folding; -static symbol_t *sym_C; extern bool have_const_functions; @@ -398,8 +397,6 @@ static ir_type *create_method_type(const function_type_t *function_type) set_method_variadicity(irtype, variadicity_variadic); } -#if 0 - /* TODO: revive this with linkage stuff */ unsigned cc = get_method_calling_convention(irtype); switch (function_type->calling_convention) { case CC_DEFAULT: /* unspecified calling convention, equal to one of the other, typically cdecl */ @@ -427,7 +424,6 @@ is_cdecl: /* Hmm, leave default, not accepted by the parser yet. */ break; } -#endif return irtype; } @@ -969,8 +965,7 @@ static const struct { static ident *rts_idents[sizeof(rts_data) / sizeof(rts_data[0])]; -typedef ident* (*create_ld_ident_func)(entity_t *entity); -create_ld_ident_func create_ld_ident = create_name_linux_elf; +static ident* (*create_ld_ident)(entity_t*) = create_name_linux_elf; /** * Handle GNU attributes for entities @@ -1030,14 +1025,9 @@ static ir_entity *get_function_entity(entity_t *entity) /* force main to C linkage */ type_t *type = entity->declaration.type; assert(is_type_function(type)); - if (type->function.linkage != NULL && type->function.linkage != sym_C) { - errorf(&entity->base.source_position, - "main must have \"C\" linkage"); - } - - if (type->function.linkage == NULL || type->function.linkage != sym_C) { + if (type->function.linkage != LINKAGE_C) { type_t *new_type = duplicate_type(type); - new_type->function.linkage = sym_C; + new_type->function.linkage = LINKAGE_C; type = typehash_insert(new_type); if (type != new_type) { @@ -5452,8 +5442,6 @@ void init_ast2firm(void) rts_idents[i] = new_id_from_str(rts_data[i].name); } - sym_C = symbol_table_insert("C"); - entitymap_init(&entitymap); }