#include "trouts.h"
#include "irgwalk.h"
#include "set.h"
+#include "irpass.h"
#include "debug.h"
/* define this for general block shaping: congruent blocks
if (is_op_forking(cfop)) {
/* a critical edge */
ir_node *block = new_r_Block(irg, 1, &ins[i]);
- ir_node *jmp = new_r_Jmp(irg, block);
+ ir_node *jmp = new_r_Jmp(block);
ins[i] = jmp;
}
}
for (repr_pair = repr->input_pairs; repr_pair != NULL; repr_pair = repr_pair->next) {
ir_node *input = get_irn_n(repr_pair->irn, repr_pair->index);
ir_mode *mode = get_irn_mode(input);
- ir_node *phi = new_r_Phi(current_ir_graph, block, n, repr_pair->ins, mode);
+ ir_node *phi = new_r_Phi(block, n, repr_pair->ins, mode);
set_irn_n(repr_pair->irn, repr_pair->index, phi);
DEL_ARR_F(repr_pair->ins);
* Compare two nodes for root ordering.
*/
static int cmp_nodes(const void *a, const void *b) {
- ir_node *const *pa = a;
- ir_node *const *pb = b;
+ const ir_node *const *pa = a;
+ const ir_node *const *pb = b;
const ir_node *irn_a = *pa;
const ir_node *irn_b = *pb;
ir_opcode code_a = get_irn_opcode(irn_a);
return res;
} /* shape_blocks */
+
+ir_graph_pass_t *shape_blocks_pass(const char *name) {
+ return def_graph_pass_ret(name ? name : "shape_blocks", shape_blocks);
+} /* shape_blocks_pass */