summaryrefslogtreecommitdiffhomepage
path: root/ir/ir
diff options
context:
space:
mode:
authorChristoph Mallon <christoph.mallon@gmx.de>2016-11-04 16:27:43 +0100
committerChristoph Mallon <christoph.mallon@gmx.de>2016-11-04 16:32:41 +0100
commit9bcf83b3c7d1b844180746c6470c8f3eaf23863a (patch)
treef294a473240fc7594410f5b86dac4d1fc9545d6a /ir/ir
parent731a6fc90fb0a66b068c0c0c67547c837b2fae78 (diff)
ir: Factor out 'is_Const(x) && is_Const_null(x)' into the new function 'is_irn_null()'.
Diffstat (limited to 'ir/ir')
-rw-r--r--ir/ir/irnode_t.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/ir/ir/irnode_t.h b/ir/ir/irnode_t.h
index cff832f..6789b7d 100644
--- a/ir/ir/irnode_t.h
+++ b/ir/ir/irnode_t.h
@@ -756,6 +756,12 @@ static inline ir_node const *get_block_const(ir_node const *const irn)
return is_Block(irn) ? irn : get_nodes_block(irn);
}
+/** Return whether a node is the 0 constant. */
+static inline bool is_irn_null(ir_node const *const irn)
+{
+ return is_Const(irn) && is_Const_null(irn);
+}
+
#define foreach_irn_in(irn, idx, pred) \
for (bool pred##__b = true; pred##__b;) \
for (ir_node const *const pred##__irn = (irn); pred##__b; pred##__b = false) \