NDBT_ThreadSet::~NDBT_ThreadSet() { delete_output(); for (int n = 0; n < m_count; n++) { delete m_thread[n]; m_thread[n] = 0; } delete [] m_thread; }
int dead_code_node (FuncGraph *fg, int id) { int keep, i, g_id, port_num, deleted; /* printf ("entered 'dead_code_node', node %d\n", id); fflush (stdout); */ deleted = FALSE; if (is_simple_node (fg, id)) { keep = FALSE; switch (fg->nodes[id].nodetype) { case ND_G_OUTPUT : g_id = fg->nodes[id].My_graph; port_num = fg->nodes[id].Io_num; if (fg->nodes[g_id].outputs[port_num].targets != NULL) keep = TRUE; break; case ND_PRINT : case ND_ASSERT : case ND_SWITCH_KEY : case ND_SELECTORS : case ND_NEXT : case ND_SCALAR_GEN : case ND_ELE_GEN : case ND_SLICE_GEN : case ND_WINDOW_GEN : /* these nodes never have outputs, but we don't want to * eliminate them; ND_WHILE_PRED is not here because it's * a compound, not a simple node; */ return FALSE; default : for (i=0; i<fg->nodes[id].num_outputs; i++) if (fg->nodes[id].outputs[i].targets != NULL) { keep = TRUE; break; } } /* if it's not an input node, and it has no output targets, delete it */ if ((!keep) && (fg->nodes[id].nodetype!=ND_G_INPUT) && (fg->nodes[id].nodetype!=ND_G_INPUT_NEXT)) { remove_simple_node (fg, id); deleted = TRUE; } } else { /* here we're processing a compound node */ IntList *deleted_nodes, *it; /* first see if any of the outputs are dead */ if (fg->nodes[id].nodetype != ND_WHILE_PRED) for (i=0; i<fg->nodes[id].num_outputs; i++) if (fg->nodes[id].outputs[i].targets == NULL) delete_output (fg, id, i); /* remove dead code from the node's internal graph */ /* deleted_nodes = dead_code_process_list_reversed (fg, fg->nodes[id].My_nodes); */ deleted_nodes = dead_code_process_list_reversed (fg, fg->nodes[id].My_nodes); /* here we delete any input nodes that have no outputs */ delete_dead_graph_inputs (fg, id, &deleted_nodes); for (it=deleted_nodes; it!=NULL; it=it->link) delete_ele_from_intlist (it->val, &(fg->nodes[id].My_nodes)); free_intlist (&deleted_nodes); /* if the node has no outputs, delete the whole thing */ switch (fg->nodes[id].nodetype) { case ND_WHILE_PRED : case ND_CROSS_PROD : case ND_DOT_PROD : break; default : if (fg->nodes[id].nodetype != ND_WHILE_PRED) if (fg->nodes[id].num_outputs == 0) { delete_node (fg, id); deleted = TRUE; } } } /* printf ("leaving 'dead_code_node', node %d\n", id); fflush (stdout); */ return deleted; }