From 01eb4911df48799a296153fc08093b0ff8b6cc3a Mon Sep 17 00:00:00 2001 From: =?utf8?q?G=C3=B6tz=20Lindenmaier?= Date: Wed, 14 Jul 2004 15:09:41 +0000 Subject: [PATCH] normalized various stuff [r3454] --- ir/ana/cgana.c | 8 +++--- ir/ana/irouts.c | 3 +- ir/ana/irsimpletype.c | 2 +- ir/common/Makefile.in | 2 +- ir/common/firm.c | 2 +- ir/common/firm.h | 2 ++ ir/common/old_fctnames.h | 59 ++++++++++++++++++++++++++++++++++++++++ ir/ident/ident.h | 30 +++++++++----------- 8 files changed, 82 insertions(+), 26 deletions(-) create mode 100644 ir/common/old_fctnames.h diff --git a/ir/ana/cgana.c b/ir/ana/cgana.c index 2a4362493..21b70e00a 100644 --- a/ir/ana/cgana.c +++ b/ir/ana/cgana.c @@ -82,9 +82,9 @@ static entity *get_inherited_methods_implementation(entity *inh_meth) { assert(addr && "constant entity without value"); if (get_irn_op(addr) == op_Const) { - impl_meth = tarval_to_entity(get_Const_tarval(addr)); + impl_meth = get_tarval_entity(get_Const_tarval(addr)); } else if ((get_irn_op(addr) == op_SymConst) && - (get_SymConst_kind(addr) == symconst_addr_ent)) { + (get_SymConst_kind(addr) == symconst_addr_ent)) { impl_meth = get_SymConst_entity(addr); } else { assert(0 && "Complex constant values not supported -- address of method should be straight constant!"); @@ -474,7 +474,7 @@ static void callee_ana_node(ir_node * node, eset * methods) { case iro_Const: { /* interne Methode */ - entity * ent = tarval_to_entity(get_Const_tarval(node)); + entity * ent = get_tarval_entity(get_Const_tarval(node)); assert(ent && is_method_type(get_entity_type(ent))); if (get_entity_visibility(ent) != visibility_external_allocated) { if (!get_entity_irg(ent)) { @@ -668,7 +668,7 @@ static void free_mark(ir_node * node, eset * set) { case iro_Const: { tarval * val = get_Const_tarval(node); if (tarval_is_entity(val)) { /* filter null pointer */ - entity * ent = tarval_to_entity(val); + entity * ent = get_tarval_entity(val); if (is_method_type(get_entity_type(ent))) { eset_insert(set, ent); } diff --git a/ir/ana/irouts.c b/ir/ana/irouts.c index 359791717..10e07e013 100644 --- a/ir/ana/irouts.c +++ b/ir/ana/irouts.c @@ -29,8 +29,7 @@ #include "irouts.h" #include "irnode_t.h" -#include "irgraph_t.h" /* To access irg->outs field (which is private to this module) - without public access routine */ +#include "irgraph_t.h" #include "irprog_t.h" #include "irgwalk.h" #include "string.h" diff --git a/ir/ana/irsimpletype.c b/ir/ana/irsimpletype.c index 91d4905e2..82ade3526 100644 --- a/ir/ana/irsimpletype.c +++ b/ir/ana/irsimpletype.c @@ -234,7 +234,7 @@ static type *find_type_for_node(ir_node *n) { tp = get_entity_type(get_Sel_entity(a)); else if ((get_irn_op(a) == op_Const) && (tarval_is_entity(get_Const_tarval(a)))) - tp = get_entity_type(tarval_to_entity(get_Const_tarval(a))); + tp = get_entity_type(get_tarval_entity(get_Const_tarval(a))); else if (is_pointer_type(compute_irn_type(a))) { tp = get_pointer_points_to_type(get_irn_type(a)); if (is_array_type(tp)) tp = get_array_element_type(tp); diff --git a/ir/common/Makefile.in b/ir/common/Makefile.in index 7f02b6b66..3226cd6fe 100644 --- a/ir/common/Makefile.in +++ b/ir/common/Makefile.in @@ -15,7 +15,7 @@ srcdir = @srcdir@ topdir = ../.. subdir := ir/common -INSTALL_HEADERS := firm_common.h firm.h firmwalk.h statistics.h +INSTALL_HEADERS := firm_common.h firm.h firmwalk.h statistics.h old_fctnames.h SOURCES = $(INSTALL_HEADERS) diff --git a/ir/common/firm.c b/ir/common/firm.c index 6cb3041db..9b3eee2b8 100644 --- a/ir/common/firm.c +++ b/ir/common/firm.c @@ -18,8 +18,8 @@ # include "ident_t.h" # include "firm.h" # include "mangle.h" -# include "tv_t.h" /* init functions are not public */ +# include "tv_t.h" # include "tpop_t.h" # include "irnode_t.h" # include "irmode_t.h" diff --git a/ir/common/firm.h b/ir/common/firm.h index f2e6c940c..92e8da669 100644 --- a/ir/common/firm.h +++ b/ir/common/firm.h @@ -69,6 +69,8 @@ extern "C" { #endif +# include "old_fctnames.h" + /* The representations */ # include "firm_common.h"/* common type tags. */ # include "irprog.h" /* control flow and data of a program */ diff --git a/ir/common/old_fctnames.h b/ir/common/old_fctnames.h new file mode 100644 index 000000000..5f75ea02f --- /dev/null +++ b/ir/common/old_fctnames.h @@ -0,0 +1,59 @@ +/* + * Project: libFIRM + * File name: ir/ir/old_fctnames.h + * Purpose: Some makros supporting old function names. + * Author: Goetz Lindenmaier + * Modified by: + * Created: + * CVS-ID: $Id$ + * Copyright: (c) 1998-2003 Universität Karlsruhe + * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE. + */ + + +#ifndef __OLD_FCTNAMES_H__ +#define __OLD_FCTNAMES_H__ + +/* irgraph */ +#define get_irg_params get_irg_n_locs +#define get_irg_n_loc get_irg_n_locs +#define set_irg_params set_irg_n_loc + +/* irnode.h */ +#define get_Return_n_res get_Return_n_ress +#define get_Sel_n_index get_Sel_n_indexs +#define get_SymConst_ptrinfo get_SymConst_name +#define set_SymConst_ptrinfo set_SymConst_name + +/* irmode.h */ +#define get_ident_of_mode get_mode_ident +#define get_size_of_mode get_mode_size +#define get_ld_align_of_mode get_mode_ld_align +#define get_min_of_mode get_mode_min +#define get_max_of_mode get_mode_max +#define get_null_of_mode get_mode_null +#define get_fsigned_of_mode get_mode_fsigned +#define get_ffloat_of_mode get_mode_ffloat +#define get_mode_size(X) { assert(get_mode_size_bytes(X) != -1); get_mode_size_bytes(X); } + +/* type.h */ +#define get_type_nameid(_t_) get_type_ident(_t_) +#define set_type_nameid(_t_,_i_) set_type_ident(_t_,_i_) +#define get_class_n_member get_class_n_members +#define get_class_n_subtype get_class_n_subtypes +#define get_class_n_supertype get_class_n_supertypes +#define get_struct_n_member get_struct_n_members + +#define get_method_n_res(X) get_method_n_ress(X) + +/* tv.h */ +#define tarval_from_long(X, Y) new_tarval_from_long(Y, X) +#define tarval_P_from_entity(X) new_tarval_from_entity(X, mode_P_mach) +#define tarval_to_entity(X) get_tarval_entity(X) + + +/* ident.h */ +#define id_to_strlen get_id_strlen +#define id_to_str get_id_str + +#endif diff --git a/ir/ident/ident.h b/ir/ident/ident.h index cfba365cc..621d3efb1 100644 --- a/ir/ident/ident.h +++ b/ir/ident/ident.h @@ -50,19 +50,17 @@ typedef const struct set_entry ident; */ ident *new_id_from_str (const char *str); -/** - * Store a string and create an ident. +/** Store a string and create an ident. * - * Stores a string in the ident module and returns a handle for the string. - * - * Copies the string. This version can take non-zero-terminated strings + * Stores a string in the ident module and returns a handle for the string. + * Copies the string. This version takes non-zero-terminated strings. * * @param str - the string (or whatever) which shall be stored * @param len - the length of the data in bytes * * @return id - a handle for the generated ident * - * @see new_get_id_str(), get_id_strlen() + * @see new_id_from_str(), get_id_strlen() */ ident *id_from_str (const char *str, int len); @@ -76,10 +74,9 @@ ident *id_from_str (const char *str, int len); * * @return cp - a string * - * @see new_get_id_str(), id_from_str(), get_id_strlen() + * @see new_id_from_str(), id_from_str(), get_id_strlen() */ const char *get_id_str (ident *id); -#define id_to_str get_id_str /** * Returns the length of the string represented by an ident. @@ -88,17 +85,16 @@ const char *get_id_str (ident *id); * * @return len - the length of the string * - * @see new_get_id_str(), id_from_str(), get_id_str() + * @see new_id_from_str(), id_from_str(), get_id_str() */ int get_id_strlen(ident *id); -#define id_to_strlen get_id_strlen /** * Returns true if prefix is a prefix of an ident. * * @param prefix - the prefix * @param id - the ident * - * @see new_get_id_str(), id_from_str(), get_id_str(), id_is_prefix() + * @see new_id_from_str(), id_from_str(), get_id_str(), id_is_prefix() */ int id_is_prefix (ident *prefix, ident *id); @@ -108,7 +104,7 @@ int id_is_prefix (ident *prefix, ident *id); * @param suffix - the suffix * @param id - the ident * - * @see new_get_id_str(), id_from_str(), get_id_str(), id_is_prefix() + * @see new_id_from_str(), id_from_str(), get_id_str(), id_is_prefix() */ int id_is_suffix (ident *suffix, ident *id); @@ -118,7 +114,7 @@ int id_is_suffix (ident *suffix, ident *id); * @param infix - the infix * @param id - the ident to search in * - * @see new_get_id_str(), id_from_str(), get_id_str(), id_is_prefix() + * @see new_id_from_str(), id_from_str(), get_id_str(), id_is_prefix() */ /* int id_contains(ident *infix, ident *id); */ @@ -128,7 +124,7 @@ int id_is_suffix (ident *suffix, ident *id); * @param id - the ident * @param c - the character * - * @see new_get_id_str(), id_from_str(), get_id_str() + * @see new_id_from_str(), id_from_str(), get_id_str() */ int id_contains_char (ident *id, char c); @@ -138,9 +134,9 @@ int id_contains_char (ident *id, char c); * @param id - The ident to be printed. * * @return - * number of btes written + * number of bytes written * - * @see new_get_id_str(), id_from_str(), get_id_str(), id_is_prefix(), fprint_id() + * @see new_id_from_str(), id_from_str(), get_id_str(), id_is_prefix(), fprint_id() */ int print_id (ident *id); @@ -153,7 +149,7 @@ int print_id (ident *id); * @return * number of btes written * - * @see new_get_id_str(), id_from_str(), get_id_str(), id_is_prefix(), print_id() + * @see new_id_from_str(), id_from_str(), get_id_str(), id_is_prefix(), print_id() */ int fprint_id (FILE *F, ident *id); -- 2.20.1