Removed functions for accessing VProj nodes
[libfirm] / ir / ir / irnode.c
index b2ac8b5..ae684ff 100644 (file)
@@ -35,7 +35,6 @@
 #include "irnode_t.h"
 #include "irgraph_t.h"
 #include "irmode_t.h"
-#include "typegmod.h"
 #include "irbackedge_t.h"
 #include "irdump.h"
 #include "irop_t.h"
@@ -65,6 +64,7 @@ static const char *pnc_name_arr [] = {
  * returns the pnc name from an pnc constant
  */
 const char *get_pnc_string(int pnc) {
+       assert(pnc >= 0 && pnc < sizeof(pnc_name_arr)/sizeof(pnc_name_arr[0]));
        return pnc_name_arr[pnc];
 }
 
@@ -846,11 +846,18 @@ void set_Block_extbb(ir_node *block, ir_extblk *extblk) {
        block->attr.block.extblk = extblk;
 }
 
+/* returns the macro block header of a block. */
 ir_node *get_Block_MacroBlock(const ir_node *block) {
        assert(is_Block(block));
        return get_irn_n(block, -1);
 }
 
+/* returns the graph of a Block. */
+ir_graph *get_Block_irg(const ir_node *block) {
+       assert(is_Block(block));
+       return block->attr.block.irg;
+}
+
 int
 get_End_n_keepalives(ir_node *end) {
        assert(end->op == op_End);
@@ -1915,16 +1922,6 @@ set_Proj_pred(ir_node *node, ir_node *pred) {
        set_irn_n(node, 0, pred);
 }
 
-long get_VProj_proj(const ir_node *node)
-{
-       return node->attr.proj;
-}
-
-void set_VProj_proj(ir_node *node, long value)
-{
-       node->attr.proj = value;
-}
-
 long
 get_Proj_proj(const ir_node *node) {
        assert(is_Proj(node));
@@ -2005,17 +2002,16 @@ void set_Confirm_bound(ir_node *node, ir_node *bound) {
        set_irn_n(node, 0, bound);
 }
 
-pn_Cmp get_Confirm_cmp(ir_node *node) {
+pn_Cmp get_Confirm_cmp(const ir_node *node) {
        assert(node->op == op_Confirm);
-       return node->attr.confirm_cmp;
+       return node->attr.confirm.cmp;
 }
 
 void set_Confirm_cmp(ir_node *node, pn_Cmp cmp) {
        assert(node->op == op_Confirm);
-       node->attr.confirm_cmp = cmp;
+       node->attr.confirm.cmp = cmp;
 }
 
-
 ir_node *
 get_Filter_pred(ir_node *node) {
        assert(node->op == op_Filter);
@@ -2337,11 +2333,46 @@ void set_Pin_op(ir_node *pin, ir_node *node) {
 }
 
 /* Return the assembler text of an ASM pseudo node. */
-const char *get_ASM_text(const ir_node *node) {
+ident *get_ASM_text(const ir_node *node) {
        assert(node->op == op_ASM);
-       return get_id_str(node->attr.assem.asm_text);
+       return node->attr.assem.asm_text;
 }
 
+/* Return the number of input constraints for an ASM node. */
+int get_ASM_n_input_constraints(const ir_node *node) {
+       assert(node->op == op_ASM);
+       return ARR_LEN(node->attr.assem.inputs);
+}
+
+/* Return the input constraints for an ASM node. This is a flexible array. */
+const ir_asm_constraint *get_ASM_input_constraints(const ir_node *node) {
+       assert(node->op == op_ASM);
+       return node->attr.assem.inputs;
+}
+
+/* Return the number of output constraints for an ASM node.  */
+int get_ASM_n_output_constraints(const ir_node *node) {
+       assert(node->op == op_ASM);
+       return ARR_LEN(node->attr.assem.outputs);
+}
+
+/* Return the output constraints for an ASM node. */
+const ir_asm_constraint *get_ASM_output_constraints(const ir_node *node) {
+       assert(node->op == op_ASM);
+       return node->attr.assem.outputs;
+}
+
+/* Return the number of clobbered registers for an ASM node.  */
+int get_ASM_n_clobbers(const ir_node *node) {
+       assert(node->op == op_ASM);
+       return ARR_LEN(node->attr.assem.clobber);
+}
+
+/* Return the list of clobbered registers for an ASM node. */
+ident **get_ASM_clobbers(const ir_node *node) {
+       assert(node->op == op_ASM);
+       return node->attr.assem.clobber;
+}
 
 /* returns the graph of a node */
 ir_graph *
@@ -2504,6 +2535,11 @@ int
        return _is_NoMem(node);
 }
 
+int
+(is_Minus)(const ir_node *node) {
+       return _is_Minus(node);
+}
+
 int
 (is_Mod)(const ir_node *node) {
        return _is_Mod(node);
@@ -2534,6 +2570,11 @@ int
        return _is_Sub(node);
 }
 
+int
+(is_Tuple)(const ir_node *node) {
+       return _is_Tuple(node);
+}
+
 int
 (is_Start)(const ir_node *node) {
   return _is_Start(node);
@@ -2665,6 +2706,12 @@ int
        return _is_Raise(node);
 }
 
+/* returns true if a node is an ASM node. */
+int
+(is_ASM)(const ir_node *node) {
+       return _is_ASM(node);
+}
+
 int
 is_Proj(const ir_node *node) {
        assert(node);