rewritten
authorFlorian Liekweg <liekweg@ipd.info.uni-karlsruhe.de>
Thu, 18 Nov 2004 16:37:34 +0000 (16:37 +0000)
committerFlorian Liekweg <liekweg@ipd.info.uni-karlsruhe.de>
Thu, 18 Nov 2004 16:37:34 +0000 (16:37 +0000)
[r4429]

ir/ana2/pto_comp.c [new file with mode: 0644]
ir/ana2/pto_comp.h [new file with mode: 0644]
ir/ana2/pto_ctx.c [new file with mode: 0644]
ir/ana2/pto_ctx.h [new file with mode: 0644]
ir/ana2/pto_debug.c [new file with mode: 0644]
ir/ana2/pto_debug.h [new file with mode: 0644]
ir/ana2/pto_name.c [new file with mode: 0644]
ir/ana2/pto_name.h [new file with mode: 0644]

diff --git a/ir/ana2/pto_comp.c b/ir/ana2/pto_comp.c
new file mode 100644 (file)
index 0000000..b9b68e1
--- /dev/null
@@ -0,0 +1,476 @@
+/* -*- c -*- */
+
+/*
+   Project:     libFIRM
+   File name:   ir/ana/pto_comp.c
+   Purpose:     Main Implementation of PTO
+   Author:      Florian
+   Modified by:
+   Created:     Sat Nov 13 19:35:27 CET 2004
+   CVS-ID:      $Id$
+   Copyright:   (c) 1999-2004 Universität Karlsruhe
+   Licence:     This file is protected by the GPL -  GNU GENERAL PUBLIC LICENSE.
+*/
+
+# ifdef HAVE_CONFIG_H
+#  include <config.h>
+# endif
+
+/*
+  pto_comp: Main Implementation of PTO
+*/
+
+# include <string.h>            /* for memset */
+
+# include "pto_comp.h"
+# include "pto_util.h"
+# include "pto_ctx.h"
+
+# include "irnode.h"
+# include "irprog.h"
+# include "xmalloc.h"
+# include "irmemwalk.h"
+
+# include "pto_debug.h"
+# include "pto_init.h"
+
+# include "ecg.h"
+
+/* Local Defines: */
+
+/* Local Data Types: */
+typedef struct pto_env_str {
+  int dummy;
+} pto_env_t;
+
+
+/* Local Variables: */
+
+/* Debug only: */
+char *spaces = NULL;
+
+/* Local Prototypes: */
+static void pto_graph (ir_graph*);
+static void pto_call (ir_graph*, ir_node*, pto_env_t*);
+
+/* ===================================================
+   Local Implementation:
+   =================================================== */
+
+/* Propagation of PTO values */
+static pto_t *get_pto_proj (ir_node *proj)
+{
+  ir_node *proj_in = get_Proj_pred (proj);
+  const long proj_proj = get_Proj_proj (proj);
+  const opcode in_op = get_irn_opcode (proj_in);
+  pto_t *in_pto = NULL;
+  pto_t *proj_pto = get_node_pto (proj);
+
+  switch (in_op) {
+  case (iro_Start):             /* ProjT (Start) */
+    assert (0 && "pto from ProjT(Start) requested");
+
+    return (NULL);
+  case (iro_Proj):              /* ProjT (Start), ProjT (Call) */
+    assert ((pn_Start_T_args == proj_proj) ||
+            (pn_Call_T_result == proj_proj));
+    ir_node *proj_in_in = get_Proj_pred (proj_in);
+    const opcode in_in_op = get_irn_opcode (proj_in_in);
+
+    switch (in_in_op) {
+    case (iro_Start):           /* ProjArg (ProjT (Start)) */
+      /* then the pto value must have been set to the node */
+      assert (proj_pto);
+
+      return (proj_pto);
+    case (iro_Call):            /* ProjV (ProjT (Call)) */
+      if (NULL != proj_pto) {
+        return (proj_pto);
+      } else {
+        in_pto = get_node_pto (proj_in);
+        set_node_pto (proj, in_pto);
+
+        return (in_pto);
+      }
+    default: assert (0 && "Proj(Proj(?))");
+    }
+    /* done with case (in_op == iro_Proj) */
+
+  case (iro_Load):              /* ProjV (Load) */
+    assert (pn_Load_res == proj_proj);
+    /* FALLTHROUGH */
+  case (iro_Call):              /* ProjT (Call) */
+    /* FALLTHROUGH */
+  case (iro_Alloc):             /* ProjV (Alloc) */
+    if (NULL != proj_pto) {
+      return (proj_pto);
+    } else {
+      in_pto = get_alloc_pto (proj_in);
+      assert (in_pto);
+
+      set_node_pto (proj, in_pto);
+      return (in_pto);
+    }
+  default:
+    fprintf (stderr, "%s: not handled: proj (%s[%li])\n",
+             __FUNCTION__,
+             get_op_name (get_irn_op (proj_in)),
+             get_irn_node_nr (proj_in));
+    assert (0 && "Proj(?)");
+  }
+
+}
+
+static pto_t *get_pto_phi (ir_node *phi)
+{
+  return (NULL);
+}
+
+static pto_t *get_pto_ret (ir_node *ret)
+{
+  pto_t *pto = get_node_pto (ret);
+
+  if (NULL == pto) {
+    ir_node *in = get_Return_res (ret, 0);
+
+    pto = get_node_pto (in);
+    set_node_pto (ret, pto);
+  }
+
+  return (pto);
+}
+
+
+/* Dispatch to propagate PTO values */
+static pto_t *get_pto (ir_node *node)
+{
+  const opcode op = get_irn_opcode (node);
+
+  switch (op) {
+  case (iro_Cast):   return (get_pto (get_Cast_op (node)));
+  case (iro_Proj):   return (get_pto_proj (node));
+  case (iro_Phi):    return (get_pto_phi (node));
+  case (iro_Return): return (get_pto_ret (node));
+
+  default:
+    /* stopgap measure */
+    fprintf (stderr, "%s: not handled: node[%li].op = %s\n",
+             __FUNCTION__,
+             get_irn_node_nr (node),
+             get_op_name (get_irn_op (node)));
+    assert (0 && "something not handled");
+
+  }
+}
+
+
+/* Actions for the nodes: */
+static void pto_load (ir_node *load, pto_env_t *pto_env)
+{
+  /* perform load */
+  DBGPRINT (0, (stdout, "%s (%s[%li])\n", __FUNCTION__, OPNAME (load), OPNUM (load)));
+}
+
+static void pto_store (ir_node *store, pto_env_t *pto_env)
+{
+  /* perform store */
+  DBGPRINT (0, (stdout, "%s (%s[%li])\n", __FUNCTION__,
+                OPNAME (store), OPNUM (store)));
+}
+
+static void pto_method (ir_node *call, pto_env_t *pto_env)
+{
+  DBGPRINT (0, (stdout, "%s:%i (%s[%li])\n",
+                __FUNCTION__, __LINE__, OPNAME (call), OPNUM (call)));
+
+  callEd_info_t *callEd_info = ecg_get_callEd_info (call);
+
+  int i = 0;
+  while (NULL != callEd_info) {
+    DBGPRINT (0, (stdout, "%s:%i (%s[%li]), graph %i\n",
+                  __FUNCTION__, __LINE__, OPNAME (call), OPNUM (call), i ++));
+
+    pto_call (callEd_info->callEd, call, pto_env);
+
+    callEd_info = callEd_info->prev;
+  }
+}
+
+
+static void pto_call (ir_graph *graph, ir_node *call, pto_env_t *pto_env)
+{
+  /* perform call */
+  DBGPRINT (0, (stdout, "%s:%i (%s[%li])\n",
+                __FUNCTION__, __LINE__, OPNAME (call), OPNUM (call)));
+
+  entity *ent = get_irg_entity (graph);
+
+  const char *ent_name = (char*) get_entity_name (ent);
+  const char *own_name = (char*) get_type_name (get_entity_owner (ent));
+
+  if (! get_irg_is_mem_visited (graph)) {
+    graph_info_t *ginfo = ecg_get_info (graph);
+
+    /* Save CTX */
+    int ctx_idx = find_ctx_idx (call, ginfo, get_curr_ctx ());
+    /* ctx_info_t *call_ctx = find_ctx (call, ginfo, get_curr_ctx ()); */
+    ctx_info_t *call_ctx = get_ctx (ginfo, ctx_idx);
+    ctx_info_t *old_ctx = set_curr_ctx (call_ctx);
+    DBGPRINT (1, (stdout, "%s>CTX: ", -- spaces));
+    DBGEXE (1, ecg_print_ctx (call_ctx, stdout));
+
+    /* Todo: Compute Arguments */
+
+    /* Visit Graph */
+    pto_graph (graph);
+
+    /* Initialise Alloc Names */
+    pto_init_allocs (ginfo, ctx_idx);
+
+    /* Restore CTX */
+    set_curr_ctx (old_ctx);
+
+    DBGPRINT (1, (stdout, "%s<CTX: ", spaces ++));
+    DBGEXE (1, ecg_print_ctx (call_ctx, stdout));
+
+    /* Don't need to reset alloc names unless we handle recursion here  */
+
+
+    /* Get Return Value from Graph */
+  } else {
+    DBGPRINT (0, (stdout, "%s: recursion into \"%s.%s\"\n",
+                  __FUNCTION__, own_name, ent_name));
+  }
+
+  /* Todo: Set 'Unknown' Value as Return Value when the graph is not
+     known */
+}
+
+static void pto_raise (ir_node *raise, pto_env_t *pto_env)
+{
+  /* perform raise */
+  DBGPRINT (0, (stdout, "%s (%s[%li])\n", __FUNCTION__,
+                OPNAME (raise), OPNUM (raise)));
+}
+
+static void pto_end_block (ir_node *end_block, pto_env_t *pto_env)
+{
+  /* perform end block */
+  DBGPRINT (0, (stdout, "%s (%s[%li])\n", __FUNCTION__,
+                OPNAME (end_block), OPNUM (end_block)));
+}
+
+/* Perform the appropriate action on the given node */
+static void pto_node_node (ir_node *node, pto_env_t *pto_env)
+{
+  const opcode op = get_irn_opcode (node);
+
+  switch (op) {
+  case (iro_Start): /* nothing */ break;
+  case (iro_Load):
+    pto_load (node, pto_env);
+    break;
+
+  case (iro_Store):
+    pto_store (node, pto_env);
+    break;
+
+  case (iro_Call):
+    pto_method (node, pto_env);
+    break;
+
+  case (iro_Raise):
+    pto_raise (node, pto_env);
+    break;
+
+  case (iro_Return):
+    /* nothing to do */
+    break;
+
+  case (iro_Alloc):
+    /* nothing to do */
+    break;
+
+  case (iro_Block):
+    pto_end_block (node, pto_env);
+    break;
+
+  case (iro_Phi):
+    /* must be a PhiM */
+    assert (mode_M == get_irn_mode (node));
+    /* nothing to do */
+    break;
+
+    /* uninteresting stuff: */
+  case (iro_Div):
+  case (iro_Quot):
+  case (iro_Mod):
+  case (iro_DivMod): /* nothing to do */ break;
+
+  default:
+    /* stopgap measure */
+    fprintf (stderr, "%s: not handled: node[%li].op = %s\n",
+             __FUNCTION__,
+             get_irn_node_nr (node),
+             get_op_name (get_irn_op (node)));
+    assert (0 && "something not handled");
+  }
+
+
+
+}
+
+
+/* Callback function to execute in pre-order */
+static void pto_node_pre (ir_node *node, void *env)
+{
+  /* nothing */
+}
+
+/* Callback function to execute in post-order */
+static void pto_node_post (ir_node *node, void *env)
+{
+  pto_env_t *pto_env = (pto_env_t*) env;
+
+  pto_node_node (node, pto_env);
+}
+
+/* Perform a single pass over the given graph */
+static void pto_graph_pass (ir_graph *graph, void *pto_env)
+{
+  entity *ent = get_irg_entity (graph);
+  const char *ent_name = (char*) get_entity_name (ent);
+  const char *own_name = (char*) get_type_name (get_entity_owner (ent));
+  HERE3 ("start", own_name, ent_name);
+
+  irg_walk_mem (graph, pto_node_pre, pto_node_post, pto_env);
+
+  HERE3 ("end  ", own_name, ent_name);
+}
+
+
+/* Main loop: Initialise and iterate over the given graph */
+static void pto_graph (ir_graph *graph)
+{
+  pto_env_t *pto_env = xmalloc (sizeof (pto_env_t));
+  HERE ("start");
+
+  pto_init_graph (graph);
+
+  /* todo (here): iterate, obey 'changed' attribute */
+  pto_graph_pass (graph, pto_env);
+
+  memset (pto_env, 0x00, sizeof (pto_env_t));
+  free (pto_env);
+  HERE ("end");
+}
+
+/* "Fake" the arguments to the main method */
+static void fake_main_args (ir_graph *graph)
+{
+  HERE ("start");
+  /* todo: fake the arguments to the main method */
+
+  HERE ("end");
+}
+
+
+/* ===================================================
+   Exported Implementation:
+   =================================================== */
+/* Set the PTO value for the given non-alloc node */
+void set_node_pto (ir_node *node, pto_t *pto)
+{
+  assert (iro_Alloc != get_irn_opcode (node));
+
+  set_irn_link (node, (void*) pto);
+}
+
+/*Get the PTO value for the given non-alloc node */
+pto_t *get_node_pto (ir_node *node)
+{
+  assert (iro_Alloc != get_irn_opcode (node));
+
+  return ((pto_t*) get_irn_link (node));
+}
+
+/* Set the PTO value for the given alloc node */
+void set_alloc_pto (ir_node *alloc, alloc_pto_t *alloc_pto)
+{
+  assert (iro_Alloc == get_irn_opcode (alloc));
+
+  set_irn_link (alloc, (void*) alloc_pto);
+}
+
+/*Get the current PTO value for the given alloc node */
+pto_t *get_alloc_pto (ir_node *alloc)
+{
+  alloc_pto_t *alloc_pto = (alloc_pto_t*) get_irn_link (alloc);
+
+  assert (iro_Alloc == get_irn_opcode (alloc));
+
+  return (alloc_pto -> curr_pto);
+}
+
+/* Initialise the module (should be moved to pto_init) */
+void pto_init ()
+{
+  HERE ("start");
+  ecg_init (1);
+
+  /* todo: initialise globals etc */
+  pto_init_type_names ();
+
+  spaces = (char*) xmalloc (512 * sizeof (char));
+  memset (spaces, ' ', 512);
+  spaces += 511;
+  *spaces = '\0';
+
+  /* initialise for the CTX-sensitive ecg-traversal */
+  set_curr_ctx (get_main_ctx ());
+  HERE ("end");
+}
+
+void pto_run (int dbg_lvl)
+{
+  HERE ("start");
+  set_dbg_lvl (dbg_lvl);
+
+  ir_graph *graph = get_irp_main_irg ();
+  fake_main_args (graph);
+
+  /* todo: clear entity/type links */
+
+  DBGPRINT (0, (stdout, "START PTO\n"));
+  DBGPRINT (0, (stdout, "START GRAPH (0x%08x) of \"%s.%s\"\n",
+                (int) graph,
+                get_type_name (get_entity_owner (get_irg_entity (graph))),
+                get_entity_name (get_irg_entity (graph))));
+
+  /* do we need some kind of environment here? */
+  pto_graph (graph);
+
+  DBGPRINT (0, (stdout, "END   PTO\n"));
+  HERE ("end");
+}
+
+void pto_cleanup ()
+{
+  HERE ("start");
+  /* todo: clean up our own mess */
+  /* memset (spaces, 0x00, 512); */
+  /* free (spaces); */
+
+  /* clean up ecg infos */
+  ecg_cleanup ();
+  HERE ("end");
+}
+
+\f
+/*
+  $Log$
+  Revision 1.1  2004/11/18 16:37:34  liekweg
+  rewritten
+
+
+*/
diff --git a/ir/ana2/pto_comp.h b/ir/ana2/pto_comp.h
new file mode 100644 (file)
index 0000000..dc7e0b6
--- /dev/null
@@ -0,0 +1,73 @@
+/* -*- c -*- */
+
+/*
+   Project:     libFIRM
+   File name:   ir/ana/pto_comp.h
+   Purpose:     Main Implementation of PTO
+   Author:      Florian
+   Modified by:
+   Created:     Sat Nov 13 19:35:27 CET 2004
+   CVS-ID:      $Id$
+   Copyright:   (c) 1999-2004 Universität Karlsruhe
+   Licence:     This file is protected by the GPL -  GNU GENERAL PUBLIC LICENSE.
+*/
+
+
+# ifndef _PTO_COMP_
+# define _PTO_COMP_
+
+# include "irnode.h"
+
+/* ===================================================
+   Global Defines:
+   =================================================== */
+
+/* ===================================================
+ Global Data Types:
+ =================================================== */
+typedef struct pto_str {
+  int dummy;
+} pto_t;
+
+typedef struct alloc_pto_str {
+  int dummy;
+  pto_t **ptos;                 /* all names */
+  pto_t *curr_pto;              /* name for current ctx */
+} alloc_pto_t;
+
+/* ===================================================
+   Global Prototypes:
+   =================================================== */
+/* Set the PTO value for the given node */
+void set_node_pto (ir_node*, pto_t*);
+/*Get the PTO value for the given non-alloc node */
+pto_t *get_node_pto (ir_node*);
+
+/* Set the PTO value for the given alloc node */
+void set_alloc_pto (ir_node*, alloc_pto_t*);
+
+/*Get the current PTO value for the given alloc node */
+pto_t *get_alloc_pto (ir_node*);
+
+
+/* Perform PTO on all visible graphs. */
+void pto_init (void);
+void pto_run (int);
+void pto_cleanup (void);
+
+/* ===================================================
+   Global Variables:
+   =================================================== */
+
+
+# endif /* not defined _PTO_COMP_ */
+
+
+\f
+/*
+  $Log$
+  Revision 1.1  2004/11/18 16:37:34  liekweg
+  rewritten
+
+
+*/
diff --git a/ir/ana2/pto_ctx.c b/ir/ana2/pto_ctx.c
new file mode 100644 (file)
index 0000000..725797a
--- /dev/null
@@ -0,0 +1,93 @@
+/* -*- c -*- */
+
+/*
+   Project:     libFIRM
+   File name:   ir/ana/pto_ctx.c
+   Purpose:     ...
+   Author:      Florian
+   Modified by:
+   Created:     Sat Nov 13 19:35:27 CET 2004
+   CVS-ID:      $Id$
+   Copyright:   (c) 1999-2004 Universität Karlsruhe
+   Licence:     This file is protected by the GPL -  GNU GENERAL PUBLIC LICENSE.
+*/
+
+# ifdef HAVE_CONFIG_H
+#  include <config.h>
+# endif
+
+/*
+ pto_ctx: ...
+*/
+
+# include "pto_ctx.h"
+
+# include "irnode.h"
+# include "xmalloc.h"
+
+# include "pto_debug.h"
+
+/* Local Defines: */
+
+/* Local Data Types: */
+
+/* Local Variables: */
+static ctx_info_t *curr_ctx = NULL;
+
+/* Local Prototypes: */
+
+/* ===================================================
+   Local Implementation:
+   =================================================== */
+
+
+/* ===================================================
+   Exported Implementation:
+   =================================================== */
+/* Find the appropriate ctx for the given call and the given graph */
+/* ctx_info_t *find_ctx (ir_node *call, graph_info_t *ginfo, ctx_info_t *curr_ctx) */
+int find_ctx_idx (ir_node *call, graph_info_t *ginfo, ctx_info_t *curr_ctx)
+{
+  int i;
+  const int n_ctxs = ginfo->n_ctxs;
+
+  for (i = 0; i < n_ctxs; i ++) {
+    ctx_info_t *ctx = ginfo->ctxs [i];
+
+    if ((ctx->enc == curr_ctx) && (ctx->call == call)) {
+      return (i);
+    }
+  }
+
+  fflush (stdout);
+  assert (0 && "CTX not found");
+
+  return (-1);
+}
+
+/* Get the current ctx */
+ctx_info_t *get_curr_ctx (void)
+{
+  return (curr_ctx);
+}
+
+/* Set the current ctx to the given ctx.  Return the old value */
+ctx_info_t *set_curr_ctx (ctx_info_t *ctx)
+{
+  ctx_info_t *old_ctx = curr_ctx;
+
+  curr_ctx = ctx;
+
+  return (old_ctx);
+}
+
+
+
+\f
+/*
+  $Log$
+  Revision 1.1  2004/11/18 16:37:34  liekweg
+  rewritten
+
+
+*/
diff --git a/ir/ana2/pto_ctx.h b/ir/ana2/pto_ctx.h
new file mode 100644 (file)
index 0000000..b7cf7f3
--- /dev/null
@@ -0,0 +1,57 @@
+/* -*- c -*- */
+
+/*
+   Project:     libFIRM
+   File name:   ir/ana/pto_ctx.h
+   Purpose:     ...
+   Author:      Florian
+   Modified by:
+   Created:     Sat Nov 13 19:35:27 CET 2004
+   CVS-ID:      $Id$
+   Copyright:   (c) 1999-2004 Universität Karlsruhe
+   Licence:     This file is protected by the GPL -  GNU GENERAL PUBLIC LICENSE.
+*/
+
+
+# ifndef _PTO_CTX_
+# define _PTO_CTX_
+
+# include "ecg.h"
+
+/* ===================================================
+   Global Defines:
+   =================================================== */
+
+/* ===================================================
+ Global Data Types:
+ =================================================== */
+
+/* ===================================================
+   Global Prototypes:
+   =================================================== */
+/* Find the appropriate ctx for the given call and the given graph */
+/* ctx_info_t *find_ctx (ir_node*, graph_info_t*, ctx_info_t*); */
+int find_ctx_idx (ir_node*, graph_info_t*, ctx_info_t*);
+
+/* Get the current ctx */
+ctx_info_t *get_curr_ctx (void);
+
+/* Set the current ctx to the given ctx.  Return the old value */
+ctx_info_t *set_curr_ctx (ctx_info_t*);
+
+/* ===================================================
+   Global Variables:
+   =================================================== */
+
+
+# endif /* not defined _PTO_CTX_ */
+
+
+\f
+/*
+  $Log$
+  Revision 1.1  2004/11/18 16:37:34  liekweg
+  rewritten
+
+
+*/
diff --git a/ir/ana2/pto_debug.c b/ir/ana2/pto_debug.c
new file mode 100644 (file)
index 0000000..d68f575
--- /dev/null
@@ -0,0 +1,63 @@
+/* -*- c -*- */
+
+/*
+   Project:     libFIRM
+   File name:   ir/ana/pto_debug.c
+   Purpose:     Useful Macros for Debugging
+   Author:      Florian
+   Modified by:
+   Created:     Sat Nov 13 19:30:21 CET 2004
+   CVS-ID:      $Id$
+   Copyright:   (c) 1999-2004 Universität Karlsruhe
+   Licence:     This file is protected by the GPL -  GNU GENERAL PUBLIC LICENSE.
+*/
+
+# ifdef HAVE_CONFIG_H
+#  include <config.h>
+# endif
+
+/*
+ pto_debug: Useful Macros for Debugging
+*/
+
+# include "pto_debug.h"
+
+# include "irnode.h"
+# include "xmalloc.h"
+
+/* Local Defines: */
+
+/* Local Data Types: */
+
+/* Local Variables: */
+static int dbg_lvl = 0;
+
+/* Local Prototypes: */
+
+/* ===================================================
+   Local Implementation:
+   =================================================== */
+
+
+/* ===================================================
+   Exported Implementation:
+   =================================================== */
+int get_dbg_lvl ()
+{
+  return (dbg_lvl);
+}
+
+void set_dbg_lvl (int lvl)
+{
+  dbg_lvl = lvl;
+}
+
+
+\f
+/*
+  $Log$
+  Revision 1.1  2004/11/18 16:37:34  liekweg
+  rewritten
+
+
+*/
diff --git a/ir/ana2/pto_debug.h b/ir/ana2/pto_debug.h
new file mode 100644 (file)
index 0000000..0a18a4c
--- /dev/null
@@ -0,0 +1,54 @@
+/* -*- c -*- */
+
+/*
+   Project:     libFIRM
+   File name:   ir/ana/pto_debug.h
+   Purpose:     Useful Macros for Debugging
+   Author:      Florian
+   Modified by:
+   Created:     Sat Nov 13 19:30:21 CET 2004
+   CVS-ID:      $Id$
+   Copyright:   (c) 1999-2004 Universität Karlsruhe
+   Licence:     This file is protected by the GPL -  GNU GENERAL PUBLIC LICENSE.
+*/
+
+
+# ifndef _PTO_DEBUG_
+# define _PTO_DEBUG_
+
+/* ===================================================
+   Global Defines:
+   =================================================== */
+# define DBGPRINT(lvl, args) if (get_dbg_lvl () > lvl) { fprintf args; }
+# define DBGEXE(lvl, cmd) if (get_dbg_lvl () > lvl) {cmd;}
+# define OPNAME(node) get_op_name (get_irn_op (node))
+# define OPNUM(node) get_irn_node_nr (node)
+# define HERE(msg)  fprintf (stdout, "%s:%i: %s\n", __FUNCTION__, __LINE__, msg)
+# define HERE2(msg1, msg2)  fprintf (stdout, "%s:%i: %s %s\n", __FUNCTION__, __LINE__, msg1, msg2)
+# define HERE3(msg1, msg2, msg3)  fprintf (stdout, "%s:%i: %s %s %s\n", __FUNCTION__, __LINE__, msg1, msg2, msg3)
+
+/* ===================================================
+ Global Data Types:
+ =================================================== */
+
+/* ===================================================
+ Global Data Prototypes:
+ =================================================== */
+int get_dbg_lvl (void);
+void set_dbg_lvl (int);
+
+/* ===================================================
+   Global Variables:
+   =================================================== */
+
+# endif /* not defined _PTO_DEBUG_ */
+
+
+\f
+/*
+  $Log$
+  Revision 1.1  2004/11/18 16:37:34  liekweg
+  rewritten
+
+
+*/
diff --git a/ir/ana2/pto_name.c b/ir/ana2/pto_name.c
new file mode 100644 (file)
index 0000000..9611252
--- /dev/null
@@ -0,0 +1,57 @@
+/* -*- c -*- */
+
+/*
+   Project:     libFIRM
+   File name:   ir/ana/pto_name.c
+   Purpose:     ...
+   Author:      Florian
+   Modified by:
+   Created:     Sat Nov 13 19:35:27 CET 2004
+   CVS-ID:      $Id$
+   Copyright:   (c) 1999-2004 Universität Karlsruhe
+   Licence:     This file is protected by the GPL -  GNU GENERAL PUBLIC LICENSE.
+*/
+
+# ifdef HAVE_CONFIG_H
+#  include <config.h>
+# endif
+
+/*
+ pto_name: ...
+*/
+
+# include "pto_name.h"
+
+# include "irnode.h"
+# include "xmalloc.h"
+
+# include "pto_debug.h"
+
+/* Local Defines: */
+
+/* Local Data Types: */
+
+/* Local Variables: */
+
+/* Local Prototypes: */
+
+/* ===================================================
+   Local Implementation:
+   =================================================== */
+
+
+/* ===================================================
+   Exported Implementation:
+   =================================================== */
+
+
+
+
+\f
+/*
+  $Log$
+  Revision 1.1  2004/11/18 16:37:34  liekweg
+  rewritten
+
+
+*/
diff --git a/ir/ana2/pto_name.h b/ir/ana2/pto_name.h
new file mode 100644 (file)
index 0000000..8625d7e
--- /dev/null
@@ -0,0 +1,46 @@
+/* -*- c -*- */
+
+/*
+   Project:     libFIRM
+   File name:   ir/ana/pto_name.h
+   Purpose:     ...
+   Author:      Florian
+   Modified by:
+   Created:     Sat Nov 13 19:35:27 CET 2004
+   CVS-ID:      $Id$
+   Copyright:   (c) 1999-2004 Universität Karlsruhe
+   Licence:     This file is protected by the GPL -  GNU GENERAL PUBLIC LICENSE.
+*/
+
+
+# ifndef _PTO_NAME_
+# define _PTO_NAME_
+
+/* ===================================================
+   Global Defines:
+   =================================================== */
+
+/* ===================================================
+ Global Data Types:
+ =================================================== */
+
+/* ===================================================
+   Global Prototypes:
+   =================================================== */
+
+/* ===================================================
+   Global Variables:
+   =================================================== */
+
+
+# endif /* not defined _PTO_NAME_ */
+
+
+\f
+/*
+  $Log$
+  Revision 1.1  2004/11/18 16:37:34  liekweg
+  rewritten
+
+
+*/