-ir_enum_const *get_SymConst_enum(const ir_node *node)
-{
- assert(is_SymConst(node) && SYMCONST_HAS_ENUM(get_SymConst_kind(node)));
- return node->attr.symc.sym.enum_p;
-}
-
-void set_SymConst_enum(ir_node *node, ir_enum_const *ec)
-{
- assert(is_SymConst(node) && SYMCONST_HAS_ENUM(get_SymConst_kind(node)));
- node->attr.symc.sym.enum_p = ec;
-}
-
-union symconst_symbol
-get_SymConst_symbol(const ir_node *node)
-{
- assert(is_SymConst(node));
- return node->attr.symc.sym;
-}
-
-void
-set_SymConst_symbol(ir_node *node, union symconst_symbol sym)
-{
- assert(is_SymConst(node));
- node->attr.symc.sym = sym;
-}
-
-ir_type *
-get_SymConst_value_type(ir_node *node)
-{
- assert(is_SymConst(node));
- return node->attr.symc.tp;
-}
-
-void
-set_SymConst_value_type(ir_node *node, ir_type *tp)
-{
- assert(is_SymConst(node));
- node->attr.symc.tp = tp;
-}
-
-ir_node *
-get_Sel_mem(const ir_node *node)
-{
- assert(is_Sel(node));
- return get_irn_n(node, 0);
-}
-
-void
-set_Sel_mem(ir_node *node, ir_node *mem)
-{
- assert(is_Sel(node));
- set_irn_n(node, 0, mem);
-}
-
-ir_node *
-get_Sel_ptr(const ir_node *node)
-{
- assert(is_Sel(node));
- return get_irn_n(node, 1);
-}
-
-void
-set_Sel_ptr(ir_node *node, ir_node *ptr)
-{
- assert(is_Sel(node));
- set_irn_n(node, 1, ptr);
-}
-
-int
-get_Sel_n_indexs(const ir_node *node)
-{
- assert(is_Sel(node));
- return (get_irn_arity(node) - SEL_INDEX_OFFSET);
-}
-
-ir_node **
-get_Sel_index_arr(ir_node *node)
-{
- assert(is_Sel(node));
- if (get_Sel_n_indexs(node) > 0)
- return (ir_node **)& get_irn_in(node)[SEL_INDEX_OFFSET + 1];
- else
- return NULL;
-}
-
-ir_node *
-get_Sel_index(const ir_node *node, int pos)
-{
- assert(is_Sel(node));
- return get_irn_n(node, pos + SEL_INDEX_OFFSET);
-}
-
-void
-set_Sel_index(ir_node *node, int pos, ir_node *index)
-{
- assert(is_Sel(node));
- set_irn_n(node, pos + SEL_INDEX_OFFSET, index);
-}
-
-ir_entity *
-get_Sel_entity(const ir_node *node)
-{
- assert(is_Sel(node));
- return node->attr.sel.entity;
-}
-
-/* need a version without const to prevent warning */
-static ir_entity *_get_Sel_entity(ir_node *node)
-{
- return get_Sel_entity(node);
-}
-
-void
-set_Sel_entity(ir_node *node, ir_entity *ent)
-{
- assert(is_Sel(node));
- node->attr.sel.entity = ent;
-}
-
-
-/* For unary and binary arithmetic operations the access to the
- operands can be factored out. Left is the first, right the
- second arithmetic value as listed in tech report 0999-33.
- unops are: Minus, Abs, Not, Conv, Cast
- binops are: Add, Sub, Mul, Quot, DivMod, Div, Mod, And, Or, Eor, Shl,
- Shr, Shrs, Rotate, Cmp */
-
-
-ir_node *
-get_Call_mem(const ir_node *node)
-{
- assert(is_Call(node));
- return get_irn_n(node, 0);
-}
-
-void
-set_Call_mem(ir_node *node, ir_node *mem)
-{
- assert(is_Call(node));
- set_irn_n(node, 0, mem);
-}
-
-ir_node *
-get_Call_ptr(const ir_node *node)
-{
- assert(is_Call(node));
- return get_irn_n(node, 1);
-}
-
-void
-set_Call_ptr(ir_node *node, ir_node *ptr)
-{
- assert(is_Call(node));
- set_irn_n(node, 1, ptr);
-}
-
-ir_node **
-get_Call_param_arr(ir_node *node)
-{
- assert(is_Call(node));
- return &get_irn_in(node)[CALL_PARAM_OFFSET + 1];
-}
-
-int
-get_Call_n_params(const ir_node *node)
-{
- assert(is_Call(node));
- return (get_irn_arity(node) - CALL_PARAM_OFFSET);
-}
-
-ir_node *
-get_Call_param(const ir_node *node, int pos)
-{
- assert(is_Call(node));
- return get_irn_n(node, pos + CALL_PARAM_OFFSET);
-}
-
-void
-set_Call_param(ir_node *node, int pos, ir_node *param)
-{
- assert(is_Call(node));
- set_irn_n(node, pos + CALL_PARAM_OFFSET, param);
-}
-
-ir_type *
-get_Call_type(ir_node *node)
-{
- assert(is_Call(node));
- return node->attr.call.type;
-}
-
-void
-set_Call_type(ir_node *node, ir_type *tp)
-{
- assert(is_Call(node));
- assert((get_unknown_type() == tp) || is_Method_type(tp));
- node->attr.call.type = tp;
-}
-
-unsigned
-get_Call_tail_call(const ir_node *node)
-{
- assert(is_Call(node));
- return node->attr.call.tail_call;
-}
-
-void
-set_Call_tail_call(ir_node *node, unsigned tail_call)
-{
- assert(is_Call(node));
- node->attr.call.tail_call = tail_call != 0;
-}
-
-ir_node *
-get_Builtin_mem(const ir_node *node)
-{
- assert(is_Builtin(node));
- return get_irn_n(node, 0);
-}
-
-void
-set_Builin_mem(ir_node *node, ir_node *mem)
-{
- assert(is_Builtin(node));
- set_irn_n(node, 0, mem);
-}
-
-ir_builtin_kind
-get_Builtin_kind(const ir_node *node)
-{
- assert(is_Builtin(node));
- return node->attr.builtin.kind;
-}
-
-void
-set_Builtin_kind(ir_node *node, ir_builtin_kind kind)
-{
- assert(is_Builtin(node));
- node->attr.builtin.kind = kind;
-}
-
-ir_node **
-get_Builtin_param_arr(ir_node *node)
-{
- assert(is_Builtin(node));
- return &get_irn_in(node)[BUILDIN_PARAM_OFFSET + 1];
-}
-
-int
-get_Builtin_n_params(const ir_node *node)
-{
- assert(is_Builtin(node));
- return (get_irn_arity(node) - BUILDIN_PARAM_OFFSET);
-}
-
-ir_node *
-get_Builtin_param(const ir_node *node, int pos)
-{
- assert(is_Builtin(node));
- return get_irn_n(node, pos + BUILDIN_PARAM_OFFSET);
-}
-
-void
-set_Builtin_param(ir_node *node, int pos, ir_node *param)
-{
- assert(is_Builtin(node));
- set_irn_n(node, pos + BUILDIN_PARAM_OFFSET, param);
-}
-
-ir_type *
-get_Builtin_type(ir_node *node)
-{
- assert(is_Builtin(node));
- return node->attr.builtin.type;
-}
-
-void
-set_Builtin_type(ir_node *node, ir_type *tp)
-{
- assert(is_Builtin(node));
- assert((get_unknown_type() == tp) || is_Method_type(tp));
- node->attr.builtin.type = tp;
-}
-
-/* Returns a human readable string for the ir_builtin_kind. */
-const char *get_builtin_kind_name(ir_builtin_kind kind)
-{
-#define X(a) case a: return #a;
- switch (kind) {
- X(ir_bk_trap);
- X(ir_bk_debugbreak);
- X(ir_bk_return_address);
- X(ir_bk_frame_address);
- X(ir_bk_prefetch);
- X(ir_bk_ffs);
- X(ir_bk_clz);
- X(ir_bk_ctz);
- X(ir_bk_popcount);
- X(ir_bk_parity);
- X(ir_bk_bswap);
- X(ir_bk_inport);
- X(ir_bk_outport);
- X(ir_bk_inner_trampoline);
- }
- return "<unknown>";
-#undef X
-}
-
-
-int Call_has_callees(const ir_node *node)
-{
- assert(is_Call(node));
- return ((get_irg_callee_info_state(get_irn_irg(node)) != irg_callee_info_none) &&
- (node->attr.call.callee_arr != NULL));
-}
-
-int get_Call_n_callees(const ir_node *node)
-{
- assert(is_Call(node) && node->attr.call.callee_arr);
- return ARR_LEN(node->attr.call.callee_arr);
-}
-
-ir_entity *get_Call_callee(const ir_node *node, int pos)
-{
- assert(pos >= 0 && pos < get_Call_n_callees(node));
- return node->attr.call.callee_arr[pos];
-}
-
-void set_Call_callee_arr(ir_node *node, const int n, ir_entity ** arr)
-{
- assert(is_Call(node));
- if (node->attr.call.callee_arr == NULL || get_Call_n_callees(node) != n) {
- node->attr.call.callee_arr = NEW_ARR_D(ir_entity *, current_ir_graph->obst, n);
- }
- memcpy(node->attr.call.callee_arr, arr, n * sizeof(ir_entity *));
-}
-
-void remove_Call_callee_arr(ir_node *node)
-{
- assert(is_Call(node));
- node->attr.call.callee_arr = NULL;
-}
-
-ir_node *get_CallBegin_ptr(const ir_node *node)
-{
- assert(is_CallBegin(node));
- return get_irn_n(node, 0);
-}
-
-void set_CallBegin_ptr(ir_node *node, ir_node *ptr)
-{
- assert(is_CallBegin(node));
- set_irn_n(node, 0, ptr);
-}
-
-ir_node *get_CallBegin_call(const ir_node *node)
-{
- assert(is_CallBegin(node));
- return node->attr.callbegin.call;
-}
-
-void set_CallBegin_call(ir_node *node, ir_node *call)
-{
- assert(is_CallBegin(node));
- node->attr.callbegin.call = call;
-}
-
-/*
- * Returns non-zero if a Call is surely a self-recursive Call.
- * Beware: if this functions returns 0, the call might be self-recursive!
- */
-int is_self_recursive_Call(const ir_node *call)
-{
- const ir_node *callee = get_Call_ptr(call);
-
- if (is_SymConst_addr_ent(callee)) {
- const ir_entity *ent = get_SymConst_entity(callee);
- const ir_graph *irg = get_entity_irg(ent);
- if (irg == get_irn_irg(call))
- return 1;
- }
- return 0;
-}
-
-#define BINOP(OP) \
-ir_node * get_##OP##_left(const ir_node *node) { \
- assert(is_##OP(node)); \
- return get_irn_n(node, node->op->op_index); \
-} \
-void set_##OP##_left(ir_node *node, ir_node *left) { \
- assert(is_##OP(node)); \
- set_irn_n(node, node->op->op_index, left); \
-} \
-ir_node *get_##OP##_right(const ir_node *node) { \
- assert(is_##OP(node)); \
- return get_irn_n(node, node->op->op_index + 1); \
-} \
-void set_##OP##_right(ir_node *node, ir_node *right) { \
- assert(is_##OP(node)); \
- set_irn_n(node, node->op->op_index + 1, right); \
-}
-
-#define UNOP(OP) \
-ir_node *get_##OP##_op(const ir_node *node) { \
- assert(is_##OP(node)); \
- return get_irn_n(node, node->op->op_index); \
-} \
-void set_##OP##_op(ir_node *node, ir_node *op) { \
- assert(is_##OP(node)); \
- set_irn_n(node, node->op->op_index, op); \
-}
-
-#define BINOP_MEM(OP) \
-BINOP(OP) \
- \
-ir_node * \
-get_##OP##_mem(const ir_node *node) { \
- assert(is_##OP(node)); \
- return get_irn_n(node, 0); \
-} \
- \
-void \
-set_##OP##_mem(ir_node *node, ir_node *mem) { \
- assert(is_##OP(node)); \
- set_irn_n(node, 0, mem); \
-}
-
-#define DIVOP(OP) \
-BINOP_MEM(OP) \
- \
-ir_mode *get_##OP##_resmode(const ir_node *node) { \
- assert(is_##OP(node)); \
- return node->attr.divmod.resmode; \
-} \
- \
-void set_##OP##_resmode(ir_node *node, ir_mode *mode) { \
- assert(is_##OP(node)); \
- node->attr.divmod.resmode = mode; \
-}
-
-
-BINOP(Add)
-BINOP(Borrow)
-BINOP(Carry)
-BINOP(Sub)
-UNOP(Minus)
-BINOP(Mul)
-BINOP(Mulh)
-DIVOP(Quot)
-DIVOP(DivMod)
-DIVOP(Div)
-DIVOP(Mod)
-UNOP(Abs)
-BINOP(And)
-BINOP(Or)
-BINOP(Eor)
-UNOP(Not)
-BINOP(Shl)
-BINOP(Shr)
-BINOP(Shrs)
-BINOP(Rotl)
-BINOP(Cmp)
-UNOP(Conv)
-UNOP(Cast)
-
-int get_Div_no_remainder(const ir_node *node)
-{
- assert(is_Div(node));
- return node->attr.divmod.no_remainder;
-}
-
-void set_Div_no_remainder(ir_node *node, int no_remainder)
-{
- assert(is_Div(node));
- node->attr.divmod.no_remainder = no_remainder;
-}
-
-int get_Conv_strict(const ir_node *node)
-{
- assert(is_Conv(node));
- return node->attr.conv.strict;
-}
-
-void set_Conv_strict(ir_node *node, int strict_flag)
-{
- assert(is_Conv(node));
- node->attr.conv.strict = (char)strict_flag;
-}
-
-ir_type *
-get_Cast_type(ir_node *node)
-{
- assert(is_Cast(node));
- return node->attr.cast.type;
-}
-
-void
-set_Cast_type(ir_node *node, ir_type *to_tp)
-{
- assert(is_Cast(node));
- node->attr.cast.type = to_tp;
-}
-
-
-/* Checks for upcast.
- *
- * Returns true if the Cast node casts a class type to a super type.
- */
-int is_Cast_upcast(ir_node *node)
-{
- ir_type *totype = get_Cast_type(node);
- ir_type *fromtype = get_irn_typeinfo_type(get_Cast_op(node));
-
- assert(get_irg_typeinfo_state(get_irn_irg(node)) == ir_typeinfo_consistent);
- assert(fromtype);
-
- while (is_Pointer_type(totype) && is_Pointer_type(fromtype)) {
- totype = get_pointer_points_to_type(totype);
- fromtype = get_pointer_points_to_type(fromtype);
- }
-
- assert(fromtype);
-
- if (!is_Class_type(totype)) return 0;
- return is_SubClass_of(fromtype, totype);
-}
-
-/* Checks for downcast.
- *
- * Returns true if the Cast node casts a class type to a sub type.
- */
-int is_Cast_downcast(ir_node *node)
-{
- ir_type *totype = get_Cast_type(node);
- ir_type *fromtype = get_irn_typeinfo_type(get_Cast_op(node));
-
- assert(get_irg_typeinfo_state(get_irn_irg(node)) == ir_typeinfo_consistent);
- assert(fromtype);
-
- while (is_Pointer_type(totype) && is_Pointer_type(fromtype)) {
- totype = get_pointer_points_to_type(totype);
- fromtype = get_pointer_points_to_type(fromtype);
- }
-
- assert(fromtype);
-
- if (!is_Class_type(totype)) return 0;
- return is_SubClass_of(totype, fromtype);
-}
-
-int
-(is_unop)(const ir_node *node) {
- return _is_unop(node);
-}
-
-ir_node *
-get_unop_op(const ir_node *node)
-{
- if (node->op->opar == oparity_unary)
- return get_irn_n(node, node->op->op_index);
-
- assert(node->op->opar == oparity_unary);
- return NULL;
-}
-
-void
-set_unop_op(ir_node *node, ir_node *op)
-{
- if (node->op->opar == oparity_unary)
- set_irn_n(node, node->op->op_index, op);
-
- assert(node->op->opar == oparity_unary);
-}
-
-int
-(is_binop)(const ir_node *node) {
- return _is_binop(node);
-}
-
-ir_node *
-get_binop_left(const ir_node *node)
-{
- assert(node->op->opar == oparity_binary);
- return get_irn_n(node, node->op->op_index);
-}
-
-void
-set_binop_left(ir_node *node, ir_node *left)
-{
- assert(node->op->opar == oparity_binary);
- set_irn_n(node, node->op->op_index, left);
-}
-
-ir_node *
-get_binop_right(const ir_node *node)
-{
- assert(node->op->opar == oparity_binary);
- return get_irn_n(node, node->op->op_index + 1);
-}
-
-void
-set_binop_right(ir_node *node, ir_node *right)
-{
- assert(node->op->opar == oparity_binary);
- set_irn_n(node, node->op->op_index + 1, right);
-}
-
-int is_Phi0(const ir_node *n)
-{
- assert(n);
-
- return ((get_irn_op(n) == op_Phi) &&
- (get_irn_arity(n) == 0) &&
- (get_irg_phase_state(get_irn_irg(n)) == phase_building));
-}
-
-ir_node **
-get_Phi_preds_arr(ir_node *node)
-{
- assert(node->op == op_Phi);
- return (ir_node **)&(get_irn_in(node)[1]);
-}
-
-int
-get_Phi_n_preds(const ir_node *node)
-{
- assert(is_Phi(node) || is_Phi0(node));
- return (get_irn_arity(node));
-}
-
-/*
-void set_Phi_n_preds(ir_node *node, int n_preds)
-{
- assert(node->op == op_Phi);
-}
-*/
-
-ir_node *
-get_Phi_pred(const ir_node *node, int pos)
-{
- assert(is_Phi(node) || is_Phi0(node));
- return get_irn_n(node, pos);
-}
-
-void
-set_Phi_pred(ir_node *node, int pos, ir_node *pred)
-{
- assert(is_Phi(node) || is_Phi0(node));
- set_irn_n(node, pos, pred);
-}
-
-ir_node *(get_Phi_next)(const ir_node *phi)
-{
- return _get_Phi_next(phi);
-}
-
-void (set_Phi_next)(ir_node *phi, ir_node *next)
-{
- _set_Phi_next(phi, next);
-}
-
-int is_memop(const ir_node *node)
-{
- ir_opcode code = get_irn_opcode(node);
- return (code == iro_Load || code == iro_Store);
-}
-
-ir_node *get_memop_mem(const ir_node *node)
-{
- assert(is_memop(node));
- return get_irn_n(node, 0);
-}
-
-void set_memop_mem(ir_node *node, ir_node *mem)
-{
- assert(is_memop(node));
- set_irn_n(node, 0, mem);
-}
-
-ir_node *get_memop_ptr(const ir_node *node)
-{
- assert(is_memop(node));
- return get_irn_n(node, 1);
-}
-
-void set_memop_ptr(ir_node *node, ir_node *ptr)
-{
- assert(is_memop(node));
- set_irn_n(node, 1, ptr);
-}
-
-ir_node *
-get_Load_mem(const ir_node *node)
-{
- assert(is_Load(node));
- return get_irn_n(node, 0);
-}
-
-void
-set_Load_mem(ir_node *node, ir_node *mem)
-{
- assert(is_Load(node));
- set_irn_n(node, 0, mem);
-}
-
-ir_node *
-get_Load_ptr(const ir_node *node)
-{
- assert(is_Load(node));
- return get_irn_n(node, 1);
-}
-
-void
-set_Load_ptr(ir_node *node, ir_node *ptr)
-{
- assert(is_Load(node));
- set_irn_n(node, 1, ptr);
-}
-
-ir_mode *
-get_Load_mode(const ir_node *node)
-{
- assert(is_Load(node));
- return node->attr.load.mode;
-}
-
-void
-set_Load_mode(ir_node *node, ir_mode *mode)
-{
- assert(is_Load(node));
- node->attr.load.mode = mode;
-}
-
-ir_volatility
-get_Load_volatility(const ir_node *node)
-{
- assert(is_Load(node));
- return node->attr.load.volatility;
-}
-
-void
-set_Load_volatility(ir_node *node, ir_volatility volatility)
-{
- assert(is_Load(node));
- node->attr.load.volatility = volatility;
-}
-
-ir_align
-get_Load_align(const ir_node *node)
-{
- assert(is_Load(node));
- return node->attr.load.aligned;
-}
-
-void
-set_Load_align(ir_node *node, ir_align align)
-{
- assert(is_Load(node));
- node->attr.load.aligned = align;
-}
-
-
-ir_node *
-get_Store_mem(const ir_node *node)
-{
- assert(is_Store(node));
- return get_irn_n(node, 0);
-}
-
-void
-set_Store_mem(ir_node *node, ir_node *mem)
-{
- assert(is_Store(node));
- set_irn_n(node, 0, mem);
-}
-
-ir_node *
-get_Store_ptr(const ir_node *node)
-{
- assert(is_Store(node));
- return get_irn_n(node, 1);
-}
-
-void
-set_Store_ptr(ir_node *node, ir_node *ptr)
-{
- assert(is_Store(node));
- set_irn_n(node, 1, ptr);
-}
-
-ir_node *
-get_Store_value(const ir_node *node)
-{
- assert(is_Store(node));
- return get_irn_n(node, 2);
-}
-
-void
-set_Store_value(ir_node *node, ir_node *value)
-{
- assert(is_Store(node));
- set_irn_n(node, 2, value);
-}
-
-ir_volatility
-get_Store_volatility(const ir_node *node)
-{
- assert(is_Store(node));
- return node->attr.store.volatility;
-}
-
-void
-set_Store_volatility(ir_node *node, ir_volatility volatility)
-{
- assert(is_Store(node));
- node->attr.store.volatility = volatility;
-}
-
-ir_align
-get_Store_align(const ir_node *node)
-{
- assert(is_Store(node));
- return node->attr.store.aligned;
-}
-
-void
-set_Store_align(ir_node *node, ir_align align)
-{
- assert(is_Store(node));
- node->attr.store.aligned = align;
-}
-
-
-ir_node *
-get_Alloc_mem(const ir_node *node)
-{
- assert(is_Alloc(node));
- return get_irn_n(node, 0);
-}
-
-void
-set_Alloc_mem(ir_node *node, ir_node *mem)
-{
- assert(is_Alloc(node));
- set_irn_n(node, 0, mem);
-}
-
-ir_node *
-get_Alloc_size(const ir_node *node)
-{
- assert(is_Alloc(node));
- return get_irn_n(node, 1);
-}
-
-void
-set_Alloc_size(ir_node *node, ir_node *size)
-{
- assert(is_Alloc(node));
- set_irn_n(node, 1, size);
-}
-
-ir_type *
-get_Alloc_type(ir_node *node)
-{
- assert(is_Alloc(node));
- return node->attr.alloc.type;
-}
-
-void
-set_Alloc_type(ir_node *node, ir_type *tp)
-{
- assert(is_Alloc(node));
- node->attr.alloc.type = tp;
-}
-
-ir_where_alloc
-get_Alloc_where(const ir_node *node)
-{
- assert(is_Alloc(node));
- return node->attr.alloc.where;
-}
-
-void
-set_Alloc_where(ir_node *node, ir_where_alloc where)
-{
- assert(is_Alloc(node));
- node->attr.alloc.where = where;
-}
-
-
-ir_node *
-get_Free_mem(const ir_node *node)
-{
- assert(is_Free(node));
- return get_irn_n(node, 0);
-}
-
-void
-set_Free_mem(ir_node *node, ir_node *mem)
-{
- assert(is_Free(node));
- set_irn_n(node, 0, mem);
-}
-
-ir_node *
-get_Free_ptr(const ir_node *node)
-{
- assert(is_Free(node));
- return get_irn_n(node, 1);
-}
-
-void
-set_Free_ptr(ir_node *node, ir_node *ptr)
-{
- assert(is_Free(node));
- set_irn_n(node, 1, ptr);
-}
-
-ir_node *
-get_Free_size(const ir_node *node)
-{
- assert(is_Free(node));
- return get_irn_n(node, 2);
-}
-
-void
-set_Free_size(ir_node *node, ir_node *size)
-{
- assert(is_Free(node));
- set_irn_n(node, 2, size);
-}
-
-ir_type *
-get_Free_type(ir_node *node)
-{
- assert(is_Free(node));
- return node->attr.free.type;
-}
-
-void
-set_Free_type(ir_node *node, ir_type *tp)
-{
- assert(is_Free(node));
- node->attr.free.type = tp;
-}
-
-ir_where_alloc
-get_Free_where(const ir_node *node)
-{
- assert(is_Free(node));
- return node->attr.free.where;
-}
-
-void
-set_Free_where(ir_node *node, ir_where_alloc where)
-{
- assert(is_Free(node));
- node->attr.free.where = where;
-}
-
-ir_node **get_Sync_preds_arr(ir_node *node)
-{
- assert(is_Sync(node));
- return (ir_node **)&(get_irn_in(node)[1]);
-}
-
-int get_Sync_n_preds(const ir_node *node)
-{
- assert(is_Sync(node));
- return (get_irn_arity(node));
-}
-
-/*
-void set_Sync_n_preds(ir_node *node, int n_preds)
-{
- assert(is_Sync(node));
-}
-*/
-
-ir_node *get_Sync_pred(const ir_node *node, int pos)
-{
- assert(is_Sync(node));
- return get_irn_n(node, pos);
-}
-
-void set_Sync_pred(ir_node *node, int pos, ir_node *pred)
-{
- assert(is_Sync(node));
- set_irn_n(node, pos, pred);
-}
-
-/* Add a new Sync predecessor */
-void add_Sync_pred(ir_node *node, ir_node *pred)
-{
- assert(is_Sync(node));
- add_irn_n(node, pred);
-}
-
-/* Returns the source language type of a Proj node. */
-ir_type *get_Proj_type(ir_node *n)
-{
- ir_type *tp = firm_unknown_type;
- ir_node *pred = get_Proj_pred(n);
-
- switch (get_irn_opcode(pred)) {
- case iro_Proj: {
- ir_node *pred_pred;
- /* Deal with Start / Call here: we need to know the Proj Nr. */
- assert(get_irn_mode(pred) == mode_T);
- pred_pred = get_Proj_pred(pred);
-
- if (is_Start(pred_pred)) {
- ir_type *mtp = get_entity_type(get_irg_entity(get_irn_irg(pred_pred)));
- tp = get_method_param_type(mtp, get_Proj_proj(n));
- } else if (is_Call(pred_pred)) {
- ir_type *mtp = get_Call_type(pred_pred);
- tp = get_method_res_type(mtp, get_Proj_proj(n));
- }
- } break;
- case iro_Start: break;
- case iro_Call: break;
- case iro_Load: {
- ir_node *a = get_Load_ptr(pred);
- if (is_Sel(a))
- tp = get_entity_type(get_Sel_entity(a));
- } break;
- default:
- break;
- }
- return tp;
-}
-
-ir_node *
-get_Proj_pred(const ir_node *node)
-{
- assert(is_Proj(node));
- return get_irn_n(node, 0);
-}
-
-void
-set_Proj_pred(ir_node *node, ir_node *pred)
-{
- assert(is_Proj(node));
- set_irn_n(node, 0, pred);
-}
-
-long
-get_Proj_proj(const ir_node *node)
-{
-#ifdef INTERPROCEDURAL_VIEW
- ir_opcode code = get_irn_opcode(node);
-
- if (code == iro_Proj) {
- return node->attr.proj;
- }
- else {
- assert(code == iro_Filter);
- return node->attr.filter.proj;
- }
-#else
- assert(is_Proj(node));
- return node->attr.proj;
-#endif /* INTERPROCEDURAL_VIEW */
-}
-
-void
-set_Proj_proj(ir_node *node, long proj)
-{
-#ifdef INTERPROCEDURAL_VIEW
- ir_opcode code = get_irn_opcode(node);
-
- if (code == iro_Proj) {
- node->attr.proj = proj;
- }
- else {
- assert(code == iro_Filter);
- node->attr.filter.proj = proj;
- }
-#else
- assert(is_Proj(node));
- node->attr.proj = proj;
-#endif /* INTERPROCEDURAL_VIEW */
-}
-
-/* Returns non-zero if a node is a routine parameter. */
-int (is_arg_Proj)(const ir_node *node)
-{
- return _is_arg_Proj(node);
-}
-
-ir_node **
-get_Tuple_preds_arr(ir_node *node)
-{
- assert(is_Tuple(node));
- return (ir_node **)&(get_irn_in(node)[1]);
-}
-
-int
-get_Tuple_n_preds(const ir_node *node)