normalized various stuff
authorGötz Lindenmaier <goetz@ipd.info.uni-karlsruhe.de>
Wed, 14 Jul 2004 15:09:41 +0000 (15:09 +0000)
committerGötz Lindenmaier <goetz@ipd.info.uni-karlsruhe.de>
Wed, 14 Jul 2004 15:09:41 +0000 (15:09 +0000)
[r3454]

ir/ana/cgana.c
ir/ana/irouts.c
ir/ana/irsimpletype.c
ir/common/Makefile.in
ir/common/firm.c
ir/common/firm.h
ir/common/old_fctnames.h [new file with mode: 0644]
ir/ident/ident.h

index 2a43624..21b70e0 100644 (file)
@@ -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);
       }
index 3597917..10e07e0 100644 (file)
@@ -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"
index 91d4905..82ade35 100644 (file)
@@ -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);
index 7f02b6b..3226cd6 100644 (file)
@@ -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)
 
index 6cb3041..9b3eee2 100644 (file)
@@ -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"
index f2e6c94..92e8da6 100644 (file)
@@ -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 (file)
index 0000000..5f75ea0
--- /dev/null
@@ -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
index cfba365..621d3ef 100644 (file)
@@ -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);