X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fia32%2Fia32_dbg_stat.h;h=0508bba7ccc493b2a33abf6ba5304bb1d4a0bbf5;hb=b77d68268801b173deaf58d6a85c0c25e0a9e1da;hp=889a2ee26c33faad82632cc562fa4291555a004a;hpb=863d31d7a5c8210432fef88b30fc3e8353131538;p=libfirm diff --git a/ir/be/ia32/ia32_dbg_stat.h b/ir/be/ia32/ia32_dbg_stat.h index 889a2ee26..0508bba7c 100644 --- a/ir/be/ia32/ia32_dbg_stat.h +++ b/ir/be/ia32/ia32_dbg_stat.h @@ -1,16 +1,34 @@ +/* + * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. + * + * This file is part of libFirm. + * + * This file may be distributed and/or modified under the terms of the + * GNU General Public License version 2 as published by the Free Software + * Foundation and appearing in the file LICENSE.GPL included in the + * packaging of this file. + * + * Licensees holding valid libFirm Professional Edition licenses may use + * this file in accordance with the libFirm Commercial License. + * Agreement provided with the Software. + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE. + */ + /** - * This file contains macros to update ia32 firm statistics - * @author Christian Wuerdig - * $Id$ + * @file + * @brief This file contains macros to update ia32 firm statistics. + * @author Christian Wuerdig */ -#ifndef _IA32_DBG_STAT_H_ -#define _IA32_DBG_STAT_H_ +#ifndef FIRM_BE_IA32_IA32_DBG_STAT_H +#define FIRM_BE_IA32_IA32_DBG_STAT_H #include "irhooks.h" #include "dbginfo_t.h" #include "firmstat.h" - -#define SIZ(x) sizeof(x)/sizeof((x)[0]) +#include "util.h" /** * Merge the debug info due to a LEA creation. @@ -43,13 +61,13 @@ * @param oldn2 an additional old node * @param n the new lea */ -#define DBG_OPT_LEA2(oldn1, oldn2, n) \ - do { \ - ir_node *ons[2]; \ - ons[0] = oldn1; \ - ons[1] = oldn2; \ - hook_merge_nodes(&n, 1, ons, SIZ(ons), FS_BE_IA32_LEA); \ - __dbg_info_merge_sets(&n, 1, ons, SIZ(ons), dbg_backend); \ +#define DBG_OPT_LEA2(oldn1, oldn2, n) \ + do { \ + ir_node *ons[2]; \ + ons[0] = oldn1; \ + ons[1] = oldn2; \ + hook_merge_nodes(&n, 1, ons, ARRAY_SIZE(ons), FS_BE_IA32_LEA); \ + __dbg_info_merge_sets(&n, 1, ons, ARRAY_SIZE(ons), dbg_backend); \ } while(0) /** @@ -60,14 +78,14 @@ * @param oldn3 an additional old node * @param n the new lea */ -#define DBG_OPT_LEA3(oldn1, oldn2, oldn3, n) \ - do { \ - ir_node *ons[3]; \ - ons[0] = oldn1; \ - ons[1] = oldn2; \ - ons[2] = oldn3; \ - hook_merge_nodes(&n, 1, ons, SIZ(ons), FS_BE_IA32_LEA); \ - __dbg_info_merge_sets(&n, 1, ons, SIZ(ons), dbg_backend); \ +#define DBG_OPT_LEA3(oldn1, oldn2, oldn3, n) \ + do { \ + ir_node *ons[3]; \ + ons[0] = oldn1; \ + ons[1] = oldn2; \ + ons[2] = oldn3; \ + hook_merge_nodes(&n, 1, ons, ARRAY_SIZE(ons), FS_BE_IA32_LEA); \ + __dbg_info_merge_sets(&n, 1, ons, ARRAY_SIZE(ons), dbg_backend); \ } while(0) /** @@ -79,15 +97,15 @@ * @param oldn4 an additional old node * @param n the new lea */ -#define DBG_OPT_LEA4(oldn1, oldn2, oldn3, oldn4, n) \ - do { \ - ir_node *ons[4]; \ - ons[0] = oldn1; \ - ons[1] = oldn2; \ - ons[2] = oldn3; \ - ons[3] = oldn4; \ - hook_merge_nodes(&n, 1, ons, SIZ(ons), FS_BE_IA32_LEA); \ - __dbg_info_merge_sets(&n, 1, ons, SIZ(ons), dbg_backend); \ +#define DBG_OPT_LEA4(oldn1, oldn2, oldn3, oldn4, n) \ + do { \ + ir_node *ons[4]; \ + ons[0] = oldn1; \ + ons[1] = oldn2; \ + ons[2] = oldn3; \ + ons[3] = oldn4; \ + hook_merge_nodes(&n, 1, ons, ARRAY_SIZE(ons), FS_BE_IA32_LEA); \ + __dbg_info_merge_sets(&n, 1, ons, ARRAY_SIZE(ons), dbg_backend); \ } while(0) /** @@ -98,7 +116,7 @@ */ #define DBG_OPT_LOAD_LEA(oldn, n) \ do { \ - hook_merge_nodes(&n, 1, &oldn, 1, FS_BE_IA32_LOAD_LEA); \ + hook_merge_nodes(&n, 1, &oldn, 1, (hook_opt_kind)FS_BE_IA32_LOAD_LEA); \ __dbg_info_merge_pair(n, oldn, dbg_backend); \ } while(0) @@ -110,7 +128,7 @@ */ #define DBG_OPT_STORE_LEA(oldn, n) \ do { \ - hook_merge_nodes(&n, 1, &oldn, 1, FS_BE_IA32_STORE_LEA); \ + hook_merge_nodes(&n, 1, &oldn, 1, (hook_opt_kind)FS_BE_IA32_STORE_LEA); \ __dbg_info_merge_pair(n, oldn, dbg_backend); \ } while(0) @@ -122,7 +140,7 @@ */ #define DBG_OPT_AM_S(oldn, n) \ do { \ - hook_merge_nodes(&n, 1, &oldn, 1, FS_BE_IA32_AM_S); \ + hook_merge_nodes(&n, 1, &oldn, 1, (hook_opt_kind)FS_BE_IA32_AM_S); \ __dbg_info_merge_pair(n, oldn, dbg_backend); \ } while(0) @@ -130,16 +148,16 @@ * Merge the debug info due to a destination address mode creation. * * @param load the old load - * @param store yhe old store + * @param store the old store * @param n the new op */ -#define DBG_OPT_AM_D(load, store, n) \ - do { \ - ir_node *ons[2]; \ - ons[0] = load; \ - ons[1] = store; \ - hook_merge_nodes(&n, 1, ons, SIZ(ons), FS_BE_IA32_AM_D); \ - __dbg_info_merge_sets(&n, 1, ons, SIZ(ons), dbg_backend); \ +#define DBG_OPT_AM_D(load, store, n) \ + do { \ + ir_node *ons[2]; \ + ons[0] = load; \ + ons[1] = store; \ + hook_merge_nodes(&n, 1, ons, ARRAY_SIZE(ons), FS_BE_IA32_AM_D); \ + __dbg_info_merge_sets(&n, 1, ons, ARRAY_SIZE(ons), dbg_backend); \ } while(0) /** @@ -153,13 +171,13 @@ } while(0) /** - * A Copy was created to fullfill two address code constraints + * A Copy was created to fulfill two address code constraints * * @param cpy the copy */ #define DBG_OPT_2ADDRCPY(cpy) \ do { \ - hook_merge_nodes(NULL, 0, &cpy, 1, FS_BE_IA32_2ADDRCPY); \ + hook_merge_nodes(NULL, 0, &cpy, 1, (hook_opt_kind)FS_BE_IA32_2ADDRCPY); \ } while(0) /** @@ -170,7 +188,7 @@ */ #define DBG_OPT_SPILL2ST(spill, store) \ do { \ - hook_merge_nodes(&store, 1, &spill, 1, FS_BE_IA32_SPILL2ST); \ + hook_merge_nodes(&store, 1, &spill, 1, (hook_opt_kind)FS_BE_IA32_SPILL2ST); \ __dbg_info_merge_pair(store, spill, dbg_backend); \ } while(0) @@ -182,7 +200,7 @@ */ #define DBG_OPT_RELOAD2LD(rload, load) \ do { \ - hook_merge_nodes(&load, 1, &rload, 1, FS_BE_IA32_RELOAD2LD); \ + hook_merge_nodes(&load, 1, &rload, 1, (hook_opt_kind)FS_BE_IA32_RELOAD2LD); \ __dbg_info_merge_pair(load, rload, dbg_backend); \ } while(0) @@ -194,7 +212,7 @@ */ #define DBG_OPT_SUB2NEGADD(sub, nadd) \ do { \ - hook_merge_nodes(&nadd, 1, &sub, 1, FS_BE_IA32_SUB2NEGADD); \ + hook_merge_nodes(&nadd, 1, &sub, 1, (hook_opt_kind)FS_BE_IA32_SUB2NEGADD); \ __dbg_info_merge_pair(nadd, sub, dbg_backend); \ } while(0) @@ -206,8 +224,8 @@ */ #define DBG_OPT_LEA2ADD(lea, nadd) \ do { \ - hook_merge_nodes(&nadd, 1, &lea, 1, FS_BE_IA32_LEA2ADD); \ + hook_merge_nodes(&nadd, 1, &lea, 1, (hook_opt_kind)FS_BE_IA32_LEA2ADD); \ __dbg_info_merge_pair(nadd, lea, dbg_backend); \ } while(0) -#endif /* _IA32_DBG_STAT_H_ */ +#endif /* FIRM_BE_IA32_IA32_DBG_STAT_H */