From 5abcc4841bb185ed413379dacf8e00a2e379236b Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Sun, 19 Feb 2012 16:48:52 +0100 Subject: [PATCH] remove id_decorate_win32_c_fkt Mangling logic should not be in the ident module, frontends should provide it (there's also the compilerlib interface for it) --- include/libfirm/ident.h | 3 --- ir/ident/mangle.c | 26 -------------------------- 2 files changed, 29 deletions(-) diff --git a/include/libfirm/ident.h b/include/libfirm/ident.h index 83ad465d5..0015feefe 100644 --- a/include/libfirm/ident.h +++ b/include/libfirm/ident.h @@ -128,9 +128,6 @@ FIRM_API ident *id_mangle(ident *first, ident* scnd); FIRM_API ident *id_mangle3(const char *prefix, ident *middle, const char *suffix); -/** returns a mangled name for a Win32 function using its calling convention */ -FIRM_API ident *id_decorate_win32_c_fkt(const ir_entity *ent, ident *id); - /** @} */ #include "end.h" diff --git a/ir/ident/mangle.c b/ir/ident/mangle.c index f9b3ed102..fd2af1a40 100644 --- a/ir/ident/mangle.c +++ b/ir/ident/mangle.c @@ -126,32 +126,6 @@ ident *id_mangle_dot(ident *first, ident *scnd) return id_mangle_3(first, '.', scnd); } -/* returns a mangled name for a Win32 function using its calling convention */ -ident *id_decorate_win32_c_fkt(const ir_entity *ent, ident *id) -{ - ir_type *tp = get_entity_type(ent); - unsigned cc_mask = get_method_calling_convention(tp); - char buf[16]; - - if (IS_CDECL(cc_mask)) - return id_mangle3("_", id, ""); - else if (IS_STDCALL(cc_mask)) { - size_t i, size = 0; - - for (i = get_method_n_params(tp); i > 0;) { - size += get_type_size_bytes(get_method_param_type(tp, --i)); - } - - ir_snprintf(buf, sizeof(buf), "@%zu", size); - - if (cc_mask & cc_reg_param) - return id_mangle3("@", id, buf); - else - return id_mangle3("_", id, buf); - } - return id; -} - void firm_init_mangle(void) { obstack_init(&mangle_obst); -- 2.20.1