X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=include%2Flibfirm%2Fcallgraph.h;h=2cbb3f588a8b786187df017ce9a0b2159956d359;hb=1553e92153d3b718a7f5575dcbbe8abbffc579c0;hp=63ad0311af38c60410b67de919b36617c5fbd78d;hpb=8fd12b1714e2024889e81aa4b351d1b6640e1c79;p=libfirm diff --git a/include/libfirm/callgraph.h b/include/libfirm/callgraph.h index 63ad0311a..2cbb3f588 100644 --- a/include/libfirm/callgraph.h +++ b/include/libfirm/callgraph.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. * @@ -23,7 +23,7 @@ * @author Goetz Lindenmaier * @date 21.7.2004 * @version $Id$ - * @summary + * @brief * This file contains the representation of the callgraph. * The nodes of the call graph are ir_graphs. The edges between * the nodes are calling relations. I.e., if method a calls method @@ -41,6 +41,7 @@ #define FIRM_ANA_CALLGRAPH_H #include "firm_types.h" +#include "begin.h" /** Flag to indicate state of callgraph. */ typedef enum { @@ -51,62 +52,61 @@ typedef enum { } irp_callgraph_state; /** Returns the callgraph state of the program representation. */ -irp_callgraph_state get_irp_callgraph_state(void); +FIRM_API irp_callgraph_state get_irp_callgraph_state(void); /** Sets the callgraph state of the program representation. */ -void set_irp_callgraph_state(irp_callgraph_state s); +FIRM_API void set_irp_callgraph_state(irp_callgraph_state s); /** Returns the number of procedures that call the given irg. */ -int get_irg_n_callers(ir_graph *irg); +FIRM_API size_t get_irg_n_callers(const ir_graph *irg); /** Returns the caller at position pos. */ -ir_graph *get_irg_caller(ir_graph *irg, int pos); +ir_graph *get_irg_caller(const ir_graph *irg, size_t pos); /** Returns non-zero if the caller at position pos is "a backedge", i.e. a recursion. */ -int is_irg_caller_backedge(ir_graph *irg, int pos); +FIRM_API int is_irg_caller_backedge(const ir_graph *irg, size_t pos); /** Returns non-zero if the irg has a backedge caller. */ -int has_irg_caller_backedge(ir_graph *irg); +FIRM_API int has_irg_caller_backedge(const ir_graph *irg); /** Returns the maximal loop depth of call nodes that call along this edge. */ -int get_irg_caller_loop_depth(ir_graph *irg, int pos); +FIRM_API size_t get_irg_caller_loop_depth(const ir_graph *irg, size_t pos); /** Returns the number of procedures that are called by the given irg. */ -int get_irg_n_callees(ir_graph *irg); +FIRM_API size_t get_irg_n_callees(const ir_graph *irg); /** Returns the callee at position pos. */ -ir_graph *get_irg_callee(ir_graph *irg, int pos); +FIRM_API ir_graph *get_irg_callee(const ir_graph *irg, size_t pos); /** Returns non-zero if the callee at position pos is "a backedge", i.e. a recursion. */ -int is_irg_callee_backedge(ir_graph *irg, int pos); +FIRM_API int is_irg_callee_backedge(const ir_graph *irg, size_t pos); /** Returns non-zero if the irg has a backedge callee. */ -int has_irg_callee_backedge(ir_graph *irg); +FIRM_API int has_irg_callee_backedge(const ir_graph *irg); /** Returns the maximal loop depth of call nodes that call along this edge. */ -int get_irg_callee_loop_depth(ir_graph *irg, int pos); +FIRM_API size_t get_irg_callee_loop_depth(const ir_graph *irg, size_t pos); /** Returns the maximal loop depth of all paths from an external visible method to this irg. */ -int get_irg_loop_depth(ir_graph *irg); +FIRM_API size_t get_irg_loop_depth(const ir_graph *irg); /** Returns the maximal recursion depth of all paths from an external visible method to this irg. */ -int get_irg_recursion_depth(ir_graph *irg); +FIRM_API size_t get_irg_recursion_depth(const ir_graph *irg); -#ifdef INTERPROCEDURAL_VIEW /** Returns the method execution frequency of a graph. */ -double get_irg_method_execution_frequency(ir_graph *irg); +FIRM_API double get_irg_method_execution_frequency(const ir_graph *irg); /** * Construct the callgraph. Expects callee information, i.e., * irg_callee_info_consistent must be set. This can be computed with * cgana(). */ -void compute_callgraph(void); +FIRM_API void compute_callgraph(void); /** Destruct the callgraph. */ -void free_callgraph(void); +FIRM_API void free_callgraph(void); /** A function type for functions passed to the callgraph walker. */ @@ -127,12 +127,13 @@ typedef void callgraph_walk_func(ir_graph *g, void *env); * @param post - walker function, executed after the predecessor of a node are visited * @param env - environment, passed to pre and post */ -void callgraph_walk(callgraph_walk_func *pre, callgraph_walk_func *post, void *env); +FIRM_API void callgraph_walk(callgraph_walk_func *pre, + callgraph_walk_func *post, void *env); /** * Compute the backedges that represent recursions and a looptree. */ -void find_callgraph_recursions(void); +FIRM_API void find_callgraph_recursions(void); /** Compute interprocedural performance estimates. * @@ -149,7 +150,7 @@ void find_callgraph_recursions(void); * * Expects the main irg is set, see set_irp_main_irg(); **/ -void compute_performance_estimates(void); +FIRM_API void compute_performance_estimates(void); /** Computes the interprocedural loop nesting information. * @@ -161,7 +162,7 @@ void compute_performance_estimates(void); * * Expects the main irg is set, see set_irp_main_irg(); */ -void analyse_loop_nesting_depth(void); +FIRM_API void analyse_loop_nesting_depth(void); /** The state of loop nesting depth. */ typedef enum { @@ -173,15 +174,14 @@ typedef enum { } loop_nesting_depth_state; /** Returns the nesting depth state of the program representation. */ -loop_nesting_depth_state get_irp_loop_nesting_depth_state(void); +FIRM_API loop_nesting_depth_state get_irp_loop_nesting_depth_state(void); /** Sets the nesting depth state of the program representation. */ -void set_irp_loop_nesting_depth_state(loop_nesting_depth_state s); +FIRM_API void set_irp_loop_nesting_depth_state(loop_nesting_depth_state s); /** Marks the nesting depth state of the program representation as inconsistent. */ -void set_irp_loop_nesting_depth_state_inconsistent(void); - -#endif +FIRM_API void set_irp_loop_nesting_depth_state_inconsistent(void); +#include "end.h" -#endif /* _CALLGRAPH_H_ */ +#endif