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 */
/* Hmm, leave default, not accepted by the parser yet. */
break;
}
-#endif
return irtype;
}
static ident *id_underscore;
static ident *id_imp;
static symbol_t *sym_C;
-static symbol_t *sym_stdcall;
static struct obstack obst;
static void mangle_type(type_t *type);
ident *id = new_id_from_str(entity->base.symbol->string);
if (entity->kind == ENTITY_FUNCTION) {
- if (entity->declaration.type->function.linkage == sym_stdcall) {
+ if (entity->declaration.type->function.calling_convention == CC_STDCALL) {
char buf[16];
ir_type *irtype = get_ir_type(entity->declaration.type);
size_t size = 0;
id_underscore = new_id_from_chars("_", 1);
id_imp = new_id_from_chars("__imp_", 6);
sym_C = symbol_table_insert("C");
- sym_stdcall = symbol_table_insert("stdcall");
obstack_init(&obst);
}
intern_print_type_pre(type->return_type, false);
-#if 0
- /* TODO: revive with linkage */
- switch (type->linkage) {
- case CC_CDECL:
- fputs("__cdecl ", out);
- break;
- case CC_STDCALL:
- fputs("__stdcall ", out);
- break;
- case CC_FASTCALL:
- fputs("__fastcall ", out);
- break;
- case CC_THISCALL:
- fputs("__thiscall ", out);
- break;
- case CC_DEFAULT:
- break;
+ switch (type->calling_convention) {
+ case CC_CDECL: fputs("__cdecl ", out); break;
+ case CC_STDCALL: fputs("__stdcall ", out); break;
+ case CC_FASTCALL: fputs("__fastcall ", out); break;
+ case CC_THISCALL: fputs("__thiscall ", out); break;
+ case CC_DEFAULT: break;
}
-#endif
/* don't emit parenthesis if we're the toplevel type... */
if (!top)
if (func1->linkage != func2->linkage)
return false;
+ if (func1->calling_convention != func2->calling_convention)
+ return false;
+
/* can parameters be compared? */
if (func1->unspecified_parameters || func2->unspecified_parameters)
return true;
parameter = parameter->next;
}
result ^= hash_ptr(type->linkage);
+ result += type->calling_convention;
return result;
}
return false;
if (type1->linkage != type2->linkage)
return false;
+ if (type1->calling_convention != type2->calling_convention)
+ return false;
function_parameter_t *param1 = type1->parameters;
function_parameter_t *param2 = type2->parameters;
type_t *return_type; /**< The return type. */
function_parameter_t *parameters; /**< A list of the parameter types. */
symbol_t *linkage;
+ cc_kind_t calling_convention; /**< The specified calling convention. */
bool variadic : 1;
bool unspecified_parameters : 1;
bool kr_style_parameters : 1;