+++ /dev/null
-/*
- * 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.
- */
-
-/**
- * @file
- * @brief Implementation of offset_of and container_of
- * @date 31.05.2005
- * @author Sebastian Hack
- */
-#ifndef FIRM_ADT_OFFSET_H
-#define FIRM_ADT_OFFSET_H
-
-/**
- * Get the offset of a member of a struct.
- * @param type The type of the struct member is in.
- * @param member The name of the member.
- * @return The offset of member in type in bytes.
- */
-#define firm_offset_of(type, member) ((char *) &((type *) 0)->member - (char *) 0)
-
-/**
- * Make pointer to the struct from a pointer to a member of that struct.
- * @param ptr The pointer to the member.
- * @param type The type of the struct.
- * @param member The name of the member.
- * @return A pointer to the struct member is in.
- */
-#define firm_container_of(ptr, type, member) ((type *) ((char *) (ptr) - firm_offset_of(type, member)))
-
-#endif
+++ /dev/null
-/*
- * 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.
- */
-
-/**
- * @file
- * @date 31.05.2005
- * @author Sebastian Hack
- * @brief Some utility macros.
- */
-#ifndef FIRM_ADT_UTIL_H
-#define FIRM_ADT_UTIL_H
-
-/**
- * Get the offset of a member of a struct.
- * @param type The type of the struct member is in.
- * @param member The name of the member.
- * @return The offset of member in type in bytes.
- */
-#define offset_of(type, member) \
- ((char *) &(((type *) 0)->member) - (char *) 0)
-
-/**
- * Make pointer to the struct from a pointer to a member of that struct.
- * @param ptr The pointer to the member.
- * @param type The type of the struct.
- * @param member The name of the member.
- * @return A pointer to the struct member is in.
- */
-#define container_of(ptr, type, member) \
- ((type *) ((char *) (ptr) - offset_of(type, member)))
-
-/**
- * Get the number of elements of a static array.
- * @param arr The static array.
- * @return The number of elements in that array.
- */
-#define array_size(arr) \
- (sizeof(arr) / sizeof((arr)[0]))
-
-#endif
--- /dev/null
+/*
+ * 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.
+ */
+
+/**
+ * @file
+ * @date 31.05.2005
+ * @author Sebastian Hack
+ * @brief Some utility macros.
+ */
+#ifndef FIRM_ADT_UTIL_H
+#define FIRM_ADT_UTIL_H
+
+#include <stddef.h>
+
+/**
+ * Make pointer to the struct from a pointer to a member of that struct.
+ * @param ptr The pointer to the member.
+ * @param type The type of the struct.
+ * @param member The name of the member.
+ * @return A pointer to the struct member is in.
+ */
+#define firm_container_of(ptr, type, member) \
+ ((type *) ((char *) (ptr) - offsetof(type, member)))
+
+/**
+ * Returns size of a static array. Warning: This returns invalid values for
+ * dynamically allocated arrays.
+ *
+ * @param a static array
+ */
+#define ARRAY_SIZE(a) (sizeof(a)/sizeof((a)[0]))
+
+#endif
static void *init_block_data(ir_phase *ph, const ir_node *irn, void *old)
{
- lv_chk_t *lv = container_of(ph, lv_chk_t, ph);
+ lv_chk_t *lv = firm_container_of(ph, lv_chk_t, ph);
bl_info_t *bi = phase_alloc(ph, sizeof(bi[0]));
bi->id = get_Block_dom_tree_pre_num(irn);
#include "config.h"
#include "obst.h"
-#include "offset.h"
#include "irgopt.h"
#include "util.h"
#include "debug.h"
#include "fourcc.h"
-#include "offset.h"
#include "bitfiddle.h"
#include "raw_bitset.h"
#include "error.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.
* @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)
/**
* @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)
/**
* @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)
/**
* @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)
/**
#include "pmap.h"
#include "eset.h"
#include "pset.h"
+#include "util.h"
/** Dump only irgs with names that start with this prefix. */
static ident *dump_file_filter_id = NULL;
const pns_lookup_t *data; /**< the data */
} proj_lookup_t;
-#define ARR_SIZE(a) (sizeof(a)/sizeof(a[0]))
-
/** the lookup table for Proj(Start) names */
static const pns_lookup_t start_lut[] = {
#define X(a) { pn_Start_##a, #a }
/** the Proj lookup table */
static const proj_lookup_t proj_lut[] = {
-#define E(a) ARR_SIZE(a), a
+#define E(a) ARRAY_SIZE(a), a
{ iro_Start, E(start_lut) },
{ iro_Cond, E(cond_lut) },
{ iro_Call, E(call_lut) },
else {
unsigned i, j, f = 0;
- for (i = 0; i < ARR_SIZE(proj_lut); ++i) {
+ for (i = 0; i < ARRAY_SIZE(proj_lut); ++i) {
if (code == proj_lut[i].code) {
for (j = 0; j < proj_lut[i].num_data; ++j) {
if (proj_nr == proj_lut[i].data[j].nr) {
#include "dbginfo_t.h"
#include "irhooks.h"
#include "firmstat.h"
-
-/* This file contains makros that generate the calls to
- update the debug information after a transformation. */
-#define SIZ(x) sizeof(x)/sizeof(x[0])
+#include "util.h"
/**
* Merge the debug info due to dead block elimination.
* @param oldn the old block
* @param n the new block the merges with oldn
*/
-#define DBG_OPT_STG(oldn, n) \
- do { \
- ir_node *ons[2]; \
- ons[0] = oldn; \
- ons[1] = get_Block_cfgpred(oldn, 0); \
- hook_merge_nodes(&n, 1, ons, SIZ(ons), HOOK_OPT_STG); \
- __dbg_info_merge_sets(&n, 1, ons, SIZ(ons), dbg_straightening); \
+#define DBG_OPT_STG(oldn, n) \
+ do { \
+ ir_node *ons[2]; \
+ ons[0] = oldn; \
+ ons[1] = get_Block_cfgpred(oldn, 0); \
+ hook_merge_nodes(&n, 1, ons, ARRAY_SIZE(ons), HOOK_OPT_STG); \
+ __dbg_info_merge_sets(&n, 1, ons, ARRAY_SIZE(ons), dbg_straightening); \
} while(0)
/**
* @param proj2 the second ProjX predecessor
* @param n the new Block
*/
-#define DBG_OPT_IFSIM1(oldn, proj1, proj2, n) \
- do { \
- ir_node *ons[4]; \
- ons[0] = oldn; \
- ons[1] = proj1; \
- ons[2] = proj2; \
- ons[3] = get_Proj_pred(proj1); \
- hook_merge_nodes(&n, 1, ons, SIZ(ons), HOOK_OPT_IFSIM); \
- __dbg_info_merge_sets(&n, 1, ons, SIZ(ons), dbg_if_simplification); \
+#define DBG_OPT_IFSIM1(oldn, proj1, proj2, n) \
+ do { \
+ ir_node *ons[4]; \
+ ons[0] = oldn; \
+ ons[1] = proj1; \
+ ons[2] = proj2; \
+ ons[3] = get_Proj_pred(proj1); \
+ hook_merge_nodes(&n, 1, ons, ARRAY_SIZE(ons), HOOK_OPT_IFSIM); \
+ __dbg_info_merge_sets(&n, 1, ons, ARRAY_SIZE(ons), dbg_if_simplification); \
} while(0)
/**
ons[0] = oldn; \
ons[1] = a; \
ons[2] = b; \
- hook_merge_nodes(&n, 1, ons, SIZ(ons), flag); \
- __dbg_info_merge_sets(&n, 1, ons, SIZ(ons), dbg_algebraic_simplification); \
+ hook_merge_nodes(&n, 1, ons, ARRAY_SIZE(ons), flag); \
+ __dbg_info_merge_sets(&n, 1, ons, ARRAY_SIZE(ons), dbg_algebraic_simplification); \
} while(0)
/**
ons[0] = oldn; \
ons[1] = pred; \
ons[2] = n; \
- hook_merge_nodes(&n, 1, ons, SIZ(ons), flag); \
- __dbg_info_merge_sets(&n, 1, ons, SIZ(ons), dbg_algebraic_simplification); \
+ hook_merge_nodes(&n, 1, ons, ARRAY_SIZE(ons), flag); \
+ __dbg_info_merge_sets(&n, 1, ons, ARRAY_SIZE(ons), dbg_algebraic_simplification); \
} while(0)
/**
ir_node *ons[2]; \
ons[0] = oldn; \
ons[1] = a; \
- hook_merge_nodes(&n, 1, ons, SIZ(ons), flag); \
- __dbg_info_merge_sets(&n, 1, ons, SIZ(ons), dbg_algebraic_simplification); \
+ hook_merge_nodes(&n, 1, ons, ARRAY_SIZE(ons), flag); \
+ __dbg_info_merge_sets(&n, 1, ons, ARRAY_SIZE(ons), dbg_algebraic_simplification); \
} while(0)
/**
* @param oldst the old store that will be removed
* @param st the other store that overwrites oldst
*/
-#define DBG_OPT_WAW(oldst, st) \
- do { \
- ir_node *ons[2]; \
- ons[0] = oldst; \
- ons[1] = st; \
- hook_merge_nodes(&st, 1, ons, SIZ(ons), HOOK_OPT_WAW); \
- __dbg_info_merge_sets(&st, 1, ons, SIZ(ons), dbg_write_after_write); \
+#define DBG_OPT_WAW(oldst, st) \
+ do { \
+ ir_node *ons[2]; \
+ ons[0] = oldst; \
+ ons[1] = st; \
+ hook_merge_nodes(&st, 1, ons, ARRAY_SIZE(ons), HOOK_OPT_WAW); \
+ __dbg_info_merge_sets(&st, 1, ons, ARRAY_SIZE(ons), dbg_write_after_write); \
} while(0)
/**
* @param store the store that will be removed
* @param load the load that produces the value that store will write back
*/
-#define DBG_OPT_WAR(store, load) \
- do { \
- ir_node *ons[2]; \
- ons[0] = store; \
- ons[1] = load; \
- hook_merge_nodes(&load, 1, ons, SIZ(ons), HOOK_OPT_WAR); \
- __dbg_info_merge_sets(&load, 1, ons, SIZ(ons), dbg_write_after_read); \
+#define DBG_OPT_WAR(store, load) \
+ do { \
+ ir_node *ons[2]; \
+ ons[0] = store; \
+ ons[1] = load; \
+ hook_merge_nodes(&load, 1, ons, ARRAY_SIZE(ons), HOOK_OPT_WAR); \
+ __dbg_info_merge_sets(&load, 1, ons, ARRAY_SIZE(ons), dbg_write_after_read); \
} while(0)
/**
* @param load the load that will be replaced
* @param value the value that will replace the load
*/
-#define DBG_OPT_RAW(load, value) \
- do { \
- ir_node *ons[2]; \
- ons[0] = load; \
- ons[1] = value; \
- hook_merge_nodes(&value, 1, ons, SIZ(ons), HOOK_OPT_RAW); \
- __dbg_info_merge_sets(&value, 1, ons, SIZ(ons), dbg_read_after_write); \
+#define DBG_OPT_RAW(load, value) \
+ do { \
+ ir_node *ons[2]; \
+ ons[0] = load; \
+ ons[1] = value; \
+ hook_merge_nodes(&value, 1, ons, ARRAY_SIZE(ons), HOOK_OPT_RAW); \
+ __dbg_info_merge_sets(&value, 1, ons, ARRAY_SIZE(ons), dbg_read_after_write); \
} while(0)
/**
* @param oldld the old load that can be replaced
* @param ld the load that produces the same values
*/
-#define DBG_OPT_RAR(oldld, ld) \
- do { \
- ir_node *ons[2]; \
- ons[0] = oldld; \
- ons[1] = ld; \
- hook_merge_nodes(&ld, 1, ons, SIZ(ons), HOOK_OPT_RAR); \
- __dbg_info_merge_sets(&ld, 1, ons, SIZ(ons), dbg_read_after_read); \
+#define DBG_OPT_RAR(oldld, ld) \
+ do { \
+ ir_node *ons[2]; \
+ ons[0] = oldld; \
+ ons[1] = ld; \
+ hook_merge_nodes(&ld, 1, ons, ARRAY_SIZE(ons), HOOK_OPT_RAR); \
+ __dbg_info_merge_sets(&ld, 1, ons, ARRAY_SIZE(ons), dbg_read_after_read); \
} while(0)
/**
ir_node *ons[2]; \
ons[0] = ld; \
ons[1] = c; \
- hook_merge_nodes(&c, 1, ons, SIZ(ons), HOOK_OPT_RC); \
- __dbg_info_merge_sets(&ld, 1, ons, SIZ(ons), dbg_read_a_const); \
+ hook_merge_nodes(&c, 1, ons, ARRAY_SIZE(ons), HOOK_OPT_RC); \
+ __dbg_info_merge_sets(&ld, 1, ons, ARRAY_SIZE(ons), dbg_read_a_const); \
} while(0)
/**
* @param tuple the Tuple node
* @param n the Proj(Tuple) value
*/
-#define DBG_OPT_TUPLE(proj, tuple, n) \
- do { \
- ir_node *ons[3]; \
- ons[0] = proj; \
- ons[1] = tuple; \
- ons[2] = n; \
- hook_merge_nodes(&n, 1, ons, SIZ(ons), HOOK_OPT_TUPLE); \
- __dbg_info_merge_sets(&n, 1, ons, SIZ(ons), dbg_opt_auxnode); \
+#define DBG_OPT_TUPLE(proj, tuple, n) \
+ do { \
+ ir_node *ons[3]; \
+ ons[0] = proj; \
+ ons[1] = tuple; \
+ ons[2] = n; \
+ hook_merge_nodes(&n, 1, ons, ARRAY_SIZE(ons), HOOK_OPT_TUPLE); \
+ __dbg_info_merge_sets(&n, 1, ons, ARRAY_SIZE(ons), dbg_opt_auxnode); \
} while(0)
/**
* @param id the Id node
* @param n the predecessor
*/
-#define DBG_OPT_ID(id, n) \
- do { \
- ir_node *ons[2]; \
- ons[0] = id; \
- ons[1] = n; \
- hook_merge_nodes(&n, 1, ons, SIZ(ons), HOOK_OPT_ID); \
- __dbg_info_merge_sets(&n, 1, ons, SIZ(ons), dbg_opt_auxnode); \
+#define DBG_OPT_ID(id, n) \
+ do { \
+ ir_node *ons[2]; \
+ ons[0] = id; \
+ ons[1] = n; \
+ hook_merge_nodes(&n, 1, ons, ARRAY_SIZE(ons), HOOK_OPT_ID); \
+ __dbg_info_merge_sets(&n, 1, ons, ARRAY_SIZE(ons), dbg_opt_auxnode); \
} while(0)
/**
* @param oldn the old node
* @param n the node that replaces oldn
*/
-#define DBG_OPT_CSE(oldn, n) \
- do { \
- ir_node *ons[2]; \
- ons[0] = oldn; \
- ons[1] = n; \
- hook_merge_nodes(&n, 1, ons, SIZ(ons), HOOK_OPT_CSE); \
- __dbg_info_merge_sets(&n, 1, ons, SIZ(ons), dbg_opt_cse); \
+#define DBG_OPT_CSE(oldn, n) \
+ do { \
+ ir_node *ons[2]; \
+ ons[0] = oldn; \
+ ons[1] = n; \
+ hook_merge_nodes(&n, 1, ons, ARRAY_SIZE(ons), HOOK_OPT_CSE); \
+ __dbg_info_merge_sets(&n, 1, ons, ARRAY_SIZE(ons), dbg_opt_cse); \
} while(0)
/**
* @param sel the Sel node that will be replaced.
* @param c the constant node that replaces sel
*/
-#define DBG_OPT_POLY(sel, c) \
- do { \
- ir_node *ons[3]; \
- ons[0] = sel; \
- ons[1] = skip_Proj(get_Sel_ptr(sel)); \
- ons[2] = c; \
- hook_merge_nodes(&c, 1, ons, SIZ(ons), HOOK_OPT_POLY_CALL); \
- __dbg_info_merge_sets(&c, 1, ons, SIZ(ons), dbg_rem_poly_call); \
+#define DBG_OPT_POLY(sel, c) \
+ do { \
+ ir_node *ons[3]; \
+ ons[0] = sel; \
+ ons[1] = skip_Proj(get_Sel_ptr(sel)); \
+ ons[2] = c; \
+ hook_merge_nodes(&c, 1, ons, ARRAY_SIZE(ons), HOOK_OPT_POLY_CALL); \
+ __dbg_info_merge_sets(&c, 1, ons, ARRAY_SIZE(ons), dbg_rem_poly_call); \
} while(0)
/**
#include "firmstat_t.h"
#include "tv_t.h"
+#include "util.h"
/**
* calculated the dual logarithm of |value|
bits = log2abs(get_tarval_long(tv));
- if (bits > ARR_SIZE(status->const_info.int_bits_count))
- bits = ARR_SIZE(status->const_info.int_bits_count);
+ if (bits > ARRAY_SIZE(status->const_info.int_bits_count))
+ bits = ARRAY_SIZE(status->const_info.int_bits_count);
cnt_inc(&status->const_info.int_bits_count[bits]);
} else if (mode_is_float(mode)) {
{
size_t i;
- for (i = 0; i < ARR_SIZE(status->const_info.int_bits_count); ++i)
+ for (i = 0; i < ARRAY_SIZE(status->const_info.int_bits_count); ++i)
cnt_clr(&status->const_info.int_bits_count[i]);
- for (i = 0; i < ARR_SIZE(status->const_info.floats); ++i)
+ for (i = 0; i < ARRAY_SIZE(status->const_info.floats); ++i)
cnt_clr(&status->const_info.floats[i]);
cnt_clr(&status->const_info.others);
#include "stat_dmp.h"
#include "xmalloc.h"
#include "irhooks.h"
+#include "util.h"
/*
* need this to be static:
stat_dump_param_tbl(status->dist_param_cnt, global);
/* dump the optimization counter and clear them */
- stat_dump_opt_cnt(status->num_opts, ARR_SIZE(status->num_opts));
+ stat_dump_opt_cnt(status->num_opts, ARRAY_SIZE(status->num_opts));
clear_optimization_counter();
stat_dump_finish();
#include "counter.h"
#include "irhooks.h"
-/* some useful macro. */
-#define ARR_SIZE(a) (sizeof(a)/sizeof((a)[0]))
-
/*
* just be make some things clear :-), the
* poor man "generics"
#include "stat_dmp.h"
#include "irtools.h"
#include "irhooks.h"
+#include "util.h"
/**
* names of the optimizations
*/
static const char *get_opt_name(int index)
{
- assert(index < (int) ARR_SIZE(opt_names) && "index out of range");
+ assert(index < (int) ARRAY_SIZE(opt_names) && "index out of range");
assert((int) opt_names[index].kind == index && "opt_names broken");
return opt_names[index].name;
} /* get_opt_name */
fprintf(dmp->f, "\nBit usage for integer constants\n");
fprintf(dmp->f, "-------------------------------\n");
- for (i = 0; i < ARR_SIZE(tbl->int_bits_count); ++i) {
+ for (i = 0; i < ARRAY_SIZE(tbl->int_bits_count); ++i) {
fprintf(dmp->f, "%5u %12u\n", (unsigned) (i + 1), cnt_to_uint(&tbl->int_bits_count[i]));
cnt_add(&sum, &tbl->int_bits_count[i]);
} /* for */
fprintf(dmp->f, "\nFloating point constants classification\n");
fprintf(dmp->f, "--------------------------------------\n");
- for (i = 0; i < ARR_SIZE(tbl->floats); ++i) {
+ for (i = 0; i < ARRAY_SIZE(tbl->floats); ++i) {
fprintf(dmp->f, "%-10s %12u\n", stat_fc_name(i), cnt_to_uint(&tbl->floats[i]));
cnt_add(&sum, &tbl->floats[i]);
} /* for */