summaryrefslogtreecommitdiffhomepage
path: root/ir/ana/dfs.h
blob: f786f217b6b1eaee6eb239bd16c867e1d73e362a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
 * This file is part of libFirm.
 * Copyright (C) 2012 University of Karlsruhe.
 */

/**
 * @file
 * @author  Sebastian Hack
 * @date    20.04.2007
 * @brief
 *
 * Primitive depth-first search on the CFG.
 */
#ifndef FIRM_ANA_DFS_H
#define FIRM_ANA_DFS_H

#include "firm_types.h"
#include <stdio.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;

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

dfs_t *dfs_new(ir_graph *irg);
void dfs_free(dfs_t *dfs);
void dfs_dump(const dfs_t *dfs, FILE *file);

#endif