/*
- * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved.
- *
* This file is part of libFirm.
- *
- * This file may be distributed and/or modified under the terms of the
- * GNU General Public License version 2 as published by the Free Software
- * Foundation and appearing in the file LICENSE.GPL included in the
- * packaging of this file.
- *
- * Licensees holding valid libFirm Professional Edition licenses may use
- * this file in accordance with the libFirm Commercial License.
- * Agreement provided with the Software.
- *
- * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
- * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE.
+ * Copyright (C) 2012 University of Karlsruhe.
*/
/**
int n_rets = 0;
bool filter_dbgi = false;
dbg_info *combined_dbgi = NULL;
- unsigned *returns;
int i, j, k, n, last_idx;
ir_node **in, **retvals, **endbl_in;
ir_node *block;
if (n <= 0) {
/* The end block has no predecessors, we have an endless
loop. In that case, no returns exists. */
+ confirm_irg_properties(irg, IR_GRAPH_PROPERTIES_ALL);
+ add_irg_properties(irg, IR_GRAPH_PROPERTY_ONE_RETURN);
return;
}
- rbitset_alloca(returns, n);
-
+ unsigned *const returns = rbitset_alloca(n);
for (i = 0; i < n; ++i) {
ir_node *node = get_Block_cfgpred(endbl, i);
}
}
- if (n_rets <= 1)
+ if (n_rets <= 1) {
+ confirm_irg_properties(irg, IR_GRAPH_PROPERTIES_ALL);
+ add_irg_properties(irg, IR_GRAPH_PROPERTY_ONE_RETURN);
return;
+ }
in = ALLOCAN(ir_node*, MAX(n_rets, n_ret_vals));
retvals = ALLOCAN(ir_node*, n_rets * n_ret_vals);
/* invalidate analysis information:
* a new Block was added, so dominator, outs and loop are inconsistent,
- * trouts and callee-state should be still valid
- */
- clear_irg_state(irg, IR_GRAPH_STATE_CONSISTENT_DOMINANCE);
+ * trouts and callee-state should be still valid */
+ confirm_irg_properties(irg,
+ IR_GRAPH_PROPERTY_NO_BADS
+ | IR_GRAPH_PROPERTY_NO_TUPLES
+ | IR_GRAPH_PROPERTY_NO_CRITICAL_EDGES
+ | IR_GRAPH_PROPERTY_NO_UNREACHABLE_CODE
+ | IR_GRAPH_PROPERTY_CONSISTENT_ENTITY_USAGE);
+ add_irg_properties(irg, IR_GRAPH_PROPERTY_ONE_RETURN);
}
/* Create a graph pass. */
}
}
- if (n_rets == 0)
+ if (n_rets == 0) {
+ confirm_irg_properties(irg, IR_GRAPH_PROPERTIES_ALL);
+ add_irg_properties(irg, IR_GRAPH_PROPERTY_MANY_RETURNS);
return;
+ }
/*
* Now move the Returns upwards. We move always one block up (and create n
/* Invalidate analysis information:
* Blocks become dead and new Returns were deleted, so dominator, outs and
* loop are inconsistent, trouts and callee-state should be still valid */
- clear_irg_state(irg, IR_GRAPH_STATE_CONSISTENT_DOMINANCE
- | IR_GRAPH_STATE_CONSISTENT_POSTDOMINANCE
- | IR_GRAPH_STATE_ONE_RETURN
- | IR_GRAPH_STATE_CONSISTENT_OUTS
- | IR_GRAPH_STATE_NO_UNREACHABLE_CODE
- | IR_GRAPH_STATE_NO_BADS);
+ confirm_irg_properties(irg,
+ IR_GRAPH_PROPERTY_NO_TUPLES
+ | IR_GRAPH_PROPERTY_NO_CRITICAL_EDGES
+ | IR_GRAPH_PROPERTY_CONSISTENT_ENTITY_USAGE);
+ add_irg_properties(irg, IR_GRAPH_PROPERTY_MANY_RETURNS);
}
/* Create a graph pass. */