remove id_decorate_win32_c_fkt
authorMatthias Braun <matze@braunis.de>
Sun, 19 Feb 2012 15:48:52 +0000 (16:48 +0100)
committerMatthias Braun <matze@braunis.de>
Sun, 19 Feb 2012 15:48:52 +0000 (16:48 +0100)
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
ir/ident/mangle.c

index 83ad465..0015fee 100644 (file)
@@ -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"
index f9b3ed1..fd2af1a 100644 (file)
@@ -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);