From 5f4a7559628fca2ee71c641e1eb14e8ee2e9c740 Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Fri, 6 Jul 2007 15:38:04 +0000 Subject: [PATCH] moved get_*_dbg_info() and set_*_dbg_info() to logical places removed unnecesary includes [r14979] --- include/libfirm/archop.h | 11 +++++------ include/libfirm/be.h | 1 - include/libfirm/ircons.h | 1 - include/libfirm/irnode.h | 16 ++++++++++++++- include/libfirm/typerep.h | 30 +++++++++++++++++++++++++++++ ir/be/TEMPLATE/TEMPLATE_transform.c | 1 - ir/be/ia32/ia32_transform.c | 1 - ir/be/mips/mips_transform.c | 1 - ir/be/ppc32/ppc32_transform.c | 1 - ir/be/ppc32/ppc32_transform_conv.c | 1 - ir/debug/dbginfo.c | 30 ----------------------------- ir/ir/irnode.c | 16 +++++++++++++++ ir/ir/irnode_t.h | 18 ++++++++++------- ir/opt/ifconv.c | 1 - ir/opt/reassoc.c | 1 - ir/tr/entity.c | 8 ++++++++ ir/tr/entity_t.h | 13 +++++++++++++ ir/tr/type.c | 8 ++++++++ ir/tr/type_t.h | 13 +++++++++++++ 19 files changed, 119 insertions(+), 53 deletions(-) diff --git a/include/libfirm/archop.h b/include/libfirm/archop.h index 8f4af247c..81d4d1983 100644 --- a/include/libfirm/archop.h +++ b/include/libfirm/archop.h @@ -19,27 +19,26 @@ /** * @file - * @brief Architecture dependand IR operations + * @brief Architecture depended IR operations * @version $Id$ */ #ifndef FIRM_ARCH_ARCHOP_H #define FIRM_ARCH_ARCHOP_H #include "firm_types.h" -#include "dbginfo.h" /** * Mask defining which architecture depend * operations are supported. */ typedef enum _arch_ops_mask { - ARCH_OPS_NONE = 0, /**< no additional Operations */ - ARCH_OPS_MINMAX = 1 /**< use the Min/Max Operation */ + ARCH_OPS_NONE = 0, /**< no additional Operations */ + ARCH_OPS_MINMAX = 1 /**< use the Min/Max Operation */ } arch_ops_mask; typedef struct _arch_ops_info { - arch_ops_mask enabled_ops; /**< a mask of enabled IR-opcodes */ - unsigned minmax_handle_NaN:1; /**< if set, Min(a,a) == a, else unknown */ + arch_ops_mask enabled_ops; /**< a mask of enabled IR-opcodes */ + unsigned minmax_handle_NaN:1; /**< if set, Min(a,a) == a, else unknown */ } arch_ops_info; extern ir_op *op_Min, *op_Max; diff --git a/include/libfirm/be.h b/include/libfirm/be.h index 290b11790..df530218d 100644 --- a/include/libfirm/be.h +++ b/include/libfirm/be.h @@ -30,7 +30,6 @@ #include "irarch.h" #include "archop.h" #include "lowering.h" -#include "dbginfo.h" #include "iroptimize.h" #include diff --git a/include/libfirm/ircons.h b/include/libfirm/ircons.h index 2c2e71fff..74dda652f 100644 --- a/include/libfirm/ircons.h +++ b/include/libfirm/ircons.h @@ -1120,7 +1120,6 @@ #include "firm_common.h" #include "irnode.h" #include "irgraph.h" -#include "dbginfo.h" /*-------------------------------------------------------------------------*/ /* The raw interface */ diff --git a/include/libfirm/irnode.h b/include/libfirm/irnode.h index 157f47302..8f4ba00bd 100644 --- a/include/libfirm/irnode.h +++ b/include/libfirm/irnode.h @@ -32,7 +32,6 @@ #include "typerep.h" #include "irop.h" #include "irmode.h" -#include "dbginfo.h" /** * @file irnode.h @@ -1379,6 +1378,21 @@ const void *get_irn_generic_attr_const(const ir_node *node); */ unsigned get_irn_idx(const ir_node *node); +/** + * Sets the debug information of a node. + * + * @param n The node. + * @param db The debug info. + */ +void set_irn_dbg_info(ir_node *n, dbg_info *db); + +/** + * Returns the debug information of an node. + * + * @param n The node. + */ +dbg_info *get_irn_dbg_info(const ir_node *n); + /*-----------------------------------------------------------------*/ /** Debug aides **/ /*-----------------------------------------------------------------*/ diff --git a/include/libfirm/typerep.h b/include/libfirm/typerep.h index 3ac1afd11..1044b9d8b 100644 --- a/include/libfirm/typerep.h +++ b/include/libfirm/typerep.h @@ -398,6 +398,21 @@ void set_entity_address_taken(ir_entity *ent, ir_address_taken_state flag); /** Return the name of the address_taken state. */ const char *get_address_taken_state_name(ir_address_taken_state state); +/** + * Returns the debug information of an entity. + * + * @param ent The entity. + */ +dbg_info *get_entity_dbg_info(const ir_entity *ent); + +/** + * Sets the debug information of an entity. + * + * @param ent The entity. + * @param db The debug info. + */ +void set_entity_dbg_info(ir_entity *ent, dbg_info *db); + /* -- Representation of constant values of entities -- */ /** * Returns true if the the node is representable as code on @@ -1383,6 +1398,21 @@ void set_master_type_visited(unsigned long val); unsigned long get_master_type_visited(void); void inc_master_type_visited(void); +/** + * Sets the debug information of a type. + * + * @param tp The type. + * @param db The debug info. + */ +void set_type_dbg_info(ir_type *tp, dbg_info *db); + +/** + * Returns the debug information of a type. + * + * @param tp The type. + */ +dbg_info *get_type_dbg_info(const ir_type *tp); + /** * Checks whether a pointer points to a type. * diff --git a/ir/be/TEMPLATE/TEMPLATE_transform.c b/ir/be/TEMPLATE/TEMPLATE_transform.c index 3dcb6412b..44024e4ef 100644 --- a/ir/be/TEMPLATE/TEMPLATE_transform.c +++ b/ir/be/TEMPLATE/TEMPLATE_transform.c @@ -33,7 +33,6 @@ #include "iredges.h" #include "irvrfy.h" #include "ircons.h" -#include "dbginfo.h" #include "iropt_t.h" #include "debug.h" diff --git a/ir/be/ia32/ia32_transform.c b/ir/be/ia32/ia32_transform.c index 3e7d69c7a..599f006fa 100644 --- a/ir/be/ia32/ia32_transform.c +++ b/ir/be/ia32/ia32_transform.c @@ -41,7 +41,6 @@ #include "irvrfy.h" #include "ircons.h" #include "irgwalk.h" -#include "dbginfo.h" #include "irprintf.h" #include "debug.h" #include "irdom.h" diff --git a/ir/be/mips/mips_transform.c b/ir/be/mips/mips_transform.c index 7c8b9eb36..947c77559 100644 --- a/ir/be/mips/mips_transform.c +++ b/ir/be/mips/mips_transform.c @@ -38,7 +38,6 @@ #include "ircons.h" #include "irprintf.h" #include "irop.h" -#include "dbginfo.h" #include "iropt_t.h" #include "debug.h" #include "error.h" diff --git a/ir/be/ppc32/ppc32_transform.c b/ir/be/ppc32/ppc32_transform.c index 2128238d5..50e863f0f 100644 --- a/ir/be/ppc32/ppc32_transform.c +++ b/ir/be/ppc32/ppc32_transform.c @@ -35,7 +35,6 @@ #include "iredges_t.h" #include "irvrfy.h" #include "ircons.h" -#include "dbginfo.h" #include "iropt_t.h" #include "irprintf.h" #include "debug.h" diff --git a/ir/be/ppc32/ppc32_transform_conv.c b/ir/be/ppc32/ppc32_transform_conv.c index 3c730f6da..205732bac 100644 --- a/ir/be/ppc32/ppc32_transform_conv.c +++ b/ir/be/ppc32/ppc32_transform_conv.c @@ -35,7 +35,6 @@ #include "iredges_t.h" #include "irvrfy.h" #include "ircons.h" -#include "dbginfo.h" #include "iropt_t.h" #include "debug.h" diff --git a/ir/debug/dbginfo.c b/ir/debug/dbginfo.c index 7b253b003..9ed9658d9 100644 --- a/ir/debug/dbginfo.c +++ b/ir/debug/dbginfo.c @@ -46,36 +46,6 @@ void dbg_init( merge_pair_func *mpf, merge_sets_func *msf, snprint_dbg_func *snp __dbg_info_snprint = snprint_dbg; } /* dbg_init */ - -void set_irn_dbg_info(ir_node *n, dbg_info *db) { - n->dbi = db; -} /* set_irn_dbg_info */ - -struct dbg_info *get_irn_dbg_info(const ir_node *n) { - return n->dbi; -} /* get_irn_dbg_info */ - - -/* Routines to access the field of an entity containing the - debugging information. */ -void set_entity_dbg_info(ir_entity *ent, dbg_info *db) { - ent->dbi = db; -} /* set_entity_dbg_info */ - -dbg_info *get_entity_dbg_info(const ir_entity *ent) { - return ent->dbi; -} /* get_entity_dbg_info */ - -/* Routines to access the field of a type containing the - debugging information. */ -void set_type_dbg_info(ir_type *tp, dbg_info *db) { - tp->dbi = db; -} /* set_type_dbg_info */ - -dbg_info *get_type_dbg_info(const ir_type *tp) { - return tp->dbi; -} /* get_type_dbg_info */ - /* * Converts a debug_action into a string. */ diff --git a/ir/ir/irnode.c b/ir/ir/irnode.c index d4731f209..064312532 100644 --- a/ir/ir/irnode.c +++ b/ir/ir/irnode.c @@ -2963,6 +2963,22 @@ ir_op_ops *firm_set_default_get_entity_attr(ir_opcode code, ir_op_ops *ops) { return ops; } +/* Sets the debug information of a node. */ +void (set_irn_dbg_info)(ir_node *n, dbg_info *db) { + _set_irn_dbg_info(n, db); +} + +/** + * Returns the debug information of an node. + * + * @param n The node. + */ +dbg_info *(get_irn_dbg_info)(const ir_node *n) { + return _get_irn_dbg_info(n); +} + + + #ifdef DEBUG_libfirm void dump_irn(ir_node *n) { int i, arity = get_irn_arity(n); diff --git a/ir/ir/irnode_t.h b/ir/ir/irnode_t.h index 1ef2f3af5..f5d2b82fc 100644 --- a/ir/ir/irnode_t.h +++ b/ir/ir/irnode_t.h @@ -33,18 +33,11 @@ #include "irflag_t.h" #include "firm_common_t.h" #include "irdom_t.h" /* For size of struct dom_info. */ -#include "dbginfo.h" -#include "irloop.h" #include "iredgekinds.h" #include "array.h" #include "set.h" #include "list.h" -#include "entity_t.h" -#include "type_t.h" -#include "tv_t.h" -#include "irextbb_t.h" - /** ir node attributes **/ @@ -1059,6 +1052,14 @@ static INLINE unsigned _get_irn_idx(const ir_node *node) { return node->node_idx; } +static INLINE dbg_info *_get_irn_dbg_info(const ir_node *n) { + return n->dbi; +} /* get_irn_dbg_info */ + +static INLINE void _set_irn_dbg_info(ir_node *n, dbg_info *db) { + n->dbi = db; +} + /* this section MUST contain all inline functions */ #define is_ir_node(thing) _is_ir_node(thing) #define get_irn_intra_arity(node) _get_irn_intra_arity(node) @@ -1157,4 +1158,7 @@ static INLINE unsigned _get_irn_idx(const ir_node *node) { #define get_irn_ins_or_deps(node) _get_irn_ins_or_deps(node) #define get_irn_in_or_dep(node, pos) _get_irn_in_or_dep(node, pos) +#define get_irn_dbg_info(node) _get_irn_dbg_info(node) +#define set_irn_dbg_info(node, db) _set_irn_dbg_info(node, db) + #endif diff --git a/ir/opt/ifconv.c b/ir/opt/ifconv.c index fec2af80d..07dd0abbd 100644 --- a/ir/opt/ifconv.c +++ b/ir/opt/ifconv.c @@ -29,7 +29,6 @@ #endif #include -#include "dbginfo.h" #include "iroptimize.h" #include "obst.h" #include "irnode_t.h" diff --git a/ir/opt/reassoc.c b/ir/opt/reassoc.c index f42c6c126..3a1a138cb 100644 --- a/ir/opt/reassoc.c +++ b/ir/opt/reassoc.c @@ -33,7 +33,6 @@ #include "irmode_t.h" #include "ircons_t.h" #include "irgmod.h" -#include "dbginfo.h" #include "iropt_dbg.h" #include "irflag_t.h" #include "irgwalk.h" diff --git a/ir/tr/entity.c b/ir/tr/entity.c index 4e8ef8bfb..5c820d7cd 100644 --- a/ir/tr/entity.c +++ b/ir/tr/entity.c @@ -1281,6 +1281,14 @@ ir_type *(get_entity_repr_class)(const ir_entity *ent) { return _get_entity_repr_class(ent); } /* get_entity_repr_class */ +dbg_info *(get_entity_dbg_info)(const ir_entity *ent) { + return _get_entity_dbg_info(ent); +} /* get_entity_dbg_info */ + +void (set_entity_dbg_info)(ir_entity *ent, dbg_info *db) { + _set_entity_dbg_info(ent, db); +} /* set_entity_dbg_info */ + /* Initialize entity module. */ void firm_init_entity(void) { diff --git a/ir/tr/entity_t.h b/ir/tr/entity_t.h index d1c042c2e..b799da20a 100644 --- a/ir/tr/entity_t.h +++ b/ir/tr/entity_t.h @@ -412,6 +412,17 @@ _get_entity_repr_class(const ir_entity *ent) { return ent->repr_class; } +static INLINE dbg_info * +_get_entity_dbg_info(const ir_entity *ent) { + return ent->dbi; +} + +static INLINE void +_set_entity_dbg_info(ir_entity *ent, dbg_info *db) { + ent->dbi = db; +} + + #define is_entity(thing) _is_entity(thing) #define get_entity_name(ent) _get_entity_name(ent) #define get_entity_ident(ent) _get_entity_ident(ent) @@ -453,6 +464,8 @@ _get_entity_repr_class(const ir_entity *ent) { #define entity_visited(ent) _entity_visited(ent) #define entity_not_visited(ent) _entity_not_visited(ent) #define get_entity_repr_class(ent) _get_entity_repr_class(ent) +#define get_entity_dbg_info(ent) _get_entity_dbg_info(ent) +#define set_entity_dbg_info(ent, db) _set_entity_dbg_info(ent, db) #endif /* FIRM_TR_ENTITY_T_H */ diff --git a/ir/tr/type.c b/ir/tr/type.c index f208cbb00..d5f9d0611 100644 --- a/ir/tr/type.c +++ b/ir/tr/type.c @@ -472,6 +472,14 @@ int (type_not_visited)(const ir_type *tp) { return _type_not_visited(tp); } +dbg_info *(get_type_dbg_info)(const ir_type *tp) { + return _get_type_dbg_info(tp); +} + +void (set_type_dbg_info)(ir_type *tp, dbg_info *db) { + _set_type_dbg_info(tp, db); +} + int (is_type)(const void *thing) { return _is_type(thing); } diff --git a/ir/tr/type_t.h b/ir/tr/type_t.h index be7efed03..87b68bee7 100644 --- a/ir/tr/type_t.h +++ b/ir/tr/type_t.h @@ -405,6 +405,16 @@ _type_not_visited(const ir_type *tp) { return tp->visit < firm_type_visited; } +static INLINE dbg_info * +_get_type_dbg_info(const ir_type *tp) { + return tp->dbi; +} + +static INLINE void +_set_type_dbg_info(ir_type *tp, dbg_info *db) { + tp->dbi = db; +} + static INLINE int _is_type(const void *thing) { return (get_kind(thing) == k_type); @@ -584,6 +594,7 @@ _set_method_calling_convention(ir_type *method, unsigned cc_mask) { method->attr.ma.irg_calling_conv = cc_mask; } + #define set_master_type_visited(val) _set_master_type_visited(val) #define get_master_type_visited() _get_master_type_visited() #define inc_master_type_visited() _inc_master_type_visited() @@ -603,6 +614,8 @@ _set_method_calling_convention(ir_type *method, unsigned cc_mask) { #define mark_type_visited(tp) _mark_type_visited(tp) #define type_visited(tp) _type_visited(tp) #define type_not_visited(tp) _type_not_visited(tp) +#define get_type_dbg_info(tp) _get_type_dbg_info(tp) +#define set_type_dbg_info(tp, db) _set_type_dbg_info(tp, db) #define is_type(thing) _is_type(thing) #define is_Class_type(clss) _is_class_type(clss) #define get_class_n_members(clss) _get_class_n_members(clss) -- 2.20.1