normalized various syntactic constructs for firm jni.
authorGötz Lindenmaier <goetz@ipd.info.uni-karlsruhe.de>
Mon, 4 Nov 2002 17:27:02 +0000 (17:27 +0000)
committerGötz Lindenmaier <goetz@ipd.info.uni-karlsruhe.de>
Mon, 4 Nov 2002 17:27:02 +0000 (17:27 +0000)
changed functiontype in irgwalk to not include the pointer *.
This can be removed if crecoder includes a type analysis so that
it can find out whether a typedef is a pointer.

[r509]

37 files changed:
TODO
ir/ana/cgana.c
ir/ana/irloop_t.h
ir/ana/irouts.c
ir/ana/irouts.h
ir/debug/dbginfo.h
ir/ident/ident.h
ir/ir/ircgcons.c
ir/ir/ircgopt.c
ir/ir/ircons.c
ir/ir/ircons.h
ir/ir/irdump.c
ir/ir/irdump.h
ir/ir/irflag.c
ir/ir/irgraph.h
ir/ir/irgraph_t.h
ir/ir/irgwalk.c
ir/ir/irgwalk.h
ir/ir/irmode.c
ir/ir/irmode.h
ir/ir/irnode.c
ir/ir/irnode.h
ir/ir/irnode_t.h
ir/ir/irprog_t.h
ir/st/exc.c
ir/st/exc.h
ir/st/st.c
ir/tr/entity.c
ir/tr/entity.h
ir/tr/entity_t.h
ir/tr/mangle.c
ir/tr/mangle.h
ir/tr/type.c
ir/tr/type.h
ir/tr/typewalk.h
ir/tv/tv.h
ir/tv/tv_t.h

diff --git a/TODO b/TODO
index 48b667f..7e864bf 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,3 +1,17 @@
+  * 29.10.2002 Goetz
+    Representation of value compounds is not good, especially with
+    calls.
+
+  * 29.10.2002 Goetz
+    We can not represent bitfield members of structs in C.
+    A struct can have fields with n bits, n e.g. set to 3...
+
+  * 29.10.2002 Goetz
+    If parameter variables are dereferenced they must be represented
+    by an entity in the stack frame type.  We need a mechanism to
+    find out which fields were parameters so that the parameter
+    passing space on the frame can be used for the parameters.
+
   + 19.11.2001 Goetz
     SymConst mit ident taugt nicht:  Wenn man z.B. die Prozedur kennt
     sollte man die entitaet der Prozedur angeben koennen.  Ermoeglicht
index 551b3b4..426e7b1 100644 (file)
@@ -239,7 +239,7 @@ static void sel_methods_init(void) {
       pmap_insert(ldname_map, (void *) get_entity_ld_ident(ent), ent);
     }
   }
-  all_irg_walk((irg_walk_func) sel_methods_walker, NULL, ldname_map);
+  all_irg_walk((irg_walk_func *) sel_methods_walker, NULL, ldname_map);
   pmap_destroy(ldname_map);
 }
 
@@ -622,7 +622,7 @@ static entity ** get_free_methods(void) {
     if (get_entity_visibility(ent) != local) {
       eset_insert(set, ent);
     }
-    irg_walk_graph(irg, NULL, (irg_walk_func) free_ana_walker, set);
+    irg_walk_graph(irg, NULL, (irg_walk_func *) free_ana_walker, set);
   }
   /* Hauptprogramm ist auch frei, auch wenn es nicht "external
    * visible" ist. */
@@ -676,7 +676,7 @@ void opt_call_addrs(void) {
       pmap_insert(ldname_map, (void *) get_entity_ld_ident(ent), ent);
     }
   }
-  all_irg_walk((irg_walk_func) sel_methods_walker, NULL, ldname_map);
+  all_irg_walk((irg_walk_func *) sel_methods_walker, NULL, ldname_map);
   pmap_destroy(ldname_map);
 #endif
 }
index 3e196c1..816e69c 100644 (file)
@@ -8,7 +8,7 @@
 
 /* $Id$ */
 
-#include "common.h"
+#include "firm_common.h"
 #include "irloop.h"
 
 #ifndef _IRLOOP_T_H_
index 05dd0ba..7fcaaec 100644 (file)
@@ -64,8 +64,8 @@ INLINE ir_node *get_Block_cfg_out  (ir_node *bl, int pos) {
   return NULL;
 }
 
-void irg_out_walk_2(ir_node *node,  void (pre)(ir_node*, void*),
-                   void (post)(ir_node*, void*), void *env) {
+void irg_out_walk_2(ir_node *node,  irg_walk_func *pre,
+                   irg_walk_func *post, void *env) {
   int i;
   ir_node *succ;
 
index 9668508..3ddbd2e 100644 (file)
@@ -15,7 +15,6 @@
 # include "irgraph.h"
 # include "irnode.h"
 
-
 /**********************************************************************/
 /** Accessing the out datastructures.                                **/
 /** These routines only work properly if the ir_graph is in state    **/
@@ -37,18 +36,22 @@ int             get_Block_n_cfg_outs (ir_node *node);
 /* Access predecessor n. */
 INLINE ir_node *get_Block_cfg_out  (ir_node *node, int pos);
 
+#ifndef _IRG_WALK_FUNC_TYPEDEF_
+#define _IRG_WALK_FUNC_TYPEDEF_
+typedef void (irg_walk_func)(ir_node *, void *);
+#endif
 
 /* Walks over the graph starting at node.  Walks also if graph is in state
    "outs_inconsistent".  Assumes current_ir_graph is set properly. */
 void irg_out_walk(ir_node *node,
-                 void (pre)(ir_node*, void*), void (post)(ir_node*, void*),
+                 irg_walk_func *pre, irg_walk_func *post,
                  void *env);
 
 /* Walks only over Block nodes in the graph.  Has it's own visited
    flag, so that it can be interleaved with the other walker.
    node must be either op_Block or mode_X.  */
 void irg_out_block_walk(ir_node *node,
-                       void (pre)(ir_node*, void*), void (post)(ir_node*, void*),
+                       irg_walk_func *pre, irg_walk_func *post,
                        void *env);
 
 /**********************************************************************/
index f012029..24a48c0 100644 (file)
@@ -27,9 +27,9 @@
 typedef struct ir_node ir_node;
 #endif
 
+/* to resolve recursion between entity.h and type.h */
 #ifndef _ENTITY_TYPEDEF_
 #define _ENTITY_TYPEDEF_
-/* to resolve recursion between entity.h and type.h */
 typedef struct entity entity;
 #endif
 
@@ -150,11 +150,12 @@ static const char* dbg_action_2_str(dbg_action a) {
  *   No result.
  ***
  */
-void dbg_init( void (merge_pair)(ir_node *nw, ir_node *old, dbg_action info),
-              void (merge_sets)(ir_node **new_nodes, int n_new_nodes,
-                                ir_node **old_nodes, int n_old_nodes,
-                                dbg_action info)
-              );
+
+
+typedef void (merge_pair_func)(ir_node *, ir_node *, dbg_action);
+typedef void (merge_sets_func)(ir_node **, int, ir_node **, int, dbg_action);
+
+void dbg_init(merge_pair_func *mpf, merge_sets_func *msf);
 
 
 #endif /* _DBGINFO_H_ */
index fe8be8e..e03d2e6 100644 (file)
@@ -14,7 +14,7 @@
 
 # include <stdio.h>
 # include <assert.h>
-# include "common.h"
+# include "firm_common.h"
 
 /****h* libfirm/ident
  *
index 871156a..1ddde81 100644 (file)
@@ -132,7 +132,7 @@ static void collect_phicallproj(void) {
     link(start, get_irg_frame(irg));
     link(start, get_irg_globals(irg));
     /* walk */
-    irg_walk_graph(irg, clear_link, (irg_walk_func) collect_phicallproj_walker, &end);
+    irg_walk_graph(irg, clear_link, (irg_walk_func *) collect_phicallproj_walker, &end);
   }
 }
 
index e760ca2..3f69708 100644 (file)
@@ -47,7 +47,7 @@ void gc_irgs(int n_keep, entity ** keep_arr) {
       ir_graph * irg = get_entity_irg(marked[i]);
       ir_node * node = get_irg_end(irg);
       /* collect calls */
-      irg_walk_graph(irg, clear_link, (irg_walk_func) collect_call, node);
+      irg_walk_graph(irg, clear_link, (irg_walk_func *) collect_call, node);
       /* iterate calls */
       for (node = get_irn_link(node); node; node = get_irn_link(node)) {
        int i;
index fb8394b..0756c0c 100644 (file)
@@ -19,7 +19,7 @@
 # include "irnode_t.h"
 # include "irmode_t.h"
 # include "ircons.h"
-# include "common_t.h"
+# include "firm_common_t.h"
 # include "irvrfy.h"
 # include "irop.h"
 # include "iropt_t.h"
@@ -434,7 +434,7 @@ new_rd_Cond (dbg_info* db, ir_graph *irg, ir_node *block, ir_node *c)
 
 ir_node *
 new_rd_Call (dbg_info* db, ir_graph *irg, ir_node *block, ir_node *store,
-           ir_node *callee, int arity, ir_node **in, type *type)
+           ir_node *callee, int arity, ir_node **in, type *tp)
 {
   ir_node **r_in;
   ir_node *res;
@@ -448,8 +448,8 @@ new_rd_Call (dbg_info* db, ir_graph *irg, ir_node *block, ir_node *store,
 
   res = new_ir_node (db, irg, block, op_Call, mode_T, r_arity, r_in);
 
-  assert(is_method_type(type));
-  set_Call_type(res, type);
+  assert(is_method_type(tp));
+  set_Call_type(res, tp);
   res->attr.call.callee_arr = NULL;
   res = optimize (res);
   irn_vrfy (res);
@@ -750,8 +750,8 @@ INLINE ir_node *new_r_InstOf (ir_graph *irg, ir_node *block, ir_node *store, ir_
 }
 INLINE ir_node *new_r_Call   (ir_graph *irg, ir_node *block, ir_node *store,
                       ir_node *callee, int arity, ir_node **in,
-                      type *type) {
-  return new_rd_Call(NULL, irg, block, store, callee, arity, in, type);
+                      type *tp) {
+  return new_rd_Call(NULL, irg, block, store, callee, arity, in, tp);
 }
 INLINE ir_node *new_r_Add    (ir_graph *irg, ir_node *block,
                       ir_node *op1, ir_node *op2, ir_mode *mode) {
@@ -1914,11 +1914,11 @@ new_d_Cond (dbg_info* db, ir_node *c)
 
 ir_node *
 new_d_Call (dbg_info* db, ir_node *store, ir_node *callee, int arity, ir_node **in,
-         type *type)
+         type *tp)
 {
   ir_node *res;
   res = new_rd_Call (db, current_ir_graph, current_ir_graph->current_block,
-                    store, callee, arity, in, type);
+                    store, callee, arity, in, tp);
 #if PRECISE_EXC_CONTEXT
   if ((current_ir_graph->phase_state == phase_building) &&
       (get_irn_op(res) == op_Call))  /* Could be optimized away. */
@@ -2236,7 +2236,7 @@ ir_node *new_Jmp    (void) {
 ir_node *new_Cond   (ir_node *c) {
   return new_d_Cond(NULL, c);
 }
-ir_node *new_Return (ir_node *store, int arity, ir_node **in) {
+ir_node *new_Return (ir_node *store, int arity, ir_node *in[]) {
   return new_d_Return(NULL, store, arity, in);
 }
 ir_node *new_Raise  (ir_node *store, ir_node *obj) {
@@ -2259,8 +2259,8 @@ ir_node *new_InstOf (ir_node *store, ir_node *objptr, type *ent) {
   return (new_d_InstOf (NULL, store, objptr, ent));
 }
 ir_node *new_Call   (ir_node *store, ir_node *callee, int arity, ir_node **in,
-                    type *type) {
-  return new_d_Call(NULL, store, callee, arity, in, type);
+                    type *tp) {
+  return new_d_Call(NULL, store, callee, arity, in, tp);
 }
 ir_node *new_Add    (ir_node *op1, ir_node *op2, ir_mode *mode) {
   return new_d_Add(NULL, op1, op2, mode);
index 7633c84..66b43e8 100644 (file)
  *      attr.con   A tarval* pointer to the proper entry in the constant
  *                 table.
  *
- *    ir_node *new_SymConst (type *type, symconst_kind kind)
+ *    ir_node *new_SymConst (type *tp, symconst_kind kind)
  *    ------------------------------------------------------------
  *
  *    There are three kinds of symbolic constants:
 # ifndef _IRCONS_H_
 # define _IRCONS_H_
 
-# include "common.h"
+# include "firm_common.h"
 # include "irgraph.h"
 # include "irnode.h"
 # include "irmode.h"
@@ -1108,7 +1108,7 @@ ir_node *new_rd_Sel    (dbg_info *db, ir_graph *irg, ir_node *block, ir_node *st
                       entity *ent);
 ir_node *new_rd_Call   (dbg_info *db, ir_graph *irg, ir_node *block, ir_node *store,
                       ir_node *callee, int arity, ir_node **in,
-                      type *type);
+                      type *tp);
 ir_node *new_rd_Add    (dbg_info *db, ir_graph *irg, ir_node *block,
                       ir_node *op1, ir_node *op2, ir_mode *mode);
 ir_node *new_rd_Sub    (dbg_info *db, ir_graph *irg, ir_node *block,
@@ -1200,7 +1200,7 @@ ir_node *new_r_Sel    (ir_graph *irg, ir_node *block, ir_node *store,
                       entity *ent);
 ir_node *new_r_Call   (ir_graph *irg, ir_node *block, ir_node *store,
                       ir_node *callee, int arity, ir_node **in,
-                      type *type);
+                      type *tp);
 ir_node *new_r_Add    (ir_graph *irg, ir_node *block,
                       ir_node *op1, ir_node *op2, ir_mode *mode);
 ir_node *new_r_Sub    (ir_graph *irg, ir_node *block,
@@ -1293,7 +1293,7 @@ ir_node *new_d_simpleSel(dbg_info* db, ir_node *store, ir_node *objptr, entity *
 ir_node *new_d_Sel    (dbg_info* db, ir_node *store, ir_node *objptr, int arity, ir_node **in,
                      entity *ent);
 ir_node *new_d_Call   (dbg_info* db, ir_node *store, ir_node *callee, int arity, ir_node **in,
-                    type *type);
+                    type *tp);
 ir_node *new_d_Add    (dbg_info* db, ir_node *op1, ir_node *op2, ir_mode *mode);
 ir_node *new_d_Sub    (dbg_info* db, ir_node *op1, ir_node *op2, ir_mode *mode);
 ir_node *new_d_Minus  (dbg_info* db, ir_node *op,  ir_mode *mode);
@@ -1360,7 +1360,7 @@ ir_node *new_Sel    (ir_node *store, ir_node *objptr, int arity, ir_node **in,
                      entity *ent);
 ir_node *new_InstOf (ir_node *store, ir_node *objptr, type *ent);
 ir_node *new_Call   (ir_node *store, ir_node *callee, int arity, ir_node **in,
-                    type *type);
+                    type *tp);
 ir_node *new_CallBegin(ir_node *callee);
 ir_node *new_Add    (ir_node *op1, ir_node *op2, ir_mode *mode);
 ir_node *new_Sub    (ir_node *op1, ir_node *op2, ir_mode *mode);
index e009ef6..cc613a9 100644 (file)
@@ -28,7 +28,7 @@
 # include "typewalk.h"
 # include "irouts.h"
 # include "irdom.h"
-# include "common_t.h"
+# include "firm_common_t.h"
 # include  "irloop.h"
 
 # include "exc.h"
@@ -1501,7 +1501,7 @@ void dump_cg_block_graph(ir_graph * irg) {
 
   vcg_open(irg, "");
 
-  irg_walk_graph(irg, clear_link, (irg_walk_func) collect_blocks_floats_cg, map);
+  irg_walk_graph(irg, clear_link, (irg_walk_func *) collect_blocks_floats_cg, map);
   for (entry = pmap_first(map); entry; entry = pmap_next(map))
     pmap_insert(map2, entry->key, entry->value);
   for (entry = pmap_first(map); entry; entry = pmap_next(map)) {
@@ -1574,7 +1574,7 @@ void dump_cg_graph(ir_graph * irg) {
   pmap_entry * entry;
   vcg_open(irg, "");
 
-  irg_walk_graph(irg, clear_link, (irg_walk_func) collect_blocks_floats_cg, map);
+  irg_walk_graph(irg, clear_link, (irg_walk_func *) collect_blocks_floats_cg, map);
   for (entry = pmap_first(map); entry; entry = pmap_next(map))
     pmap_insert(map2, entry->key, entry->value);
   for (entry = pmap_first(map); entry; entry = pmap_next(map)) {
index 38f4db4..8a3a5ff 100644 (file)
@@ -247,7 +247,8 @@ void dump_all_cg_block_graph();
  *  turn_of_edge_labels
  ***
  */
-void dump_all_ir_graphs (void dump_graph(ir_graph*));
+typedef void (dump_graph_func)(ir_graph *);
+void dump_all_ir_graphs (dump_graph_func *dump_graph);
 
 /****m* irdump/turn_off_edge_labels
  *
index 4e95b08..a207edd 100644 (file)
@@ -13,7 +13,7 @@
 #endif
 
 #include "irflag.h"
-#include "common.h"
+#include "firm_common.h"
 
 
 /* 0 - don't do this optimization
index 0095ef7..e316248 100644 (file)
@@ -122,6 +122,7 @@ void     set_irg_end (ir_graph *irg, ir_node *node);
 /* @@@ oblivious, no more supported. */
 ir_node *get_irg_cstore (ir_graph *irg);
 void     set_irg_cstore (ir_graph *irg, ir_node *node);
+/* end oblivious */
 
 ir_node *get_irg_frame (ir_graph *irg);
 void     set_irg_frame (ir_graph *irg, ir_node *node);
@@ -165,6 +166,7 @@ typedef enum {
   phase_high,
   phase_low
 } irg_phase_state;
+
 irg_phase_state get_irg_phase_state (ir_graph *irg);
 void set_irg_phase_low(ir_graph *irg);
 
@@ -212,14 +214,14 @@ void set_irg_dom_inconsistent(ir_graph *irg);
 /* state: loopinfo_state
    Loop information describes the loops within the control and
    data flow of the procedure.
-typedef enum {
+tpedef enum {   @@@ make unrecognizable for jni script!!!
   no_loopinfo,
   loopinfo_consistent,
   loopinfo_inconsistent
 } irg_loopinfo_state;
 irg_loopinfo_state get_irg_loopinfo_state(ir_graph *irg);
 void set_irg_loopinfo_inconsistent(ir_graph *irg);
-*/
+
 
 /* A void * field to link arbritary information to the node. */
 void set_irg_link (ir_graph *irg, void *thing);
index e436676..bc7d0fd 100644 (file)
@@ -13,7 +13,7 @@
 # include "obst.h"
 # include "pset.h"
 # include "irgraph.h"
-# include "common_t.h"
+# include "firm_common_t.h"
 
 #define FRAME_TP_SUFFIX "frame_tp"
 
index a4561fa..8ac1ba6 100644 (file)
@@ -26,7 +26,7 @@
 
 /* walk over an interprocedural graph (callgraph). Visits only graphs in irg_set. */
 static void irg_walk_cg(ir_node * node, int visited, eset * irg_set,
-                       irg_walk_func pre, irg_walk_func post, void * env) {
+                       irg_walk_func *pre, irg_walk_func *post, void * env) {
   int i;
   ir_graph * rem = current_ir_graph;
   ir_node * pred;
@@ -98,13 +98,13 @@ static void collect_irgs(ir_node * node, eset * irg_set) {
       ir_graph * irg = ent ? get_entity_irg(ent) : NULL;
       if (irg && !eset_contains(irg_set, irg)) {
        eset_insert(irg_set, irg);
-       irg_walk_graph(irg, (irg_walk_func) collect_irgs, NULL, irg_set);
+       irg_walk_graph(irg, (irg_walk_func *) collect_irgs, NULL, irg_set);
       }
     }
   }
 }
 
-void irg_walk_2(ir_node *node, irg_walk_func pre, irg_walk_func post, void * env)
+void irg_walk_2(ir_node *node, irg_walk_func *pre, irg_walk_func *post, void * env)
 {
   int i;
   assert(node);
@@ -125,7 +125,7 @@ void irg_walk_2(ir_node *node, irg_walk_func pre, irg_walk_func post, void * env
 }
 
 
-void irg_walk(ir_node *node, irg_walk_func pre, irg_walk_func post, void *env)
+void irg_walk(ir_node *node, irg_walk_func *pre, irg_walk_func *post, void *env)
 {
   assert(node);
   if (interprocedural_view) {
@@ -134,7 +134,7 @@ void irg_walk(ir_node *node, irg_walk_func pre, irg_walk_func post, void *env)
     ir_graph * irg;
     interprocedural_view = false;
     eset_insert(irg_set, current_ir_graph);
-    irg_walk(node, (irg_walk_func) collect_irgs, NULL, irg_set);
+    irg_walk(node, (irg_walk_func *) collect_irgs, NULL, irg_set);
     interprocedural_view = true;
     visited = get_max_irg_visited() + 1;
     irg_walk_cg(node, visited, irg_set, pre, post, env);
@@ -150,7 +150,7 @@ void irg_walk(ir_node *node, irg_walk_func pre, irg_walk_func post, void *env)
 }
 
 
-void irg_walk_graph(ir_graph *irg, irg_walk_func pre, irg_walk_func post, void *env) {
+void irg_walk_graph(ir_graph *irg, irg_walk_func *pre, irg_walk_func *post, void *env) {
   ir_graph * rem = current_ir_graph;
   current_ir_graph = irg;
   irg_walk(get_irg_end(irg), pre, post, env);
@@ -160,7 +160,7 @@ void irg_walk_graph(ir_graph *irg, irg_walk_func pre, irg_walk_func post, void *
 /* Executes irg_walk(end, pre, post, env) for all irgraphs in irprog.
    Sets current_ir_graph properly for each walk.  Conserves current
    current_ir_graph. */
-void all_irg_walk(irg_walk_func pre, irg_walk_func post, void *env) {
+void all_irg_walk(irg_walk_func *pre, irg_walk_func *post, void *env) {
   int i;
   ir_graph *irg, *rem;
 
@@ -197,7 +197,7 @@ switch_irg (ir_node *n, int index) {
   return old_current;
 }
 
-void cg_walk_2(ir_node *node, irg_walk_func pre, irg_walk_func post, void * env)
+void cg_walk_2(ir_node *node, irg_walk_func *pre, irg_walk_func *post, void * env)
 {
   int i;
   ir_graph *rem = NULL;
@@ -223,7 +223,7 @@ void cg_walk_2(ir_node *node, irg_walk_func pre, irg_walk_func post, void * env)
 
 
 /* Walks all irgs in interprocedural view.  Visits each node only once. */
-void cg_walk(irg_walk_func pre, irg_walk_func post, void *env) {
+void cg_walk(irg_walk_func *pre, irg_walk_func *post, void *env) {
   int i;
   ir_graph *rem = current_ir_graph;
   int rem_view = interprocedural_view;
@@ -268,7 +268,7 @@ ir_node *get_cf_op(ir_node *n) {
   return skip_Proj(n);
 }
 
-void irg_block_walk_2(ir_node *node, irg_walk_func pre, irg_walk_func post, void *env)
+void irg_block_walk_2(ir_node *node, irg_walk_func *pre, irg_walk_func *post, void *env)
 {
   int i;
   assert(get_irn_opcode(node) == iro_Block);
@@ -299,7 +299,7 @@ void irg_block_walk_2(ir_node *node, irg_walk_func pre, irg_walk_func post, void
 
 /* walks only over Block nodes in the graph.  Has it's own visited
    flag, so that it can be interleaved with the other walker.         */
-void irg_block_walk(ir_node *node, irg_walk_func pre, irg_walk_func post, void *env)
+void irg_block_walk(ir_node *node, irg_walk_func *pre, irg_walk_func *post, void *env)
 {
   ir_node *block, *pred;
   int i;
@@ -323,8 +323,8 @@ void irg_block_walk(ir_node *node, irg_walk_func pre, irg_walk_func post, void *
 }
 
 
-void irg_block_walk_graph(ir_graph *irg, irg_walk_func pre,
-                         irg_walk_func post, void *env) {
+void irg_block_walk_graph(ir_graph *irg, irg_walk_func *pre,
+                         irg_walk_func *post, void *env) {
   ir_graph * rem = current_ir_graph;
   current_ir_graph = irg;
   irg_block_walk(get_irg_end(irg), pre, post, env);
@@ -355,7 +355,7 @@ void walk_entity(entity *ent, void *env) {
 }
 
 /* Walks over all code in const_code_irg. */
-void walk_const_code(irg_walk_func pre, irg_walk_func post, void *env) {
+void walk_const_code(irg_walk_func *pre, irg_walk_func *post, void *env) {
   int i, j;
   walk_env my_env;
 
index 71f6ee7..f8e1102 100644 (file)
 # include "irnode.h"
 
 /* type of callback function for ir_graph walk */
-typedef void (* irg_walk_func)(ir_node *, void *);
+#ifndef _IRG_WALK_FUNC_TYPEDEF_
+#define _IRG_WALK_FUNC_TYPEDEF_
+typedef void (irg_walk_func)(ir_node *, void *);
+#endif
 
 /* Walks over the ir graph, starting at the node given as first argument.
    Executes pre before visiting the predecessor of a node, post after.
@@ -28,36 +31,36 @@ typedef void (* irg_walk_func)(ir_node *, void *);
    flag.  It marks the node as visited before executing pre.
    The void* env can be used to pass status information between the
    pre and post functions.  */
-void irg_walk(ir_node *node, irg_walk_func pre, irg_walk_func post, void *env);
+void irg_walk(ir_node *node, irg_walk_func *pre, irg_walk_func *post, void *env);
 
 /* Like "irg_walk", but walks over all reachable nodes in the ir
  * graph, starting at the end operation. During the walk current_ir_graph
  * is set to irg. */
-void irg_walk_graph(ir_graph *irg, irg_walk_func pre, irg_walk_func post, void *env);
+void irg_walk_graph(ir_graph *irg, irg_walk_func *pre, irg_walk_func *post, void *env);
 
 /* Executes irg_walk(end, pre, post, env) for all irgraphs in irprog.
    Sets current_ir_graph properly for each walk.  Conserves current
    current_ir_graph.  In interprocedural view nodes can be visited several
    times. */
-void all_irg_walk(irg_walk_func pre, irg_walk_func post, void *env);
+void all_irg_walk(irg_walk_func *pre, irg_walk_func *post, void *env);
 
 /* Walks all irgs in interprocedural view.  Visits each node only once.
    Sets current_ir_graph properly. */
-void cg_walk(irg_walk_func pre, irg_walk_func post, void *env);
+void cg_walk(irg_walk_func *pre, irg_walk_func *post, void *env);
 
 /* Walks only over Block nodes in the graph.  Has it's own visited
    flag, so that it can be interleaved with the other walker.
    If a none block is passed, starts at the block this node belongs to.
    If end is passed also visites kept alive blocks. */
-void irg_block_walk(ir_node *node, irg_walk_func pre, irg_walk_func post, void *env);
+void irg_block_walk(ir_node *node, irg_walk_func *pre, irg_walk_func *post, void *env);
 
 /* Like "irg_block_walk", but walks over all reachable blocks in the
  * ir graph, starting at the end block. */
-void irg_block_walk_graph(ir_graph *irg, irg_walk_func pre, irg_walk_func post, void *env);
+void irg_block_walk_graph(ir_graph *irg, irg_walk_func *pre, irg_walk_func *post, void *env);
 
 /* Walks over all code in const_code_irg.
    Uses visited flag in const_code_irg. */
-void walk_const_code(irg_walk_func pre, irg_walk_func post, void *env);
+void walk_const_code(irg_walk_func *pre, irg_walk_func *post, void *env);
 
 
 # endif /* _IRGWALK_H_ */
index 5b9e024..aaa58cb 100644 (file)
@@ -38,26 +38,26 @@ ir_mode *mode_M;
 ir_mode *mode_R;
 ir_mode *mode_Z;
 
-INLINE ir_mode *get_mode_T() { return mode_T; }
-INLINE ir_mode *get_mode_f() { return mode_f; }
-INLINE ir_mode *get_mode_d() { return mode_d; }
-INLINE ir_mode *get_mode_c() { return mode_c; }
-INLINE ir_mode *get_mode_C() { return mode_C; }
-INLINE ir_mode *get_mode_h() { return mode_h; }
-INLINE ir_mode *get_mode_H() { return mode_H; }
-INLINE ir_mode *get_mode_i() { return mode_i; }
-INLINE ir_mode *get_mode_I() { return mode_I; }
-INLINE ir_mode *get_mode_l() { return mode_l; }
-INLINE ir_mode *get_mode_L() { return mode_L; }
-INLINE ir_mode *get_mode_B() { return mode_B; }
-INLINE ir_mode *get_mode_p() { return mode_b; }
-INLINE ir_mode *get_mode_b() { return mode_p; }
-INLINE ir_mode *get_mode_s() { return mode_s; }
-INLINE ir_mode *get_mode_S() { return mode_S; }
-INLINE ir_mode *get_mode_X() { return mode_X; }
-INLINE ir_mode *get_mode_M() { return mode_M; }
-INLINE ir_mode *get_mode_R() { return mode_R; }
-INLINE ir_mode *get_mode_Z() { return mode_Z; }
+INLINE ir_mode *get_modeT() { return mode_T; }
+INLINE ir_mode *get_modef() { return mode_f; }
+INLINE ir_mode *get_moded() { return mode_d; }
+INLINE ir_mode *get_modec() { return mode_c; }
+INLINE ir_mode *get_modeC() { return mode_C; }
+INLINE ir_mode *get_modeh() { return mode_h; }
+INLINE ir_mode *get_modeH() { return mode_H; }
+INLINE ir_mode *get_modei() { return mode_i; }
+INLINE ir_mode *get_modeI() { return mode_I; }
+INLINE ir_mode *get_model() { return mode_l; }
+INLINE ir_mode *get_modeL() { return mode_L; }
+INLINE ir_mode *get_modeB() { return mode_B; }
+INLINE ir_mode *get_modep() { return mode_b; }
+INLINE ir_mode *get_modeb() { return mode_p; }
+INLINE ir_mode *get_modes() { return mode_s; }
+INLINE ir_mode *get_modeS() { return mode_S; }
+INLINE ir_mode *get_modeX() { return mode_X; }
+INLINE ir_mode *get_modeM() { return mode_M; }
+INLINE ir_mode *get_modeR() { return mode_R; }
+INLINE ir_mode *get_modeZ() { return mode_Z; }
 
 void
 init_mode (void)
index a8c2606..e6b6a0c 100644 (file)
@@ -79,26 +79,26 @@ extern ir_mode *mode_R; /* block */
 extern ir_mode *mode_Z; /* infinit integers */ /* oblivious */
 
 /* Access routines for JNI Interface */
-ir_mode *get_mode_T();
-ir_mode *get_mode_f();
-ir_mode *get_mode_d();
-ir_mode *get_mode_c();
-ir_mode *get_mode_C();
-ir_mode *get_mode_h();
-ir_mode *get_mode_H();
-ir_mode *get_mode_i();
-ir_mode *get_mode_I();
-ir_mode *get_mode_l();
-ir_mode *get_mode_L();
-ir_mode *get_mode_B();
-ir_mode *get_mode_p();
-ir_mode *get_mode_b();
-ir_mode *get_mode_s();
-ir_mode *get_mode_S();
-ir_mode *get_mode_X();
-ir_mode *get_mode_M();
-ir_mode *get_mode_R();
-ir_mode *get_mode_Z();
+ir_mode *get_modeT();
+ir_mode *get_modef();
+ir_mode *get_moded();
+ir_mode *get_modec();
+ir_mode *get_modeC();
+ir_mode *get_modeh();
+ir_mode *get_modeH();
+ir_mode *get_modei();
+ir_mode *get_modeI();
+ir_mode *get_model();
+ir_mode *get_modeL();
+ir_mode *get_modeB();
+ir_mode *get_modep();
+ir_mode *get_modeb();
+ir_mode *get_modes();
+ir_mode *get_modeS();
+ir_mode *get_modeX();
+ir_mode *get_modeM();
+ir_mode *get_modeR();
+ir_mode *get_modeZ();
 
 /* An enum for this mode */
 modecode get_mode_modecode (ir_mode *mode);
index 04725b6..23029eb 100644 (file)
@@ -864,11 +864,11 @@ get_SymConst_type (ir_node *node) {
 }
 
 INLINE void
-set_SymConst_type (ir_node *node, type *type) {
+set_SymConst_type (ir_node *node, type *tp) {
   assert (   (node->op == op_SymConst)
           && (   get_SymConst_kind(node) == type_tag
               || get_SymConst_kind(node) == size));
-  node->attr.i.tori.typ = type;
+  node->attr.i.tori.typ = tp;
 }
 
 INLINE ident *
@@ -1073,10 +1073,10 @@ get_Call_type (ir_node *node) {
 }
 
 INLINE void
-set_Call_type (ir_node *node, type *type) {
+set_Call_type (ir_node *node, type *tp) {
   assert (node->op == op_Call);
-  assert (is_method_type(type));
-  node->attr.call.cld_tp = type;
+  assert (is_method_type(tp));
+  node->attr.call.cld_tp = tp;
 }
 
 int get_Call_n_callees(ir_node * node) {
@@ -1918,9 +1918,9 @@ get_Alloc_type (ir_node *node) {
 }
 
 INLINE void
-set_Alloc_type (ir_node *node, type *type) {
+set_Alloc_type (ir_node *node, type *tp) {
   assert (node->op == op_Alloc);
-  node->attr.a.type = type;
+  node->attr.a.type = tp;
 }
 
 INLINE where_alloc
@@ -1979,9 +1979,9 @@ get_Free_type (ir_node *node) {
 }
 
 INLINE void
-set_Free_type (ir_node *node, type *type) {
+set_Free_type (ir_node *node, type *tp) {
   assert (node->op == op_Free);
-  node->attr.f = type;
+  node->attr.f = tp;
 }
 
 INLINE ir_node **
index 0f28ec3..8acc33e 100644 (file)
@@ -13,7 +13,7 @@
 
 # include "irgraph.h"
 # include "entity.h"
-# include "common.h"
+# include "firm_common.h"
 # include "irop.h"
 # include "irmode.h"
 # include "tv.h"
@@ -172,20 +172,6 @@ ir_node * get_Block_cg_cfgpred(ir_node * node, int pos);
 /* frees the memory. */
 void remove_Block_cg_cfgpred_arr(ir_node * node);
 
-/* exc handling @@@ ajacs specific -- not supported */
-void     set_Block_exc     (ir_node*, exc_t);
-exc_t    get_Block_exc     (ir_node*);
-
-void     set_Node_exc      (ir_node*, exc_t);
-exc_t    get_Node_exc      (ir_node*);
-
-/* handler handling  @@@ ajacs specific -- not supported  */
-void     set_Block_handler (ir_node*, ir_node*);
-ir_node* get_Block_handler (ir_node*);
-
-void     set_Node_handler  (ir_node*, ir_node*);
-ir_node* get_Node_handler  (ir_node*);
-
 INLINE int  get_End_n_keepalives(ir_node *end);
 INLINE ir_node *get_End_keepalive(ir_node *end, int pos);
 INLINE void add_End_keepalive (ir_node *end, ir_node *ka);
@@ -261,7 +247,7 @@ INLINE symconst_kind get_SymConst_kind (ir_node *node);
 INLINE void          set_SymConst_kind (ir_node *node, symconst_kind num);
 /* Only to access SymConst of kind type_tag or size.  Else assertion: */
 INLINE type    *get_SymConst_type (ir_node *node);
-INLINE void     set_SymConst_type (ir_node *node, type *type);
+INLINE void     set_SymConst_type (ir_node *node, type *tp);
 /* Only to access SymConst of kind linkage_ptr_info.  Else assertion: */
 INLINE ident   *get_SymConst_ptrinfo (ir_node *node);
 INLINE void     set_SymConst_ptrinfo (ir_node *node, ident *ptrinfo);
@@ -282,12 +268,12 @@ INLINE entity  *get_Sel_entity (ir_node *node); /* entity to select */
 INLINE void     set_Sel_entity (ir_node *node, entity *ent);
 
 /* @@@ ajacs specific node -- not supported */
-type           *get_InstOf_ent   (ir_node*);
-void            set_InstOf_ent   (ir_node*, type*);
-ir_node        *get_InstOf_obj   (ir_node*);
-void            set_InstOf_obj   (ir_node*, ir_node*);
-ir_node        *get_InstOf_store (ir_node*);
-void            set_InstOf_store (ir_node*, ir_node*);
+type           *get_InstOf_ent   (ir_node *node);
+void            set_InstOf_ent   (ir_node *node, type *ent);
+ir_node        *get_InstOf_obj   (ir_node *node);
+void            set_InstOf_obj   (ir_node *node, ir_node *obj);
+ir_node        *get_InstOf_store (ir_node *node);
+void            set_InstOf_store (ir_node *node, ir_node *obj);
 
 INLINE ir_node *get_Call_mem (ir_node *node);
 INLINE void     set_Call_mem (ir_node *node, ir_node *mem);
@@ -298,7 +284,7 @@ INLINE int      get_Call_n_params (ir_node *node);
 INLINE ir_node *get_Call_param (ir_node *node, int pos);
 INLINE void     set_Call_param (ir_node *node, int pos, ir_node *param);
 INLINE type    *get_Call_type (ir_node *node);
-INLINE void     set_Call_type (ir_node *node, type *type);
+INLINE void     set_Call_type (ir_node *node, type *tp);
 INLINE int      get_Call_arity (ir_node *node);
 
 /* Set, get and remove the callee-analysis. */
@@ -412,9 +398,10 @@ typedef enum {
   Ug,                  /* unordered or greater */
   Uge,                 /* unordered, greater or equal */
   Ne,                  /* unordered, less or greater = not equal */
-  True,                        /* true */
-  not_mask = Leg       /* bits to flip to negate comparison */
+  True                 /* true */
+  /* not_mask = Leg    /* bits to flip to negate comparison * @@ hack for jni interface */
 } pnc_number;
+#define not_mask Leg
 INLINE char *get_pnc_string(int pnc);
 INLINE int   get_negated_pnc(int pnc);
 INLINE ir_node *get_Cmp_left (ir_node *node);
@@ -478,7 +465,7 @@ INLINE void     set_Alloc_mem (ir_node *node, ir_node *mem);
 INLINE ir_node *get_Alloc_size (ir_node *node);
 INLINE void     set_Alloc_size (ir_node *node, ir_node *size);
 INLINE type    *get_Alloc_type (ir_node *node);
-INLINE void     set_Alloc_type (ir_node *node, type *type);
+INLINE void     set_Alloc_type (ir_node *node, type *tp);
 typedef enum {
   stack_alloc,          /* Alloc allocates the object on the stack. */
   heap_alloc            /* Alloc allocates the object on the heap. */
@@ -493,7 +480,7 @@ INLINE void     set_Free_ptr (ir_node *node, ir_node *ptr);
 INLINE ir_node *get_Free_size (ir_node *node);
 INLINE void     set_Free_size (ir_node *node, ir_node *size);
 INLINE type    *get_Free_type (ir_node *node);
-INLINE void     set_Free_type (ir_node *node, type *type);
+INLINE void     set_Free_type (ir_node *node, type *tp);
 
 INLINE ir_node **get_Sync_preds_arr (ir_node *node);
 INLINE int       get_Sync_n_preds (ir_node *node);
@@ -563,29 +550,17 @@ ir_node *get_fragile_op_mem(ir_node *node);
 #include "ident.h"
 
 #define DDMSG        printf("%s(l.%i)\n", __FUNCTION__, __LINE__)
-#define DDMSG1(X)    printf("%s(l.%i) %s\n", __FUNCTION__, __LINE__,         \
-                            id_to_str(get_irn_opident(X)))
-#define DDMSG2(X)    printf("%s(l.%i) %s%s: %ld\n", __FUNCTION__, __LINE__,          \
-                     id_to_str(get_irn_opident(X)), id_to_str(get_irn_modeident(X)), \
-                     get_irn_node_nr(X))
-#define DDMSG3(X)    printf("%s(l.%i) %s: %p\n", __FUNCTION__, __LINE__,     \
-                     print_firm_kind(X), (X))
-#define DDMSG4(X)    xprintf("%s(l.%i) %I %I: %p\n", __FUNCTION__, __LINE__,     \
-                     get_type_tpop_nameid(X), get_type_ident(X), (X))
-#define DDMSG5(X)    printf("%s%s: %ld",          \
-                     id_to_str(get_irn_opident(X)), id_to_str(get_irn_modeident(X)), \
-                     get_irn_node_nr(X))
-
-
-#define DDMN(X)      xprintf("%s(l.%i) %I%I: %ld (%p)\n", __FUNCTION__, __LINE__,      \
-                     get_irn_opident(X), get_irn_modeident(X), get_irn_node_nr(X), (X))
-#define DDMNB(X)     xprintf("%I%I: %ld (in block %ld)\n",                             \
-                    get_irn_opident(X), get_irn_modeident(X), get_irn_node_nr(X),     \
-                    get_irn_node_nr(get_nodes_Block(X)))
-#define DDMT(X)      xprintf("%s(l.%i) %I %I: %p\n", __FUNCTION__, __LINE__,           \
-                     get_type_tpop_nameid(X), get_type_ident(X), (X))
-#define DDME(X)      xprintf("%s(l.%i) %I: %p\n", __FUNCTION__, __LINE__,              \
-                     get_entity_ident(X), (X))
+#define DDMSG1(X)    printf("%s(l.%i) %s\n", __FUNCTION__, __LINE__, id_to_str(get_irn_opident(X)))
+#define DDMSG2(X)    printf("%s(l.%i) %s%s: %ld\n", __FUNCTION__, __LINE__, id_to_str(get_irn_opident(X)), id_to_str(get_irn_modeident(X)), get_irn_node_nr(X))
+#define DDMSG3(X)    printf("%s(l.%i) %s: %p\n", __FUNCTION__, __LINE__, print_firm_kind(X), (X))
+#define DDMSG4(X)    xprintf("%s(l.%i) %I %I: %p\n", __FUNCTION__, __LINE__, get_type_tpop_nameid(X), get_type_ident(X), (X))
+#define DDMSG5(X)    printf("%s%s: %ld", id_to_str(get_irn_opident(X)), id_to_str(get_irn_modeident(X)), get_irn_node_nr(X))
+
+
+#define DDMN(X)      xprintf("%s(l.%i) %I%I: %ld (%p)\n", __FUNCTION__, __LINE__, get_irn_opident(X), get_irn_modeident(X), get_irn_node_nr(X), (X))
+#define DDMNB(X)     xprintf("%I%I: %ld (in block %ld)\n", get_irn_opident(X), get_irn_modeident(X), get_irn_node_nr(X), get_irn_node_nr(get_nodes_Block(X)))
+#define DDMT(X)      xprintf("%s(l.%i) %I %I: %p\n", __FUNCTION__, __LINE__, get_type_tpop_nameid(X), get_type_ident(X), (X))
+#define DDME(X)      xprintf("%s(l.%i) %I: %p\n", __FUNCTION__, __LINE__, get_entity_ident(X), (X))
 
 
 # endif /* _IRNODE_H_ */
index 837bdfa..d8fe574 100644 (file)
@@ -14,7 +14,7 @@
 # include "irnode.h"
 # include "xprintf.h"
 # include "irop_t.h"
-# include "common_t.h"
+# include "firm_common_t.h"
 # include "irdom_t.h" /* For size of struct dom_info. */
 # include "dbginfo.h"
 
index ca2cb76..3d9b44d 100644 (file)
@@ -5,7 +5,7 @@
 # define _IRPROG_T_H_
 
 #include "irprog.h"
-#include "common_t.h"
+#include "firm_common_t.h"
 
 struct ir_prog {
   firm_kind kind;
index df13b7b..5d58fc2 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright (c) 2002 by Universität Karlsruhe (TH).  All Rights Reserved */
 /*
-** Time-stamp: <Friday, 05.07.2002, 11:09:07 goetz@i44pc2.info.uni-karlsruhe.de>
+** Time-stamp: <Monday, 04.11.2002, 17:28:27 goetz@i44pc2.info.uni-karlsruhe.de>
 */
 
 /***
@@ -115,7 +115,7 @@ bool is_handler_entry (ir_graph *graph, ir_node *block)
 
   if (exc_invalid == get_Block_exc (block))
        {
-         for (i = 0; (i < n) && is_entry; i ++)
+         for (i = 0; (i < n) && (is_entry == true); i ++)
                if (is_exc_jmp (get_irn_n (block, i)))
                  continue;
                else
@@ -145,7 +145,7 @@ bool is_region_entry  (ir_graph *graph, ir_node *block)
 
          bool no_handler = true;
 
-         for (i = 0; (i < n) && no_handler; i ++)
+         for (i = 0; (i < n) && (no_handler == true); i ++)
                {
                  succ = get_irn_out (block, i);
 
@@ -159,7 +159,7 @@ bool is_region_entry  (ir_graph *graph, ir_node *block)
 
   return (exc_region == get_Block_exc (block));
 
-  return (TRUE);
+  return (true);
 }
 
 /*
@@ -181,7 +181,7 @@ bool is_handler_block (ir_graph *graph, ir_node *block)
          int n_blocks    = env->dt->n_blocks;
          int i           = 0;
 
-         for (i = 0; (i < n_blocks) && no_handler; i ++)
+         for (i = 0; (i < n_blocks) && (no_handler == true); i ++)
                if (0 != (env->dt->masks [i] & block_mask)) /* if dominator */
                  if (is_handler_entry (graph, env->dt->blocks [i])) /* is handler entry */
                        no_handler = false;
index 9ab6910..552f0be 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright (c) 2002 by Universität Karlsruhe (TH).  All Rights Reserved */
 /*
-** Time-stamp: <Friday, 26.07.2002 15:43:30h liekweg@i44pc11.info.uni-karlsruhe.de>
+** Time-stamp: <Monday, 04.11.2002, 17:32:28 goetz@i44pc2.info.uni-karlsruhe.de>
 */
 
 /***
@@ -25,7 +25,7 @@
 # include "irop.h"
 # include "irouts.h"
 
-# include <bool.h>
+#include "bool.h"
 
 typedef enum {
   exc_invalid = 0,                                     /* not yet computed */
@@ -50,5 +50,17 @@ bool is_region_entry  (ir_graph*, ir_node*);
 bool is_handler_block (ir_graph*, ir_node*);
 bool is_cont_entry    (ir_graph*, ir_node*);
 
+void     set_Block_exc     (ir_node*, exc_t);
+exc_t    get_Block_exc     (ir_node*);
+
+void     set_Node_exc      (ir_node*, exc_t);
+exc_t    get_Node_exc      (ir_node*);
+
+/* handler handling  @@@ ajacs specific -- not supported  */
+void     set_Block_handler (ir_node*, ir_node*);
+ir_node* get_Block_handler (ir_node*);
+
+void     set_Node_handler  (ir_node*, ir_node*);
+ir_node* get_Node_handler  (ir_node*);
 
 # endif /* def _EXC_H_ */
index d9df53f..7f3e8e6 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright (c) 2002 by Universität Karlsruhe (TH).  All Rights Reserved */
 /*
-** Time-stamp: <Friday, 05.07.2002, 11:06:38 goetz@i44pc2.info.uni-karlsruhe.de>
+** Time-stamp: <Thursday, 31.10.2002, 16:03:00 goetz@i44pc2.info.uni-karlsruhe.de>
 */
 
 /***
@@ -326,7 +326,7 @@ static void update_dominators (ir_node *block, void *env)
 
   if (new_mask != old_mask)
        {
-         w->changed = TRUE;
+         w->changed = true;
          _set_mask (dt, block_index, new_mask);
 
 # ifdef VERBOSE_libfirm
@@ -505,7 +505,7 @@ void build_dominator_tree (ir_graph *graph)
 
   w->dt          = dt;
   w->start_block = start_block;
-  w->changed     = TRUE;       /* at least one walk */
+  w->changed     = true;       /* at least one walk */
 
   /* do the walk: */
   {
@@ -513,7 +513,7 @@ void build_dominator_tree (ir_graph *graph)
 
        while (w->changed)
          {
-               w->changed = FALSE;
+               w->changed = false;
                irg_block_walk (end_block, update_dominators, update_dominators, (void*) w);
                walks ++;
          }
index 28b00b2..9e11d05 100644 (file)
@@ -552,16 +552,16 @@ bool equal_entity(entity *ent1, entity *ent2) {
 }
 
 
-unsigned long get_entity_visited(entity *entity) {
-  assert (entity);
-  return entity->visit;
+unsigned long get_entity_visited(entity *ent) {
+  assert (ent);
+  return ent->visit;
 }
-void        set_entity_visited(entity *entity, unsigned long num) {
-  assert (entity);
-  entity->visit = num;
+void        set_entity_visited(entity *ent, unsigned long num) {
+  assert (ent);
+  ent->visit = num;
 }
 /* Sets visited field in entity to entity_visited. */
-void        mark_entity_visited(entity *entity) {
-  assert (entity);
-  entity->visit = type_visited;
+void        mark_entity_visited(entity *ent) {
+  assert (ent);
+  ent->visit = type_visited;
 }
index 3627784..e6c2cd2 100644 (file)
@@ -63,9 +63,9 @@ void init_entity (void);
 /** ENTITY                                                        **/
 /*******************************************************************/
 
+/* to resolve recursion between entity.h and irgraph.h */
 #ifndef _IR_GRAPH_TYPEDEF_
 #define _IR_GRAPH_TYPEDEF_
-/* to resolve recursion between entity.h and irgraph.h */
 typedef struct ir_graph ir_graph;
 #endif
 
@@ -113,9 +113,9 @@ typedef struct ir_graph ir_graph;
  * SOURCE
  */
 
+/* to resolve recursion between entity.h and type.h */
 #ifndef _ENTITY_TYPEDEF_
 #define _ENTITY_TYPEDEF_
-/* to resolve recursion between entity.h and type.h */
 typedef struct entity entity;
 #endif
 
@@ -298,10 +298,10 @@ int is_compound_entity(entity *ent);
 bool equal_entity(entity *ent1, entity *ent2);
 
 
-unsigned long get_entity_visited(entity *entity);
-void        set_entity_visited(entity *entity, unsigned long num);
+unsigned long get_entity_visited(entity *ent);
+void        set_entity_visited(entity *ent, unsigned long num);
 /* Sets visited field in entity to entity_visited. */
-void        mark_entity_visited(entity *entity);
+void        mark_entity_visited(entity *ent);
 
 
 /*****/
index 17c43ef..0a8bfbe 100644 (file)
 
 # include "entity.h"
 
-#ifndef _IR_GRAPH_TYPEDEF_
-#define _IR_GRAPH_TYPEDEF_
-/* to resolve recursion between entity.h and irgraph.h */
-typedef struct ir_graph ir_graph;
-#endif
-
 struct entity {
   firm_kind kind;
   ident *name;          /* name of this entity */
index d1210db..bc903d6 100644 (file)
@@ -43,16 +43,16 @@ mangle_entity (entity *ent)
 }
 
 ident *
-mangle_type (type *type)
+mangle_type (type *tp)
 {
   char *cp;
   int len;
   ident *res;
 
-  assert (type->kind == k_type);
-  /* assert (type->type_op->code == tpo_class); */
+  assert (tp->kind == k_type);
+  /* assert (tp->type_op->code == tpo_class); */
 
-  xoprintf (&mangle_obst, "%I", type->name);
+  xoprintf (&mangle_obst, "%I", tp->name);
   len = obstack_object_size (&mangle_obst);
   cp = obstack_finish (&mangle_obst);
   res = id_from_str (cp, len);
index 72098a9..189e6fb 100644 (file)
@@ -20,7 +20,7 @@ void init_mangle (void);
 ident *mangle_entity (entity *ent);
 
 /* Sorry, I'm not sure what this does... seems to copy the string. */
-ident *mangle_type   (type *type);
+ident *mangle_type   (type *tp);
 
 /* mangle underscore: Returns a new ident that represents first_scnd. */
 ident *mangle_u (ident *first, ident* scnd);
index 84094ff..3088528 100644 (file)
@@ -793,10 +793,10 @@ type *get_method_param_type(type *method, int pos) {
   assert(pos >= 0 && pos < get_method_n_params(method));
   return method->attr.ma.param_type[pos] = skip_tid(method->attr.ma.param_type[pos]);
 }
-void  set_method_param_type(type *method, int pos, type* type) {
+void  set_method_param_type(type *method, int pos, type* tp) {
   assert(method && (method->type_op == type_method));
   assert(pos >= 0 && pos < get_method_n_params(method));
-  method->attr.ma.param_type[pos] = type;
+  method->attr.ma.param_type[pos] = tp;
 }
 
 int   get_method_n_ress   (type *method) {
@@ -808,10 +808,10 @@ type *get_method_res_type(type *method, int pos) {
   assert(pos >= 0 && pos < get_method_n_ress(method));
   return method->attr.ma.res_type[pos] = skip_tid(method->attr.ma.res_type[pos]);
 }
-void  set_method_res_type(type *method, int pos, type* type) {
+void  set_method_res_type(type *method, int pos, type* tp) {
   assert(method && (method->type_op == type_method));
   assert(pos >= 0 && pos < get_method_n_ress(method));
-  method->attr.ma.res_type[pos] = type;
+  method->attr.ma.res_type[pos] = tp;
 }
 
 /* typecheck */
@@ -854,10 +854,10 @@ type  *get_union_unioned_type (type *uni, int pos) {
   assert(pos >= 0 && pos < get_union_n_types(uni));
   return uni->attr.ua.unioned_type[pos] = skip_tid(uni->attr.ua.unioned_type[pos]);
 }
-void   set_union_unioned_type (type *uni, int pos, type *type) {
+void   set_union_unioned_type (type *uni, int pos, type *tp) {
   assert(uni && (uni->type_op == type_union));
   assert(pos >= 0 && pos < get_union_n_types(uni));
-  uni->attr.ua.unioned_type[pos] = type;
+  uni->attr.ua.unioned_type[pos] = tp;
 }
 ident *get_union_delim_nameid (type *uni, int pos) {
   assert(uni && (uni->type_op == type_union));
@@ -1015,10 +1015,10 @@ int  get_array_order (type *array, int dimension) {
   return array->attr.aa.order[dimension];
 }
 
-void  set_array_element_type (type *array, type *type) {
+void  set_array_element_type (type *array, type *tp) {
   assert(array && (array->type_op == type_array));
-  assert(!is_method_type(type));
-  array->attr.aa.element_type = type;
+  assert(!is_method_type(tp));
+  array->attr.aa.element_type = tp;
 }
 type *get_array_element_type (type *array) {
   assert(array && (array->type_op == type_array));
@@ -1131,9 +1131,9 @@ INLINE void free_pointer_attrs (type *pointer) {
   assert(pointer && (pointer->type_op == type_pointer));
 }
 /* manipulate fields of type_pointer */
-void  set_pointer_points_to_type (type *pointer, type *type) {
+void  set_pointer_points_to_type (type *pointer, type *tp) {
   assert(pointer && (pointer->type_op == type_pointer));
-  pointer->attr.pa.points_to = type;
+  pointer->attr.pa.points_to = tp;
 }
 type *get_pointer_points_to_type (type *pointer) {
   assert(pointer && (pointer->type_op == type_pointer));
index 4ed128c..8d4f8f7 100644 (file)
 # define _TYPE_H_
 
 # include "tpop.h"
-# include "common.h"
+# include "firm_common.h"
 # include "ident.h"
 # include "irmode.h"
 # include "bool.h"
 # include "dbginfo.h"
 
 
+/* to resolve recursion between entity.h and type.h */
 #ifndef _ENTITY_TYPEDEF_
 #define _ENTITY_TYPEDEF_
-/* to resolve recursion between entity.h and type.h */
 typedef struct entity entity;
 #endif
 
@@ -385,8 +385,8 @@ INLINE void        set_class_peculiarity (type *clss, peculiarity pec);
 
 /* Set and get a class' dfn --
    @@@ This is an undocumented field, subject to change! */
-void set_class_dfn (type*, int);
-int  get_class_dfn (type*);
+void set_class_dfn (type *clss, int dfn);
+int  get_class_dfn (type *clss);
 
 /* typecheck */
 bool is_class_type(type *clss);
@@ -465,11 +465,11 @@ type *new_d_type_method (ident *name, int n_param, int n_res, dbg_info* db);
 /* manipulate private fields of method. */
 int   get_method_n_params  (type *method);
 type *get_method_param_type(type *method, int pos);
-void  set_method_param_type(type *method, int pos, type* type);
+void  set_method_param_type(type *method, int pos, type* tp);
 
 int   get_method_n_ress   (type *method);
 type *get_method_res_type(type *method, int pos);
-void  set_method_res_type(type *method, int pos, type* type);
+void  set_method_res_type(type *method, int pos, type* tp);
 
 /* typecheck */
 bool  is_method_type     (type *method);
@@ -549,7 +549,7 @@ ir_node * get_array_upper_bound  (type *array, int dimension);
 void set_array_order (type *array, int dimension, int order);
 int  get_array_order (type *array, int dimension);
 
-void  set_array_element_type (type *array, type *type);
+void  set_array_element_type (type *array, type *tp);
 type *get_array_element_type (type *array);
 
 void  set_array_element_entity (type *array, entity *ent);
@@ -606,7 +606,7 @@ type *new_type_pointer           (ident *name, type *points_to);
 type *new_d_type_pointer           (ident *name, type *points_to, dbg_info* db);
 
 /* manipulate fields of type_pointer */
-void  set_pointer_points_to_type (type *pointer, type *type);
+void  set_pointer_points_to_type (type *pointer, type *tp);
 type *get_pointer_points_to_type (type *pointer);
 
 /* typecheck */
index dafea61..e9e1ebf 100644 (file)
 # include "type_or_entity.h"
 
 
+typedef void (type_walk_func)(type_or_ent *, void *);
+
 /** Walks over all type information reachable from global roots.
     Touches every type and entity in unspecified order.  If new
     types/entities are created during the traversal these will
     be visited, too. **/
-void type_walk(void (pre)(type_or_ent*, void*),
-              void (post)(type_or_ent*, void*),
+void type_walk(type_walk_func *pre,
+              type_walk_func *post,
               void *env);
 
 /** walks over all type information reachable from irg **/
 void type_walk_irg(ir_graph *irg,
-                  void (pre)(type_or_ent*, void*),
-                  void (post)(type_or_ent*, void*),
+                  type_walk_func *pre,
+                  type_walk_func *post,
                   void *env);
 
 /** Walks over all type information reachable from global roots.
@@ -43,8 +45,8 @@ void type_walk_irg(ir_graph *irg,
     during the traversal these will be visited, too. **/
 /** @@@ should be named class-walk **/
 /*  @@@ will be removed? */
-void type_walk_super2sub(void (pre)(type_or_ent*, void*),
-                        void (post)(type_or_ent*, void*),
+void type_walk_super2sub(type_walk_func *pre,
+                        type_walk_func *post,
                         void *env);
 
 /** Walks over all type information reachable from global roots.
@@ -53,8 +55,8 @@ void type_walk_super2sub(void (pre)(type_or_ent*, void*),
     - second the class itself
     If new classes are created during the traversal these
     will be visited, too. **/
-void type_walk_super(void (pre)(type_or_ent*, void*),
-                    void (post)(type_or_ent*, void*),
+void type_walk_super(type_walk_func *pre,
+                    type_walk_func *post,
                     void *env);
 
 /* Same as type_walk_super2sub, but visits only class types.
@@ -64,13 +66,14 @@ void type_walk_super(void (pre)(type_or_ent*, void*),
    Does not visit global type, frame types.
 */
 /* @@@ ?? something is wrong with this. */
-void class_walk_super2sub(void (pre)(type*, void*),
-                         void (post)(type*, void*),
+void class_walk_super2sub(type_walk_func *pre,
+                         type_walk_func *post,
                          void *env);
 
 
 /* Walks over all entities in the type */
+typedef void (entity_walk_func)(entity *, void *);
 void walk_types_entities(type *tp,
-                        void (doit)(entity*, void*),
+                        entity_walk_func *doit,
                         void *env);
 #endif /* _TYPEWALK_H_ */
index d7c434b..20887a1 100644 (file)
@@ -51,15 +51,12 @@ Discussion of new interface, proposals by Prof. Waite:
 typedef struct tarval tarval;
 #endif
 
-#include "gmp.h"
-#undef __need_size_t           /* erroneously defined by 1.3.2's gmp.h */
-
 /* how to represent target types on host */
 typedef float  tarval_f;
 typedef double tarval_d;
 typedef long   tarval_chil;
 typedef unsigned long tarval_CHIL;
-typedef MP_INT tarval_Z;
+typedef int tarval_Z;   /* Do not use!!! */
 typedef struct {
   /* if ent then xname is missing or mangled from ent,
      else if xname then xname is a linker symbol that is not mangled
@@ -83,7 +80,7 @@ struct tarval {
     tarval_d d;                        /* double */
     tarval_chil chil;          /* signed integral */
     tarval_CHIL CHIL;          /* unsigned integral */
-    tarval_Z Z;                 /* universal int */
+    tarval_Z Z;                 /* @@@ Do not use!!! universal int */
     tarval_p p;                        /* pointer */
     bool b;                    /* boolean */
     tarval_B B;                        /* universal bits */
@@ -92,6 +89,7 @@ struct tarval {
   ir_mode *mode;
 };
 
+
 extern tarval *tarval_bad;                  tarval *get_tarval_bad();
 /* We should have a tarval_undefined */
 extern tarval *tarval_b_false;              tarval *get_tarval_b_false  ();
@@ -107,34 +105,27 @@ extern tarval *tarval_mode_max[];           tarval *get_tarval_mode_max (ir_mode
 void tarval_init_1 (void);
 void tarval_init_2 (void);
 
-/* Hash function on tarvals */
-unsigned tarval_hash (tarval *);
-
 /* ************************ Constructors for tarvals ************************ */
-tarval *tarval_Z_from_str (const char *, size_t, int base);
-tarval *tarval_B_from_str (const char *, size_t);
-tarval *tarval_f_from_str (const char *, size_t);
-tarval *tarval_d_from_str (const char *, size_t);
-tarval *tarval_s_from_str (const char *, size_t);
-tarval *tarval_S_from_str (const char *, size_t);
-tarval *tarval_int_from_str (const char *, size_t, int base, ir_mode *m);
-tarval *tarval_from_long  (ir_mode *, long);
-
-tarval *tarval_p_from_str (const char *);
+/*tarval *tarval_Z_from_str (const char *s, size_t len, int base);*/
+tarval *tarval_f_from_str (const char *s, size_t len);
+tarval *tarval_d_from_str (const char *s, size_t len);
+tarval *tarval_int_from_str (const char *s, size_t len, int base, ir_mode *m);
+tarval *tarval_from_long  (ir_mode *m, long val);
+
+tarval *tarval_p_from_str (const char *xname);
 /* The tarval represents the address of the entity.  As the address must
    be constant the entity must have as owner the global type. */
-tarval *tarval_p_from_entity (entity *);
+tarval *tarval_p_from_entity (entity *ent);
 
-tarval *tarval_convert_to (tarval *, ir_mode *);
+tarval *tarval_convert_to (tarval *src, ir_mode *m);
 
 /* Building an irm_C, irm_s, irm_S or irm_B target value step by step. */
 void tarval_start (void);
-void tarval_append (const char *, size_t);
-void tarval_append1 (char);
-tarval *tarval_finish_as (ir_mode *);
+void tarval_append (const char *p, size_t n);
+void tarval_append1 (char ch);
+tarval *tarval_finish_as (ir_mode *m);
 tarval *tarval_cancel (void); /* returns tarval_bad */
 
-\f
 /* The flags for projecting a comparison result */
 typedef enum {
   irpn_False=0,                /* 0000 false */
@@ -152,9 +143,10 @@ typedef enum {
   irpn_Ug,             /* 1100 unordered or greater */
   irpn_Uge,            /* 1101 unordered, greater or equal */
   irpn_Ne,             /* 1110 unordered, less or greater = not equal */
-  irpn_True,           /* 1111 true */
-  irpn_notmask = irpn_Leg
+  irpn_True            /* 1111 true */
+  /*irpn_notmask = irpn_Leg  @@@ removed for JNI builder */
 } ir_pncmp;
+#define irpn_notmask irpn_Leg
 
 /* ******************** Arithmethic operations on tarvals ******************** */
 /* Compare a with b and return an ir_pncmp describing the relation
@@ -163,37 +155,36 @@ typedef enum {
 ir_pncmp tarval_comp (tarval *a, tarval *b);
 
 tarval *tarval_neg (tarval *a);
-tarval *tarval_add (tarval *, tarval *);
-tarval *tarval_sub (tarval *, tarval *);
-tarval *tarval_mul (tarval *, tarval *);
-tarval *tarval_quo (tarval *, tarval *);
-tarval *tarval_div (tarval *, tarval *);
-tarval *tarval_mod (tarval *, tarval *);
-tarval *tarval_abs (tarval *);
-tarval *tarval_and (tarval *, tarval *);
-tarval *tarval_or  (tarval *, tarval *);
-tarval *tarval_eor (tarval *, tarval *);
-tarval *tarval_shl (tarval *, tarval *);
-tarval *tarval_shr (tarval *, tarval *);
+tarval *tarval_add (tarval *a, tarval *b);
+tarval *tarval_sub (tarval *a, tarval *b);
+tarval *tarval_mul (tarval *a, tarval *b);
+tarval *tarval_quo (tarval *a, tarval *b);
+tarval *tarval_div (tarval *a, tarval *b);
+tarval *tarval_mod (tarval *a, tarval *b);
+tarval *tarval_abs (tarval *a);
+tarval *tarval_and (tarval *a, tarval *b);
+tarval *tarval_or  (tarval *a, tarval *b);
+tarval *tarval_eor (tarval *a, tarval *b);
+tarval *tarval_shl (tarval *a, tarval *b);
+tarval *tarval_shr (tarval *a, tarval *b);
 
 /* Identifying some tarvals */
-long tarval_classify (tarval *);
-long tarval_ord (tarval *, int *fail);
-
-/* moved to tv_t.h
-   int tarval_print (XP_PAR1, const xprintf_info *, XP_PARN); */
+long tarval_classify (tarval *tv);
+long tarval_ord (tarval *tv, int *fail);
 
 /* return a mode-specific value */
-
 tarval_f tv_val_f (tarval *tv);
 tarval_d tv_val_d (tarval *tv);
 tarval_chil tv_val_chil (tarval *tv);
 tarval_CHIL tv_val_CHIL (tarval *tv);
-tarval_Z tv_val_Z (tarval *tv);
-tarval_p tv_val_p (tarval *tv);
+/*tarval_Z tv_val_Z (tarval *tv);*/
+/* @@@ temporarily removed.
+   jni builder can not deal with the return value.
+   All definitions of types are interpreted as pointer values until
+   type analysis exists for crecoder.
+   tarval_p tv_val_p (tarval *tv);
+*/;
 bool     tv_val_b (tarval *tv);
-tarval_B tv_val_B (tarval *tv);
-tarval_s tv_val_s (tarval *tv);
 
 ir_mode *get_tv_mode (tarval *tv);
 /* Returns the entity if the tv is a pointer to an entity, else
index 4c3dc50..658bf9c 100644 (file)
@@ -9,8 +9,22 @@
 # include "tv.h"
 # include "misc.h"
 
+#include "gmp.h"
+#undef __need_size_t           /* erroneously defined by 1.3.2's gmp.h */
+
+
+tarval *tarval_S_from_str (const char *s, size_t len);
+tarval *tarval_s_from_str (const char *s, size_t len);
+tarval *tarval_B_from_str (const char *s, size_t len);
+tarval_B tv_val_B (tarval *tv);
+tarval_s tv_val_s (tarval *tv);
+
+
 int tarval_print (XP_PAR1, const xprintf_info *, XP_PARN);
 
+/* Hash function on tarvals */
+unsigned tarval_hash (tarval *);
+
 
 #ifdef NDEBUG
 #define TARVAL_VRFY(val) ((void)0)