3 * File name: ir/ana/callgraph.h
4 * Purpose: Representation and computation of the callgraph.
5 * Author: Goetz Lindenmaier
9 * Copyright: (c) 2004 Universität Karlsruhe
10 * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
19 * This file contains defines the representation of the callgraph.
20 * The nodes of the call graph are ir_graphs. The edges between
21 * The nodes are calling relation. I.e., if method a calls method
22 * b at some point, there is an edge between a and b.
24 * Further this file contains an algorithm to construct the call
25 * graph. The construction of the callgraph uses the callee
26 * information in Call nodes to determine which methods are called.
28 * Finally this file contains an algorithm that computes backedges
29 * in the callgraph, i.e., the algorithm finds possibly recursive calls.
30 * The algorithm computes an upper bound of all recursive calls.
36 /** The functions that call irg. */
37 int get_irg_n_callers(ir_graph *irg);
38 ir_graph *get_irg_caller(ir_graph *irg, int pos);
39 /* int is_irg_caller_backedge(ir_graph *irg, int pos); not implemented */
41 /** The functions called by irg. */
42 int get_irg_n_callees(ir_graph *irg);
43 ir_graph *get_irg_callee(ir_graph *irg, int pos);
44 int is_irg_callee_backedge(ir_graph *irg, int pos);
47 /** Construct and destruct the callgraph. */
48 void compute_callgraph(void);
49 void free_callgraph(void);
51 /** Compute the backedges that represent recursions. */
52 void find_callgraph_recursions(void);
55 #endif /* _CALLGRAPH_H_ */