-
-/* Continue PTO for one of the graphs called at a Call */
-static void pto_call (ir_graph *graph, ir_node *call, pto_env_t *pto_env)
-{
- /* perform call */
- DBGPRINT (0, (stdout, "%s:%i (%s[%li])\n",
- __FUNCTION__, __LINE__, OPNAME (call), OPNUM (call)));
-
- /* only for debugging stuff: */
- entity *ent = get_irg_entity (graph);
- const char *ent_name = (char*) get_entity_name (ent);
- const char *own_name = (char*) get_type_name (get_entity_owner (ent));
-
- if (! get_irg_is_mem_visited (graph)) {
- graph_info_t *ginfo = ecg_get_info (graph);
-
- /* Save CTX */
- int ctx_idx = find_ctx_idx (call, ginfo, get_curr_ctx ());
- ctx_info_t *call_ctx = get_ctx (ginfo, ctx_idx);
- ctx_info_t *old_ctx = set_curr_ctx (call_ctx);
- DBGPRINT (2, (stdout, "%s>CTX: ", -- spaces));
- DBGEXE (2, ecg_print_ctx (call_ctx, stdout));
-
- /* Todo: Compute Arguments */
- set_graph_args (graph, call);
-
- /* Initialise Alloc Names and Node values (nope, done in pto_graph ()) */
- /* pto_reset_graph_pto (graph, ctx_idx); */
-
- /* Visit/Iterate Graph */
- pto_graph (graph, ctx_idx);
-
- /* Restore CTX */
- set_curr_ctx (old_ctx);
-
- set_graph_result (graph, call);
-
- DBGPRINT (2, (stdout, "%s<CTX: ", spaces ++));
- DBGEXE (2, ecg_print_ctx (call_ctx, stdout));
-
- /* Don't need to reset alloc names unless we handle recursion here */
-
-
- /* Get Return Value from Graph */
- } else {
- DBGPRINT (1, (stdout, "%s: recursion into \"%s.%s\"\n",
- __FUNCTION__, own_name, ent_name));
- }
-
- /* Todo: Set 'Unknown' Value as Return Value when the graph is not
- known */
-}
-
-static void pto_raise (ir_node *raise, pto_env_t *pto_env)
-{
- /* perform raise */
- DBGPRINT (1, (stdout, "%s (%s[%li]): pto = %p\n", __FUNCTION__,
- OPNAME (raise), OPNUM (raise), (void*) get_node_pto (raise)));
-}
-
-static void pto_end_block (ir_node *end_block, pto_env_t *pto_env)
-{
- /* perform end block */
- type *tp = get_entity_type (get_irg_entity (get_irn_irg (end_block)));
-
- if (0 == get_method_n_ress (tp)) {
- return;
- }
-
- tp = get_method_res_type (tp, 0);
-
- if (mode_P != get_type_mode (tp)) {
- return;
- }
-
- DBGPRINT (1, (stdout, "%s (%s[%li]): pto = %p\n", __FUNCTION__,
- OPNAME (end_block), OPNUM (end_block),
- (void*) get_node_pto (end_block)));
-
- pto_t *end_pto = get_node_pto (end_block);
-
- assert (end_pto);
-
- int n_ins = get_irn_arity (end_block);
- int i;
- for (i = 0; i < n_ins; i ++) {
- ir_node *in = get_irn_n (end_block, i);
-
- if (iro_Return == get_irn_opcode (in)) {
- pto_t *in_pto = get_pto (in);
-
- qset_insert_all (end_pto->values, in_pto->values);
- }
- }
-}
-