X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fana%2Fcallgraph.c;h=a4eba6cc771a5801c780137584678fffb78ceaa2;hb=b2e280bcb4dcde092a0971ea045ee1269b114c4f;hp=69648680506e399ff75b265c3c74a412b6b58070;hpb=1ec30d95387eb392ba5a1adc7958ebd91383d59c;p=libfirm diff --git a/ir/ana/callgraph.c b/ir/ana/callgraph.c index 696486805..a4eba6cc7 100644 --- a/ir/ana/callgraph.c +++ b/ir/ana/callgraph.c @@ -28,6 +28,8 @@ # include "config.h" #endif +#ifdef INTERPROCEDURAL_VIEW + #ifdef HAVE_STRING_H # include #endif @@ -79,6 +81,7 @@ ir_graph *get_irg_caller(ir_graph *irg, int pos) { return NULL; } +#ifdef INTERPROCEDURAL_VIEW /* 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) { assert (pos >= 0 && pos < get_irg_n_callers(irg)); @@ -110,6 +113,7 @@ int has_irg_caller_backedge(ir_graph *irg) { } return 0; } +#endif /** * Find the reversion position of a caller. @@ -172,6 +176,7 @@ int has_irg_callee_backedge(ir_graph *irg) { return 0; } +#ifdef INTERPROCEDURAL_VIEW /** * Mark the callee at position pos as a backedge. */ @@ -185,6 +190,7 @@ static void set_irg_callee_backedge(ir_graph *irg, int pos) { irg->callee_isbe = xcalloc(n, sizeof(irg->callee_isbe[0])); irg->callee_isbe[pos] = 1; } +#endif /* Returns the maximal loop depth of call nodes that call along this edge. */ int get_irg_callee_loop_depth(ir_graph *irg, int pos) { @@ -229,6 +235,7 @@ double get_irg_caller_method_execution_frequency(ir_graph *irg, int pos) { static void ana_Call(ir_node *n, void *env) { int i, n_callees; ir_graph *irg; + (void) env; if (! is_Call(n)) return; @@ -408,8 +415,10 @@ static ir_loop *current_loop; /**< Current cfloop construction is working static int loop_node_cnt = 0; /**< Counts the number of allocated cfloop nodes. Each cfloop node gets a unique number. What for? ev. remove. @@@ */ +#ifdef INTERPROCEDURAL_VIEW static int current_dfn = 1; /**< Counter to generate depth first numbering of visited nodes. */ +#endif /*-----------------*/ @@ -579,6 +588,7 @@ static INLINE void pop_scc_to_loop(ir_graph *irg) { } while(m != irg); } +#ifdef INTERPROCEDURAL_VIEW /* GL ??? my last son is my grandson??? Removes cfloops with no ir_nodes in them. Such loops have only another loop as son. (Why can't they have two loops as sons? Does it never get that far? ) */ @@ -604,6 +614,7 @@ static void close_loop(ir_loop *l) { current_loop = l; } +#endif /** * Removes and unmarks all nodes up to n from the stack. @@ -622,6 +633,7 @@ static INLINE void pop_scc_unmark_visit(ir_graph *n) { /* The loop data structure. **/ /**********************************************************************/ +#ifdef INTERPROCEDURAL_VIEW /** * Allocates a new loop as son of current_loop. Sets current_loop * to the new loop and returns the father. @@ -637,6 +649,7 @@ static ir_loop *new_loop(void) { son->children = NEW_ARR_F (loop_element, 0); son->n_nodes = 0; son->n_sons = 0; + son->link = NULL; if (father) { son->outer_loop = father; add_loop_son(father, son); @@ -648,7 +661,6 @@ static ir_loop *new_loop(void) { #ifdef DEBUG_libfirm son->loop_nr = get_irp_new_node_nr(); - son->link = NULL; #endif current_loop = son; @@ -737,7 +749,6 @@ is_endless_head(ir_graph *n, ir_graph *root) return !some_outof_loop & some_in_loop; } - /** * Check whether there is a parallel edge in the ip control flow. * Only @@ -945,7 +956,6 @@ find_tail(ir_graph *n) { } #endif - /*-----------------------------------------------------------* * The core algorithm. * *-----------------------------------------------------------*/ @@ -1040,6 +1050,7 @@ static void reset_isbe(void) { irg->callee_isbe = NULL; } } +#endif @@ -1181,6 +1192,7 @@ static void compute_rec_depth (ir_graph *irg, void *env) { /* nodes to evaluate a callgraph edge. */ /* ----------------------------------------------------------------------------------- */ +#ifdef INTERPROCEDURAL_VIEW /* Returns the method execution frequency of a graph. */ double get_irg_method_execution_frequency (ir_graph *irg) { return irg->method_execution_frequency; @@ -1202,6 +1214,7 @@ static void compute_method_execution_frequency(ir_graph *irg, void *env) { double freq; int found_edge; int n_callees; + (void) env; if (cg_irg_visited(irg)) return; @@ -1374,6 +1387,7 @@ void compute_performance_estimates(void) { } } } +#endif /* Returns the maximal loop depth of all paths from an external visible method to this irg. */ @@ -1422,3 +1436,5 @@ void set_irp_loop_nesting_depth_state_inconsistent(void) { if (irp->lnd_state == loop_nesting_depth_consistent) irp->lnd_state = loop_nesting_depth_inconsistent; } + +#endif