get_irn_MacroBlock() added
[libfirm] / ir / ir / irnode.c
index c1deaf2..1df769d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1995-2007 University of Karlsruhe.  All right reserved.
+ * Copyright (C) 1995-2008 University of Karlsruhe.  All right reserved.
  *
  * This file is part of libFirm.
  *
@@ -877,6 +877,13 @@ ir_node *get_Block_MacroBlock(const ir_node *block) {
        return mbh;
 }
 
+/* returns the macro block header of a node. */
+ir_node *get_irn_MacroBlock(const ir_node *n) {
+       if (! is_Block(n))
+               n = get_nodes_block(n);
+       return get_Block_MacroBlock(n);
+}
+
 /* returns the graph of a Block. */
 ir_graph *get_Block_irg(const ir_node *block) {
        assert(is_Block(block));
@@ -1286,6 +1293,10 @@ get_Sel_entity(const ir_node *node) {
        return node->attr.sel.ent;
 }
 
+ir_entity *_get_Sel_entity(ir_node *node) {
+       return get_Sel_entity(node);
+}
+
 void
 set_Sel_entity(ir_node *node, ir_entity *ent) {
        assert(node->op == op_Sel);
@@ -2780,25 +2791,31 @@ int
        return _is_Sync(node);
 }
 
-/* returns true if node is a Confirm 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. */
+/* 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. */
+/* 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 Cond 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);
@@ -3052,7 +3069,7 @@ static ir_entity *get_Null_ent(ir_node *n) {
 ir_op_ops *firm_set_default_get_entity_attr(ir_opcode code, ir_op_ops *ops) {
        switch (code) {
        case iro_SymConst: ops->get_entity_attr = get_SymConst_attr_entity; break;
-       case iro_Sel:      ops->get_entity_attr = get_Sel_entity; break;
+       case iro_Sel:      ops->get_entity_attr = _get_Sel_entity; break;
        default:
                /* not allowed to be NULL */
                if (! ops->get_entity_attr)