X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fana%2Fdfs_t.h;h=dd8629d6cc3b891c2fdb7d448bcff12c03fbe339;hb=6365c91e1ff24ede138bd3c387215a6b58dff330;hp=255a4b9f636bf7c3b272ac7ff2b2f322ed9777fb;hpb=73660ffae4a673bc11dba89455ecba9b80938298;p=libfirm diff --git a/ir/ana/dfs_t.h b/ir/ana/dfs_t.h index 255a4b9f6..dd8629d6c 100644 --- a/ir/ana/dfs_t.h +++ b/ir/ana/dfs_t.h @@ -1,16 +1,33 @@ -/** - * @file dfs_t.h - * @date 21.04.2007 - * @author Sebastian Hack +/* + * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. * - * depth first search internal stuff. + * 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. * - * Copyright (C) 2007 Universitaet Karlsruhe - * Released under the GPL + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE. */ -#ifndef _DFS_T_H -#define _DFS_T_H +/** + * @file dfs_t.h + * @author Sebastian Hack + * @date 21.04.2007 + * @version $Id$ + * @summary + * + * depth first search internal stuff. + */ +#ifndef FIRM_ANA_DFS_T_H +#define FIRM_ANA_DFS_T_H #include "firm_config.h" #include "hashptr.h" @@ -20,15 +37,16 @@ struct _dfs_node_t { int visited; - void *node; - void *ancestor; + const void *node; + const void *ancestor; int pre_num; int max_pre_num; int post_num; + int level; }; struct _dfs_edge_t { - void *src, *tgt; + const void *src, *tgt; dfs_node_t *s, *t; dfs_edge_kind_t kind; }; @@ -49,7 +67,7 @@ struct _dfs_t { unsigned edges_classified : 1; }; -static struct _dfs_node_t *_dfs_get_node(const struct _dfs_t *self, void *node) +static struct _dfs_node_t *_dfs_get_node(const struct _dfs_t *self, const void *node) { struct _dfs_node_t templ; memset(&templ, 0, sizeof(templ)); @@ -59,7 +77,7 @@ static struct _dfs_node_t *_dfs_get_node(const struct _dfs_t *self, void *node) #define _dfs_int_is_ancestor(n, m) ((m)->pre_num >= (n)->pre_num && (m)->pre_num <= (n)->max_pre_num) -static INLINE int _dfs_is_ancestor(const struct _dfs_t *dfs, void *a, void *b) +static INLINE int _dfs_is_ancestor(const struct _dfs_t *dfs, const void *a, const void *b) { struct _dfs_node_t *n = _dfs_get_node(dfs, a); struct _dfs_node_t *m = _dfs_get_node(dfs, b); @@ -73,4 +91,4 @@ static INLINE int _dfs_is_ancestor(const struct _dfs_t *dfs, void *a, void *b) #define dfs_get_post_num_node(dfs, num) ((dfs)->post_order[num]->node) #define dfs_is_ancestor(dfs, n, m) _dfs_is_ancestor((n), (m)) -#endif /* _DFS_T_H */ +#endif /* FIRM_ANA_DFS_T_H */