X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fana%2Fdfs_t.h;h=dd8629d6cc3b891c2fdb7d448bcff12c03fbe339;hb=00894f1e0b6e74ca6c12d253dd30f7d873808977;hp=bcb169011df03d51582cc847d35330747eb6cf19;hpb=f616f878aa0ea06ad96e9c92a58c75d4fe5b3162;p=libfirm diff --git a/ir/ana/dfs_t.h b/ir/ana/dfs_t.h index bcb169011..dd8629d6c 100644 --- a/ir/ana/dfs_t.h +++ b/ir/ana/dfs_t.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 1995-2007 University of Karlsruhe. All right reserved. + * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. * * This file is part of libFirm. * @@ -37,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; }; @@ -66,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)); @@ -76,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);