}
void
-set_irn_n(ir_node *node, int n, ir_node *in) {
+set_irn_n (ir_node *node, int n, ir_node *in) {
assert(node && node->kind == k_ir_node);
assert(-1 <= n);
assert(n < get_irn_arity(node));
node->in[n + 1] = in;
}
-int add_irn_n(ir_node *node, ir_node *in) {
+int add_irn_n(ir_node *node, ir_node *in)
+{
int pos;
ir_graph *irg = get_irn_irg(node);
}
int
-(get_irn_deps)(const ir_node *node) {
+(get_irn_deps)(const ir_node *node)
+{
return _get_irn_deps(node);
}
ir_node *
-(get_irn_dep)(const ir_node *node, int pos) {
+(get_irn_dep)(const ir_node *node, int pos)
+{
return _get_irn_dep(node, pos);
}
void
-(set_irn_dep)(ir_node *node, int pos, ir_node *dep) {
+(set_irn_dep)(ir_node *node, int pos, ir_node *dep)
+{
_set_irn_dep(node, pos, dep);
}
-int add_irn_dep(ir_node *node, ir_node *dep) {
+int add_irn_dep(ir_node *node, ir_node *dep)
+{
int res = 0;
if (node->deps == NULL) {
/** manipulate fields of individual nodes **/
+/* this works for all except Block */
ir_node *
-(get_nodes_block)(const ir_node *node) {
- return _get_nodes_block(node);
+get_nodes_block(const ir_node *node) {
+ assert(node->op != op_Block);
+ return get_irn_n(node, -1);
}
void
set_nodes_block(ir_node *node, ir_node *block) {
- node->op->ops.set_block(node, block);
+ assert(node->op != op_Block);
+ set_irn_n(node, -1, block);
}
/* Test whether arbitrary node is frame pointer, i.e. Proj(pn_Start_P_frame_base)
return block->attr.block.irg;
}
+int has_Block_label(const ir_node *block) {
+ assert(is_Block(block));
+ return block->attr.block.has_label;
+}
+
+ir_label_t get_Block_label(const ir_node *block) {
+ assert(is_Block(block));
+ return block->attr.block.label;
+}
+
+void set_Block_label(ir_node *block, ir_label_t label) {
+ assert(is_Block(block));
+ block->attr.block.has_label = 1;
+ block->attr.block.label = label;
+}
+
int
get_End_n_keepalives(ir_node *end) {
assert(end->op == op_End);
node->attr.symc.sym = sym;
}
+ir_label_t get_SymConst_label(const ir_node *node) {
+ assert(node->op == op_SymConst && SYMCONST_HAS_LABEL(get_SymConst_kind(node)));
+ return node->attr.symc.sym.label;
+}
+
+void set_SymConst_label(ir_node *node, ir_label_t label) {
+ assert(node->op == op_SymConst && SYMCONST_HAS_LABEL(get_SymConst_kind(node)));
+ node->attr.symc.sym.label = label;
+}
+
ir_type *
get_SymConst_value_type(ir_node *node) {
assert(node->op == op_SymConst);
node->attr.load.volatility = volatility;
}
+ir_align
+get_Load_align(ir_node *node) {
+ assert(node->op == op_Load);
+ return node->attr.load.aligned;
+}
+
+void
+set_Load_align(ir_node *node, ir_align align) {
+ assert(node->op == op_Load);
+ node->attr.load.aligned = align;
+}
+
ir_node *
get_Store_mem(ir_node *node) {
node->attr.store.volatility = volatility;
}
+ir_align
+get_Store_align(ir_node *node) {
+ assert(node->op == op_Store);
+ return node->attr.store.aligned;
+}
+
+void
+set_Store_align(ir_node *node, ir_align align) {
+ assert(node->op == op_Store);
+ node->attr.store.aligned = align;
+}
+
ir_node *
get_Alloc_mem(ir_node *node) {
* irg.
*/
if (! is_Block(node))
- node = get_nodes_block(node);
+ node = get_irn_n(node, -1);
if (is_Bad(node)) /* sometimes bad is predecessor of nodes instead of block: in case of optimization */
- node = get_nodes_block(node);
+ node = get_irn_n(node, -1);
assert(get_irn_op(node) == op_Block);
return node->attr.block.irg;
}
int i, arity = get_irn_arity(n);
printf("%s%s: %ld (%p)\n", get_irn_opname(n), get_mode_name(get_irn_mode(n)), get_irn_node_nr(n), (void *)n);
if (!is_Block(n)) {
- ir_node *pred = get_nodes_block(n);
+ ir_node *pred = get_irn_n(n, -1);
printf(" block: %s%s: %ld (%p)\n", get_irn_opname(pred), get_mode_name(get_irn_mode(pred)),
get_irn_node_nr(pred), (void *)pred);
}