dfs.h 1.36 KB
Newer Older
Michael Beck's avatar
Michael Beck committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/*
 * 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.
 */

20
/**
Michael Beck's avatar
Michael Beck committed
21
22
23
 * @file    dfs.h
 * @author  Sebastian Hack
 * @date    20.04.2007
Michael Beck's avatar
Michael Beck committed
24
 * @version $Id$
Michael Beck's avatar
Michael Beck committed
25
 * @summary
26
27
28
 *
 * Primitive depth-first search on the CFG.
 */
Michael Beck's avatar
Michael Beck committed
29
30
#ifndef FIRM_ANA_DFS_H
#define FIRM_ANA_DFS_H
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50

#include "absgraph.h"

typedef struct _dfs_t      dfs_t;
typedef struct _dfs_node_t dfs_node_t;
typedef struct _dfs_edge_t dfs_edge_t;

typedef enum {
	DFS_EDGE_ANC,
	DFS_EDGE_FWD,
	DFS_EDGE_CROSS,
	DFS_EDGE_BACK
} dfs_edge_kind_t;

extern dfs_edge_kind_t dfs_get_edge_kind(const dfs_t *dfs, void *src, void *tgt);

extern dfs_t *dfs_new(const absgraph_t *graph_impl, void *graph);
extern void dfs_free(dfs_t *dfs);
extern void dfs_dump(const dfs_t *dfs, FILE *file);

Michael Beck's avatar
Michael Beck committed
51
#endif /* FIRM_ANA_DFS_H */