Commit a3f5aabc authored by Matthias Braun's avatar Matthias Braun
Browse files

- generate more stuff from ir_spec.py

- make some functions consistent: new_r(d)_Unknown, new_r(d)_Dummy
   actually take graphs and debug infos now

[r25919]
parent 6bc244c5
......@@ -1948,7 +1948,7 @@ ir_node *new_rd_Confirm (dbg_info *db, ir_graph *irg, ir_node *block,
* @param *irg The IR graph the node belongs to.
* @param *m The mode of the unknown value.
*/
ir_node *new_rd_Unknown(ir_graph *irg, ir_mode *m);
ir_node *new_rd_Unknown(dbg_info *db, ir_graph *irg, ir_mode *m);
/** Constructor for a CallBegin node.
*
......@@ -3602,7 +3602,7 @@ ir_node *new_d_Confirm (dbg_info *db, ir_node *val, ir_node *bound, pn_Cmp cmp);
*
* @param *m The mode of the unknown value.
*/
ir_node *new_d_Unknown(ir_mode *m);
ir_node *new_d_Unknown(dbg_info *db, ir_mode *m);
/** Constructor for a CallBegin node.
*
......@@ -4507,6 +4507,10 @@ ir_node *new_ASM(int arity, ir_node *in[], ir_asm_constraint *inputs,
*/
ir_node *new_Dummy(ir_mode *mode);
ir_node *new_r_Dummy(ir_graph *irg, ir_mode *mode);
ir_node *new_rd_Dummy(dbg_info *db, ir_graph *irg, ir_mode *mode);
/*---------------------------------------------------------------------*/
/* The comfortable interface. */
/* Supports automatic Phi node construction. */
......
......@@ -1179,7 +1179,7 @@ void set_Bound_upper(ir_node *bound, ir_node *upper);
/** Return the operand of a Pin node. */
ir_node *get_Pin_op(const ir_node *pin);
void set_Pin_op(ir_node *pin, ir_node *node);
void set_Pin_op(ir_node *pin, ir_node *node);
/** Return the assembler text of an ASM pseudo node. */
ident *get_ASM_text(const ir_node *node);
......
......@@ -680,7 +680,7 @@ static ir_node *adjust_call(be_abi_irg_t *env, ir_node *irn, ir_node *curr_sp)
ir_node *regnode = be_abi_reg_map_get(env->regs, reg);
ir_fprintf(stderr, "Adding %+F\n", regnode);
#endif
ir_node *regnode = new_rd_Unknown(irg, arch_register_class_mode(cls));
ir_node *regnode = new_r_Unknown(irg, arch_register_class_mode(cls));
obstack_ptr_grow(obst, regnode);
}
n_ins = n_reg_params + pset_new_size(&states);
......
......@@ -204,6 +204,7 @@ new_bd_Block(dbg_info *db, int arity, ir_node **in) {
return res;
} /* new_bd_Block */
#endif
static ir_node *
new_bd_Start(dbg_info *db, ir_node *block) {
ir_node *res;
......@@ -225,7 +226,6 @@ new_bd_End(dbg_info *db, ir_node *block) {
IRN_VRFY_IRG(res, irg);
return res;
} /* new_bd_End */
#endif
/**
* Creates a Phi node with all predecessors. Calling this constructor
......@@ -896,6 +896,8 @@ new_rd_Block(dbg_info *db, ir_graph *irg, int arity, ir_node **in) {
return res;
} /* new_rd_Block */
#endif
ir_node *
new_rd_Start(dbg_info *db, ir_graph *irg, ir_node *block) {
ir_graph *rem = current_ir_graph;
......@@ -919,7 +921,6 @@ new_rd_End(dbg_info *db, ir_graph *irg, ir_node *block) {
return res;
} /* new_rd_End */
#endif
/* Creates a Phi node with all predecessors. Calling this constructor
is only allowed if the corresponding block is mature. */
......@@ -1507,12 +1508,6 @@ ir_node *new_rd_ASM(dbg_info *db, ir_graph *irg, ir_node *block,
ir_node *new_r_Block(ir_graph *irg, int arity, ir_node **in) {
return new_rd_Block(NULL, irg, arity, in);
}
ir_node *new_r_Start(ir_graph *irg, ir_node *block) {
return new_rd_Start(NULL, irg, block);
}
ir_node *new_r_End(ir_graph *irg, ir_node *block) {
return new_rd_End(NULL, irg, block);
}
ir_node *new_r_Jmp(ir_graph *irg, ir_node *block) {
return new_rd_Jmp(NULL, irg, block);
}
......@@ -1527,6 +1522,12 @@ ir_node *new_r_Return(ir_graph *irg, ir_node *block,
return new_rd_Return(NULL, irg, block, store, arity, in);
}
#endif
ir_node *new_r_Start(ir_graph *irg, ir_node *block) {
return new_rd_Start(NULL, irg, block);
}
ir_node *new_r_End(ir_graph *irg, ir_node *block) {
return new_rd_End(NULL, irg, block);
}
ir_node *new_r_Const(ir_graph *irg, tarval *con) {
return new_rd_Const(NULL, irg, con);
}
......@@ -1783,29 +1784,6 @@ ir_node *new_r_ASM(ir_graph *irg, ir_node *block,
*
*
*/
ir_node *
new_d_Start(dbg_info *db) {
ir_node *res;
res = new_ir_node(db, current_ir_graph, current_ir_graph->current_block,
op_Start, mode_T, 0, NULL);
res = optimize_node(res);
IRN_VRFY_IRG(res, current_ir_graph);
return res;
} /* new_d_Start */
ir_node *
new_d_End(dbg_info *db) {
ir_node *res;
res = new_ir_node(db, current_ir_graph, current_ir_graph->current_block,
op_End, mode_X, -1, NULL);
res = optimize_node(res);
IRN_VRFY_IRG(res, current_ir_graph);
return res;
} /* new_d_End */
/* Constructs a Block with a fixed number of predecessors.
Does set current_block. Can be used with automatic Phi
node construction. */
......@@ -1844,6 +1822,29 @@ new_d_Block(dbg_info *db, int arity, ir_node **in) {
} /* new_d_Block */
#endif
ir_node *
new_d_Start(dbg_info *db) {
ir_node *res;
res = new_ir_node(db, current_ir_graph, current_ir_graph->current_block,
op_Start, mode_T, 0, NULL);
res = optimize_node(res);
IRN_VRFY_IRG(res, current_ir_graph);
return res;
} /* new_d_Start */
ir_node *
new_d_End(dbg_info *db) {
ir_node *res;
res = new_ir_node(db, current_ir_graph, current_ir_graph->current_block,
op_End, mode_X, -1, NULL);
res = optimize_node(res);
IRN_VRFY_IRG(res, current_ir_graph);
return res;
} /* new_d_End */
/* ***********************************************************************/
/* Methods necessary for automatic Phi node creation */
/*
......@@ -2964,12 +2965,6 @@ irp_finalize_cons(void) {
ir_node *new_Block(int arity, ir_node **in) {
return new_d_Block(NULL, arity, in);
}
ir_node *new_Start(void) {
return new_d_Start(NULL);
}
ir_node *new_End(void) {
return new_d_End(NULL);
}
ir_node *new_Jmp(void) {
return new_d_Jmp(NULL);
}
......@@ -2983,6 +2978,12 @@ ir_node *new_Return(ir_node *store, int arity, ir_node *in[]) {
return new_d_Return(NULL, store, arity, in);
}
#endif
ir_node *new_Start(void) {
return new_d_Start(NULL);
}
ir_node *new_End(void) {
return new_d_End(NULL);
}
ir_node *new_Const(tarval *con) {
return new_d_Const(NULL, con);
}
......@@ -3182,9 +3183,14 @@ ir_node *new_Pin(ir_node *node) {
return new_d_Pin(NULL, node);
}
#endif
ir_node *new_Dummy(ir_mode *m) {
ir_graph *irg = current_ir_graph;
return new_ir_node(NULL, irg, get_irg_start_block(irg), op_Dummy, m, 0, NULL);
ir_node *new_rd_Dummy(dbg_info *db, ir_graph *irg, ir_mode *mode) {
return new_ir_node(db, irg, get_irg_start_block(irg), op_Dummy, mode, 0, NULL);
}
ir_node *new_r_Dummy(ir_graph *irg, ir_mode *mode) {
return new_rd_Dummy(NULL, irg, mode);
}
ir_node *new_Dummy(ir_mode *mode) {
return new_r_Dummy(current_ir_graph, mode);
}
ir_node *new_ASM(int arity, ir_node *in[], ir_asm_constraint *inputs,
int n_outs, ir_asm_constraint *outputs,
......
......@@ -1739,11 +1739,6 @@ set_binop_right(ir_node *node, ir_node *right) {
set_irn_n(node, node->op->op_index + 1, right);
}
int
(is_Phi)(const ir_node *n) {
return _is_Phi(n);
}
int is_Phi0(const ir_node *n) {
assert(n);
......@@ -2690,310 +2685,22 @@ void skip_Id_and_store(ir_node **node) {
*node = skip_Id(n);
}
int
(is_Bad)(const ir_node *node) {
return _is_Bad(node);
}
int
(is_NoMem)(const ir_node *node) {
return _is_NoMem(node);
}
int
(is_Minus)(const ir_node *node) {
return _is_Minus(node);
}
int
(is_Abs)(const ir_node *node) {
return _is_Abs(node);
}
int
(is_Mod)(const ir_node *node) {
return _is_Mod(node);
}
int
(is_Div)(const ir_node *node) {
return _is_Div(node);
}
int
(is_DivMod)(const ir_node *node) {
return _is_DivMod(node);
}
int
(is_Quot)(const ir_node *node) {
return _is_Quot(node);
}
int
(is_Add)(const ir_node *node) {
return _is_Add(node);
}
int
(is_Carry)(const ir_node *node) {
return _is_Carry(node);
}
int
(is_And)(const ir_node *node) {
return _is_And(node);
}
int
(is_Or)(const ir_node *node) {
return _is_Or(node);
}
int
(is_Eor)(const ir_node *node) {
return _is_Eor(node);
}
int
(is_Sub)(const ir_node *node) {
return _is_Sub(node);
}
int
(is_Shl)(const ir_node *node) {
return _is_Shl(node);
}
int
(is_Shr)(const ir_node *node) {
return _is_Shr(node);
}
int
(is_Shrs)(const ir_node *node) {
return _is_Shrs(node);
}
int
(is_Rotl)(const ir_node *node) {
return _is_Rotl(node);
}
int
(is_Not)(const ir_node *node) {
return _is_Not(node);
}
int
(is_Id)(const ir_node *node) {
return _is_Id(node);
}
int
(is_Tuple)(const ir_node *node) {
return _is_Tuple(node);
}
int
(is_Bound)(const ir_node *node) {
return _is_Bound(node);
}
int
(is_Start)(const ir_node *node) {
return _is_Start(node);
}
int
(is_End)(const ir_node *node) {
return _is_End(node);
}
int
(is_Const)(const ir_node *node) {
return _is_Const(node);
}
int
(is_Conv)(const ir_node *node) {
return _is_Conv(node);
}
int
(is_strictConv)(const ir_node *node) {
return _is_strictConv(node);
}
int
(is_Cast)(const ir_node *node) {
return _is_Cast(node);
}
int
(is_no_Block)(const ir_node *node) {
return _is_no_Block(node);
}
int
(is_Block)(const ir_node *node) {
return _is_Block(node);
}
/* returns true if node is an Unknown node. */
int
(is_Unknown)(const ir_node *node) {
return _is_Unknown(node);
}
/* returns true if node is a Return node. */
int
(is_Return)(const ir_node *node) {
return _is_Return(node);
}
/* returns true if node is a Call node. */
int
(is_Call)(const ir_node *node) {
return _is_Call(node);
}
/* returns true if node is a Builtin node. */
int
(is_Builtin)(const ir_node *node) {
return _is_Builtin(node);
}
/* returns true if node is a CallBegin node. */
int
(is_CallBegin)(const ir_node *node) {
return _is_CallBegin(node);
}
/* returns true if node is a Sel node. */
int
(is_Sel)(const ir_node *node) {
return _is_Sel(node);
}
/* returns true if node is a Mux node. */
int
(is_Mux)(const ir_node *node) {
return _is_Mux(node);
}
/* returns true if node is a Load node. */
int
(is_Load)(const ir_node *node) {
return _is_Load(node);
}
/* returns true if node is a Load node. */
int
(is_Store)(const ir_node *node) {
return _is_Store(node);
}
/* returns true if node is a Sync node. */
int
(is_Sync)(const ir_node *node) {
return _is_Sync(node);
}
/* Returns true if node is a Confirm node. */
int
(is_Confirm)(const ir_node *node) {
return _is_Confirm(node);
}
/* Returns true if node is a Pin node. */
int
(is_Pin)(const ir_node *node) {
return _is_Pin(node);
}
/* Returns true if node is a SymConst node. */
int
(is_SymConst)(const ir_node *node) {
return _is_SymConst(node);
}
/* Returns true if node is a SymConst node with kind symconst_addr_ent. */
int
(is_SymConst_addr_ent)(const ir_node *node) {
return _is_SymConst_addr_ent(node);
}
/* Returns true if node is a Cond node. */
int
(is_Cond)(const ir_node *node) {
return _is_Cond(node);
}
int
(is_CopyB)(const ir_node *node) {
return _is_CopyB(node);
}
/* returns true if node is a Cmp node. */
int
(is_Cmp)(const ir_node *node) {
return _is_Cmp(node);
}
/* returns true if node is an Alloc node. */
int
(is_Alloc)(const ir_node *node) {
return _is_Alloc(node);
}
/* returns true if node is a Free node. */
int
(is_Free)(const ir_node *node) {
return _is_Free(node);
}
/* returns true if a node is a Jmp node. */
int
(is_Jmp)(const ir_node *node) {
return _is_Jmp(node);
}
/* returns true if a node is a IJmp node. */
int
(is_IJmp)(const ir_node *node) {
return _is_IJmp(node);
}
/* returns true if a node is a Raise node. */
int
(is_Raise)(const ir_node *node) {
return _is_Raise(node);
}
/* returns true if a node is an ASM node. */
int
(is_ASM)(const ir_node *node) {
return _is_ASM(node);
}
/* returns true if a node is an Dummy node. */
int
(is_Dummy)(const ir_node *node) {
return _is_Dummy(node);
}
int
(is_Proj)(const ir_node *node) {
return _is_Proj(node);
}
/* Returns true if node is a Filter node. */
int
(is_Filter)(const ir_node *node) {
return _is_Filter(node);
}
/* Returns true if the operation manipulates control flow. */
int is_cfop(const ir_node *node) {
return is_op_cfopcode(get_irn_op(node));
......@@ -3258,3 +2965,6 @@ unsigned firm_default_hash(const ir_node *node) {
return h;
} /* firm_default_hash */
/* include generated code */
#include "gen_irnode.c.inl"
......@@ -403,6 +403,9 @@ _is_irn_pinned_in_irg(const ir_node *node) {
return op_pin_state_pinned;
}
/* include generated code */
#include "gen_irnode.h"
static inline int
_is_unop(const ir_node *node) {
assert(node && _is_ir_node(node));
......@@ -439,357 +442,22 @@ _is_Proj(const ir_node *node) {
return (op == op_Proj);
}
static inline int
_is_Filter(const ir_node *node) {
assert(node);
return (_get_irn_op(node) == op_Filter);
}
static inline int
_is_Bad(const ir_node *node) {
assert(node);
return (_get_irn_op(node) == op_Bad);
}
static inline int
_is_NoMem(const ir_node *node) {
assert(node);
return (_get_irn_op(node) == op_NoMem);
}
static inline int
_is_Minus(const ir_node *node) {
assert(node);
return (_get_irn_op(node) == op_Minus);
}
static inline int
_is_Abs(const ir_node *node) {
assert(node);
return (_get_irn_op(node) == op_Abs);
}
static inline int
_is_Mod(const ir_node *node) {
assert(node);
return (_get_irn_op(node) == op_Mod);
}
static inline int
_is_Div(const ir_node *node) {
assert(node);
return (_get_irn_op(node) == op_Div);
}
static inline int
_is_DivMod(const ir_node *node) {
assert(node);
return (_get_irn_op(node) == op_DivMod);
}
static inline int
_is_Quot(const ir_node *node) {
assert(node);
return (_get_irn_op(node) == op_Quot);
}
static inline int
_is_Add(const ir_node *node) {
assert(node);
return (_get_irn_op(node) == op_Add);
}
static inline int
_is_Carry(const ir_node *node) {
assert(node);
return (_get_irn_op(node) == op_Carry);
}
static inline int
_is_Borrow(const ir_node *node) {
assert(node);
return (_get_irn_op(node) == op_Borrow);
}
static inline int
_is_And(const ir_node *node) {
assert(node);
return (_get_irn_op(node) == op_And);
}
static inline int
_is_Or(const ir_node *node) {
assert(node);
return (_get_irn_op(node) == op_Or);
}