/* -*- c -*- */
/*
- * Project: libFIRM
- * File name: ir/ana2/irmemwalk.c
- * Purpose: walk along memory edges
- * Author: Florian
- * Modified by:
- * Created: Mon 18 Oct 2004
- * CVS-ID: $Id$
- * Copyright: (c) 1999-2004 Universität Karlsruhe
- * Licence: This file is protected by GPL - GNU GENERAL PUBLIC LICENSE.
+ * Copyright (C) 1995-2007 University of Karlsruhe. All right reserved.
+ *
+ * This file is part of libFirm.
+ *
+ * This file may be distributed and/or modified under the terms of the
+ * GNU General Public License version 2 as published by the Free Software
+ * Foundation and appearing in the file LICENSE.GPL included in the
+ * packaging of this file.
+ *
+ * Licensees holding valid libFirm Professional Edition licenses may use
+ * this file in accordance with the libFirm Commercial License.
+ * Agreement provided with the Software.
+ *
+ * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+ * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE.
*/
-/*
- Walk over a firm graph along its memory edges.
-
- Any number of graphs can be visited at the same time, but no graph
- can be traversed more than once at any time.
-*/
-
-
+/**
+ * @file
+ * @brief walk along memory edges
+ * @author Florian
+ * @date Mon 18 Oct 2004
+ * @version $Id$
+ * @summary
+ * Walk over a firm graph along its memory edges.
+ *
+ * Any number of graphs can be visited at the same time, but no graph
+ * can be traversed more than once at any time.
+ */
# ifdef HAVE_CONFIG_H
# include "config.h"
# endif
+# include "irnode_t.h"
# include "irgwalk.h" /* for irg_walk_func */
# include "irprog.h" /* for get_irp_main_irg */
# include "xmalloc.h"
+# include "gnu_ext.h"
# ifndef TRUE
# define TRUE 1
Data
*/
-/* environment for a single memory walker */
+/** environment for a single memory walker */
typedef struct walk_mem_env_str {
- ir_graph *graph; /* the graph we're visiting */
- int visited; /* 'visited' marker */
- irg_walk_func *pre; /* pre action */
- irg_walk_func *post; /* post action */
- void *env; /* user-defined environment */
-
- struct walk_mem_env_str *prev; /* link up walking instances */
+ ir_graph *graph; /**< the graph we're visiting */
+ unsigned long visited; /**< 'visited' marker
+ (unsigned long in case we walk more than 2^32 graphs) */
+ irg_walk_func *pre; /**< pre action */
+ irg_walk_func *post; /**< post action */
+ void *env; /**< user-defined environment */
+
+ struct walk_mem_env_str *prev; /**< link up walking instances */
/* what else? */
} walk_mem_env_t;
static void irg_walk_mem_node (ir_node *node,
walk_mem_env_t *walk_env)
{
- const opcode op = get_irn_opcode (node);
+ const ir_opcode op = get_irn_opcode (node);
ir_node *in = NULL;
if (get_irn_visited (node) >= walk_env->visited) {
void *env)
{
ir_node *end_block = get_irg_end_block (graph);
- walk_mem_env_t *walk_env = (walk_mem_env_t*) xmalloc (sizeof (walk_mem_env_t));
+ walk_mem_env_t *walk_env = xmalloc (sizeof (walk_mem_env_t));
assert (! get_irg_is_mem_visited (graph));
/*
$Log$
+ Revision 1.12 2007/01/16 15:45:42 beck
+ renamed type opcode to ir_opcode
+
+ Revision 1.11 2005/01/26 12:20:20 beck
+ gnu_ext.h included
+
+ Revision 1.10 2005/01/14 13:34:48 liekweg
+ Don't cast malloc
+
+ Revision 1.9 2005/01/10 17:26:34 liekweg
+ fixup printfs, don't put environments on the stack
+
+ Revision 1.8 2004/12/22 14:43:14 beck
+ made allocations C-like
+
+ Revision 1.7 2004/12/21 14:25:35 beck
+ removed C99 constructs
+ make visit counter of same type as irn visit counter
+
Revision 1.6 2004/12/02 16:17:51 beck
fixed config.h include