Commit 3305fdae authored by Michael Beck's avatar Michael Beck
Browse files

get_Pin_op() and set_Pin_op() added

[r8083]
parent ecda0ef2
......@@ -323,7 +323,7 @@ void
modecode
get_irn_modecode (const ir_node *node)
{
assert (node);
assert(node);
return node->mode->code;
}
......@@ -472,84 +472,84 @@ long get_irn_node_nr(const ir_node *node) {
const_attr
get_irn_const_attr (ir_node *node)
{
assert (node->op == op_Const);
assert(node->op == op_Const);
return node->attr.con;
}
long
get_irn_proj_attr (ir_node *node)
{
assert (node->op == op_Proj);
assert(node->op == op_Proj);
return node->attr.proj;
}
alloc_attr
get_irn_alloc_attr (ir_node *node)
{
assert (node->op == op_Alloc);
assert(node->op == op_Alloc);
return node->attr.alloc;
}
free_attr
get_irn_free_attr (ir_node *node)
{
assert (node->op == op_Free);
assert(node->op == op_Free);
return node->attr.free;
}
symconst_attr
get_irn_symconst_attr (ir_node *node)
{
assert (node->op == op_SymConst);
assert(node->op == op_SymConst);
return node->attr.symc;
}
ir_type *
get_irn_call_attr (ir_node *node)
{
assert (node->op == op_Call);
assert(node->op == op_Call);
return node->attr.call.cld_tp = skip_tid(node->attr.call.cld_tp);
}
sel_attr
get_irn_sel_attr (ir_node *node)
{
assert (node->op == op_Sel);
assert(node->op == op_Sel);
return node->attr.sel;
}
int
get_irn_phi_attr (ir_node *node)
{
assert (node->op == op_Phi);
assert(node->op == op_Phi);
return node->attr.phi0_pos;
}
block_attr
get_irn_block_attr (ir_node *node)
{
assert (node->op == op_Block);
assert(node->op == op_Block);
return node->attr.block;
}
load_attr
get_irn_load_attr (ir_node *node)
{
assert (node->op == op_Load);
assert(node->op == op_Load);
return node->attr.load;
}
store_attr
get_irn_store_attr (ir_node *node)
{
assert (node->op == op_Store);
assert(node->op == op_Store);
return node->attr.store;
}
except_attr
get_irn_except_attr (ir_node *node)
{
assert (node->op == op_Div || node->op == op_Quot ||
assert(node->op == op_Div || node->op == op_Quot ||
node->op == op_DivMod || node->op == op_Mod || node->op == op_Call || node->op == op_Alloc);
return node->attr.except;
}
......@@ -578,14 +578,14 @@ int get_irn_pred_pos(ir_node *node, ir_node *arg) {
/* this works for all except Block */
ir_node *
get_nodes_block (const ir_node *node) {
assert (!(node->op == op_Block));
assert (is_irn_pinned_in_irg(node) && "block info may be incorrect");
assert(!(node->op == op_Block));
assert(is_irn_pinned_in_irg(node) && "block info may be incorrect");
return get_irn_n(node, -1);
}
void
set_nodes_block (ir_node *node, ir_node *block) {
assert (!(node->op == op_Block));
assert(!(node->op == op_Block));
set_irn_n(node, -1, block);
}
......@@ -642,7 +642,7 @@ int is_value_arg_pointer(ir_node *n) {
ir_node **
get_Block_cfgpred_arr (ir_node *node)
{
assert ((node->op == op_Block));
assert((node->op == op_Block));
return (ir_node **)&(get_irn_in(node)[1]);
}
......@@ -658,7 +658,7 @@ ir_node *
void
set_Block_cfgpred (ir_node *node, int pos, ir_node *pred) {
assert (node->op == op_Block);
assert(node->op == op_Block);
set_irn_n(node, pos, pred);
}
......@@ -669,13 +669,13 @@ ir_node *
int
get_Block_matured (ir_node *node) {
assert (node->op == op_Block);
assert(node->op == op_Block);
return (int)node->attr.block.matured;
}
void
set_Block_matured (ir_node *node, int matured) {
assert (node->op == op_Block);
assert(node->op == op_Block);
node->attr.block.matured = matured;
}
......@@ -702,13 +702,13 @@ int
ir_node *
get_Block_graph_arr (ir_node *node, int pos) {
assert (node->op == op_Block);
assert(node->op == op_Block);
return node->attr.block.graph_arr[pos+1];
}
void
set_Block_graph_arr (ir_node *node, int pos, ir_node *value) {
assert (node->op == op_Block);
assert(node->op == op_Block);
node->attr.block.graph_arr[pos+1] = value;
}
......@@ -781,13 +781,13 @@ void set_Block_extbb(ir_node *block, ir_extblk *extblk) {
int
get_End_n_keepalives(ir_node *end) {
assert (end->op == op_End);
assert(end->op == op_End);
return (get_irn_arity(end) - END_KEEPALIVE_OFFSET);
}
ir_node *
get_End_keepalive(ir_node *end, int pos) {
assert (end->op == op_End);
assert(end->op == op_End);
return get_irn_n(end, pos + END_KEEPALIVE_OFFSET);
}
......@@ -804,7 +804,7 @@ add_End_keepalive (ir_node *end, ir_node *ka) {
void
set_End_keepalive(ir_node *end, int pos, ir_node *ka) {
assert (end->op == op_End);
assert(end->op == op_End);
set_irn_n(end, pos + END_KEEPALIVE_OFFSET, ka);
}
......@@ -827,7 +827,7 @@ void set_End_keepalives(ir_node *end, int n, ir_node *in[]) {
void
free_End (ir_node *end) {
assert (end->op == op_End);
assert(end->op == op_End);
end->kind = k_BAD;
DEL_ARR_F(end->in);
end->in = NULL; /* @@@ make sure we get an error if we use the
......@@ -879,56 +879,56 @@ dataflow analysis and 3) does not allow to convert the representation to
*/
ir_node *
get_Cond_selector (ir_node *node) {
assert (node->op == op_Cond);
assert(node->op == op_Cond);
return get_irn_n(node, 0);
}
void
set_Cond_selector (ir_node *node, ir_node *selector) {
assert (node->op == op_Cond);
assert(node->op == op_Cond);
set_irn_n(node, 0, selector);
}
cond_kind
get_Cond_kind (ir_node *node) {
assert (node->op == op_Cond);
assert(node->op == op_Cond);
return node->attr.cond.kind;
}
void
set_Cond_kind (ir_node *node, cond_kind kind) {
assert (node->op == op_Cond);
assert(node->op == op_Cond);
node->attr.cond.kind = kind;
}
long
get_Cond_defaultProj (ir_node *node) {
assert (node->op == op_Cond);
assert(node->op == op_Cond);
return node->attr.cond.default_proj;
}
ir_node *
get_Return_mem (ir_node *node) {
assert (node->op == op_Return);
assert(node->op == op_Return);
return get_irn_n(node, 0);
}
void
set_Return_mem (ir_node *node, ir_node *mem) {
assert (node->op == op_Return);
assert(node->op == op_Return);
set_irn_n(node, 0, mem);
}
int
get_Return_n_ress (ir_node *node) {
assert (node->op == op_Return);
assert(node->op == op_Return);
return (get_irn_arity(node) - RETURN_RESULT_OFFSET);
}
ir_node **
get_Return_res_arr (ir_node *node)
{
assert ((node->op == op_Return));
assert((node->op == op_Return));
if (get_Return_n_ress(node) > 0)
return (ir_node **)&(get_irn_in(node)[1 + RETURN_RESULT_OFFSET]);
else
......@@ -938,20 +938,20 @@ get_Return_res_arr (ir_node *node)
/*
void
set_Return_n_res (ir_node *node, int results) {
assert (node->op == op_Return);
assert(node->op == op_Return);
}
*/
ir_node *
get_Return_res (ir_node *node, int pos) {
assert (node->op == op_Return);
assert (get_Return_n_ress(node) > pos);
assert(node->op == op_Return);
assert(get_Return_n_ress(node) > pos);
return get_irn_n(node, pos + RETURN_RESULT_OFFSET);
}
void
set_Return_res (ir_node *node, int pos, ir_node *res){
assert (node->op == op_Return);
assert(node->op == op_Return);
set_irn_n(node, pos + RETURN_RESULT_OFFSET, res);
}
......@@ -961,7 +961,7 @@ tarval *(get_Const_tarval)(ir_node *node) {
void
set_Const_tarval (ir_node *node, tarval *con) {
assert (node->op == op_Const);
assert(node->op == op_Const);
node->attr.con.tv = con;
}
......@@ -976,16 +976,16 @@ cnst_classify_t (classify_Const)(ir_node *node)
entity type. */
ir_type *
get_Const_type (ir_node *node) {
assert (node->op == op_Const);
assert(node->op == op_Const);
return node->attr.con.tp;
}
void
set_Const_type (ir_node *node, ir_type *tp) {
assert (node->op == op_Const);
assert(node->op == op_Const);
if (tp != firm_unknown_type) {
assert (is_atomic_type(tp));
assert (get_type_mode(tp) == get_irn_mode(node));
assert(is_atomic_type(tp));
assert(get_type_mode(tp) == get_irn_mode(node));
}
node->attr.con.tp = tp;
}
......@@ -993,13 +993,13 @@ set_Const_type (ir_node *node, ir_type *tp) {
symconst_kind
get_SymConst_kind (const ir_node *node) {
assert (node->op == op_SymConst);
assert(node->op == op_SymConst);
return node->attr.symc.num;
}
void
set_SymConst_kind (ir_node *node, symconst_kind num) {
assert (node->op == op_SymConst);
assert(node->op == op_SymConst);
node->attr.symc.num = num;
}
......@@ -1019,14 +1019,14 @@ set_SymConst_type (ir_node *node, ir_type *tp) {
ident *
get_SymConst_name (ir_node *node) {
assert ( (node->op == op_SymConst)
assert( (node->op == op_SymConst)
&& (get_SymConst_kind(node) == symconst_addr_name));
return node->attr.symc.sym.ident_p;
}
void
set_SymConst_name (ir_node *node, ident *name) {
assert ( (node->op == op_SymConst)
assert( (node->op == op_SymConst)
&& (get_SymConst_kind(node) == symconst_addr_name));
node->attr.symc.sym.ident_p = name;
}
......@@ -1034,88 +1034,88 @@ set_SymConst_name (ir_node *node, ident *name) {
/* Only to access SymConst of kind symconst_addr_ent. Else assertion: */
entity *get_SymConst_entity (ir_node *node) {
assert ( (node->op == op_SymConst)
assert( (node->op == op_SymConst)
&& (get_SymConst_kind (node) == symconst_addr_ent));
return node->attr.symc.sym.entity_p;
}
void set_SymConst_entity (ir_node *node, entity *ent) {
assert ( (node->op == op_SymConst)
assert( (node->op == op_SymConst)
&& (get_SymConst_kind(node) == symconst_addr_ent));
node->attr.symc.sym.entity_p = ent;
}
ir_enum_const *get_SymConst_enum (ir_node *node) {
assert ( (node->op == op_SymConst)
assert( (node->op == op_SymConst)
&& (get_SymConst_kind (node) == symconst_enum_const));
return node->attr.symc.sym.enum_p;
}
void set_SymConst_enum (ir_node *node, ir_enum_const *ec) {
assert ( (node->op == op_SymConst)
assert( (node->op == op_SymConst)
&& (get_SymConst_kind(node) == symconst_enum_const));
node->attr.symc.sym.enum_p = ec;
}
union symconst_symbol
get_SymConst_symbol (ir_node *node) {
assert (node->op == op_SymConst);
assert(node->op == op_SymConst);
return node->attr.symc.sym;
}
void
set_SymConst_symbol (ir_node *node, union symconst_symbol sym) {
assert (node->op == op_SymConst);
assert(node->op == op_SymConst);
node->attr.symc.sym = sym;
}
ir_type *
get_SymConst_value_type (ir_node *node) {
assert (node->op == op_SymConst);
assert(node->op == op_SymConst);
if (node->attr.symc.tp) node->attr.symc.tp = skip_tid(node->attr.symc.tp);
return node->attr.symc.tp;
}
void
set_SymConst_value_type (ir_node *node, ir_type *tp) {
assert (node->op == op_SymConst);
assert(node->op == op_SymConst);
node->attr.symc.tp = tp;
}
ir_node *
get_Sel_mem (ir_node *node) {
assert (node->op == op_Sel);
assert(node->op == op_Sel);
return get_irn_n(node, 0);
}
void
set_Sel_mem (ir_node *node, ir_node *mem) {
assert (node->op == op_Sel);
assert(node->op == op_Sel);
set_irn_n(node, 0, mem);
}
ir_node *
get_Sel_ptr (ir_node *node) {
assert (node->op == op_Sel);
assert(node->op == op_Sel);
return get_irn_n(node, 1);
}
void
set_Sel_ptr (ir_node *node, ir_node *ptr) {
assert (node->op == op_Sel);
assert(node->op == op_Sel);
set_irn_n(node, 1, ptr);
}
int
get_Sel_n_indexs (ir_node *node) {
assert (node->op == op_Sel);
assert(node->op == op_Sel);
return (get_irn_arity(node) - SEL_INDEX_OFFSET);
}
ir_node **
get_Sel_index_arr (ir_node *node)
{
assert ((node->op == op_Sel));
assert((node->op == op_Sel));
if (get_Sel_n_indexs(node) > 0)
return (ir_node **)& get_irn_in(node)[SEL_INDEX_OFFSET + 1];
else
......@@ -1124,25 +1124,25 @@ get_Sel_index_arr (ir_node *node)
ir_node *
get_Sel_index (ir_node *node, int pos) {
assert (node->op == op_Sel);
assert(node->op == op_Sel);
return get_irn_n(node, pos + SEL_INDEX_OFFSET);
}
void
set_Sel_index (ir_node *node, int pos, ir_node *index) {
assert (node->op == op_Sel);
assert(node->op == op_Sel);
set_irn_n(node, pos + SEL_INDEX_OFFSET, index);
}
entity *
get_Sel_entity (ir_node *node) {
assert (node->op == op_Sel);
assert(node->op == op_Sel);
return node->attr.sel.ent;
}
void
set_Sel_entity (ir_node *node, entity *ent) {
assert (node->op == op_Sel);
assert(node->op == op_Sel);
node->attr.sel.ent = ent;
}
......@@ -1157,74 +1157,74 @@ set_Sel_entity (ir_node *node, entity *ent) {
ir_node *
get_Call_mem (ir_node *node) {
assert (node->op == op_Call);
assert(node->op == op_Call);
return get_irn_n(node, 0);
}
void
set_Call_mem (ir_node *node, ir_node *mem) {
assert (node->op == op_Call);
assert(node->op == op_Call);
set_irn_n(node, 0, mem);
}
ir_node *
get_Call_ptr (ir_node *node) {
assert (node->op == op_Call);
assert(node->op == op_Call);
return get_irn_n(node, 1);
}
void
set_Call_ptr (ir_node *node, ir_node *ptr) {
assert (node->op == op_Call);
assert(node->op == op_Call);
set_irn_n(node, 1, ptr);
}
ir_node **
get_Call_param_arr (ir_node *node) {
assert (node->op == op_Call);
assert(node->op == op_Call);
return (ir_node **)&get_irn_in(node)[CALL_PARAM_OFFSET + 1];
}
int
get_Call_n_params (ir_node *node) {
assert (node->op == op_Call);
assert(node->op == op_Call);
return (get_irn_arity(node) - CALL_PARAM_OFFSET);
}
int
get_Call_arity (ir_node *node) {
assert (node->op == op_Call);
assert(node->op == op_Call);
return get_Call_n_params(node);
}
/* void
set_Call_arity (ir_node *node, ir_node *arity) {
assert (node->op == op_Call);
assert(node->op == op_Call);
}
*/
ir_node *
get_Call_param (ir_node *node, int pos) {
assert (node->op == op_Call);
assert(node->op == op_Call);
return get_irn_n(node, pos + CALL_PARAM_OFFSET);
}
void
set_Call_param (ir_node *node, int pos, ir_node *param) {
assert (node->op == op_Call);
assert(node->op == op_Call);
set_irn_n(node, pos + CALL_PARAM_OFFSET, param);
}
ir_type *
get_Call_type (ir_node *node) {
assert (node->op == op_Call);
assert(node->op == op_Call);
return node->attr.call.cld_tp = skip_tid(node->attr.call.cld_tp);
}
void
set_Call_type (ir_node *node, ir_type *tp) {
assert (node->op == op_Call);
assert ((get_unknown_type() == tp) || is_Method_type(tp));
assert(node->op == op_Call);
assert((get_unknown_type() == tp) || is_Method_type(tp));
node->attr.call.cld_tp = tp;
}
......@@ -1311,13 +1311,13 @@ BINOP(Quot)
ir_node *
get_Quot_mem (ir_node *node) {
assert (node->op == op_Quot);
assert(node->op == op_Quot);
return get_irn_n(node, 0);
}
void
set_Quot_mem (ir_node *node, ir_node *mem) {
assert (node->op == op_Quot);
assert(node->op == op_Quot);
set_irn_n(node, 0, mem);
}
......@@ -1325,13 +1325,13 @@ BINOP(DivMod)
ir_node *
get_DivMod_mem (ir_node *node) {
assert (node->op == op_DivMod);
assert(node->op == op_DivMod);
return get_irn_n(node, 0);
}
void
set_DivMod_mem (ir_node *node, ir_node *mem) {
assert (node->op == op_DivMod);
assert(node->op == op_DivMod);
set_irn_n(node, 0, mem);
}
......@@ -1339,13 +1339,13 @@ BINOP(Div)
ir_node *
get_Div_mem (ir_node *node) {
assert (node->op == op_Div);
assert(node->op == op_Div);
return get_irn_n(node, 0);
}
void
set_Div_mem (ir_node *node, ir_node *mem) {
assert (node->op == op_Div);
assert(node->op == op_Div);
set_irn_n(node, 0, mem);
}
......@@ -1485,7 +1485,7 @@ set_binop_left (ir_node *node, ir_node *left) {
if (node->op->opar == oparity_binary)
set_irn_n(node, node->op->op_index, left);
assert (node->op->opar == oparity_binary);
assert(node->op->opar == oparity_binary);
}
ir_node *
......@@ -1502,7 +1502,7 @@ set_binop_right (ir_node *node, ir_node *right) {
if (node->op->opar == oparity_binary)