Commit 384e2aae authored by Matthias Braun's avatar Matthias Braun
Browse files

fix a few errors and warnings in the new pass code; improve some comments

[r26367]
parent ddfcdcb1
......@@ -65,7 +65,7 @@ int optimize_graph_df(ir_graph *irg);
*
* @return the newly created ir_graph pass
*/
ir_graph_pass_t *optimize_graph_df_pass(const char *name, int verify, int dump);
ir_graph_pass_t *optimize_graph_df_pass(const char *name);
/** Performs dead node elimination by copying the ir graph to a new obstack.
*
......
......@@ -53,7 +53,7 @@ void optimize_cf(ir_graph *irg);
*
* @return the newly created ir_graph pass
*/
ir_graph_pass_t *optimize_cf_pass(const char *name, int verify, int dump);
ir_graph_pass_t *optimize_cf_pass(const char *name);
/**
* Perform path-sensitive jump threading on the given graph.
......
......@@ -202,8 +202,7 @@ static int int_graph_wrapper(ir_graph *irg, void *context) {
/* Creates an ir_graph pass for running void function(ir_graph *irg). */
ir_graph_pass_t *def_graph_pass_ret(
const char *name, int verify, int dump,
int (*function)(ir_graph *irg))
const char *name, int (*function)(ir_graph *irg))
{
struct ir_graph_pass_t *pass = XMALLOCZ(ir_graph_pass_t);
......
......@@ -1591,8 +1591,10 @@ static int verify_node_Phi(ir_node *n, ir_graph *irg) {
int i;
(void) irg;
/* a Phi node MUST have the same number of inputs as its block
* Exception is a phi with 0 inputs which is used when (re)constructing the
* SSA form */
if (! is_Bad(block) && get_irg_phase_state(get_irn_irg(n)) != phase_building && get_irn_arity(n) > 0) {
/* a Phi node MUST have the same number of inputs as its block */
ASSERT_AND_RET_DBG(
get_irn_arity(n) == get_irn_arity(block),
"wrong number of inputs in Phi node", 0,
......
......@@ -173,6 +173,7 @@ struct pass_t {
static int pass_wrapper(ir_prog *irp, void *context)
{
struct pass_t *pass = context;
(void) irp; /* TODO: set current irp, or remove parameter */
lower_intrinsics(pass->list, pass->length, pass->part_block_used);
/* probably this pass should not run again */
return 0;
......
......@@ -2303,5 +2303,5 @@ int optimize_load_store(ir_graph *irg) {
ir_graph_pass_t *optimize_load_store_pass(const char *name)
{
return def_graph_pass(name ? name : "ldst", optimize_load_store);
return def_graph_pass_ret(name ? name : "ldst", optimize_load_store);
} /* optimize_load_store_pass */
......@@ -2409,5 +2409,5 @@ end:
ir_graph_pass_t *opt_ldst_pass(const char *name)
{
return def_graph_pass(name ? name : "ldst_df", opt_ldst);
return def_graph_pass_ret(name ? name : "ldst_df", opt_ldst);
} /* opt_ldst_pass */
......@@ -934,8 +934,8 @@ int optimize_reassociation(ir_graph *irg)
} /* optimize_reassociation */
/* create a pass for the reassociation */
ir_graph_pass_t *optimize_reassociation_pass(const char *name, int verify, int dump) {
return def_graph_pass_ret(name ? name : "reassoc", verify, dump, optimize_reassociation);
ir_graph_pass_t *optimize_reassociation_pass(const char *name) {
return def_graph_pass_ret(name ? name : "reassoc", optimize_reassociation);
} /* optimize_reassociation_pass */
/* Sets the default reassociation operation for an ir_op_ops. */
......
......@@ -30,6 +30,7 @@
#include "ircons_t.h"
#include "irnode_t.h"
#include "irgmod.h"
#include "irtools.h"
#define set_bit(n) (returns[(n) >> 3] |= 1 << ((n) & 7))
#define get_bit(n) (returns[(n) >> 3] & (1 << ((n) & 7)))
......@@ -167,9 +168,9 @@ void normalize_one_return(ir_graph *irg) {
}
/* Create a graph pass. */
ir_graph_pass_t *normalize_one_return_pass(const char *name, int verify, int dump)
ir_graph_pass_t *normalize_one_return_pass(const char *name)
{
return def_graph_pass(name ? name : "one_ret", verify, dump, normalize_one_return);
return def_graph_pass(name ? name : "one_ret", normalize_one_return);
}
/**
......
......@@ -772,7 +772,8 @@ int scalar_replacement_opt(ir_graph *irg) {
}
ir_graph_pass_t *scalar_replacement_opt_pass(const char *name) {
return def_graph_pass(name ? name : "scalar_rep", scalar_replacement_opt);
return def_graph_pass_ret(name ? name : "scalar_rep",
scalar_replacement_opt);
}
void firm_init_scalar_replace(void) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment