summaryrefslogtreecommitdiffhomepage
path: root/ir/ir
diff options
context:
space:
mode:
authorChristoph Mallon <christoph.mallon@gmx.de>2016-11-04 17:10:17 +0100
committerChristoph Mallon <christoph.mallon@gmx.de>2016-11-04 17:10:17 +0100
commitac7f7de3f1d430cc5284e369e97dcbe12b5f14a5 (patch)
tree886200da6b168e85f3feda8fc401793841a4b74a /ir/ir
parent9bcf83b3c7d1b844180746c6470c8f3eaf23863a (diff)
ir: Factor out 'is_Const(x) && is_Const_one(x)' into the new function 'is_irn_one()'.
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 6789b7d..741cc8f 100644
--- a/ir/ir/irnode_t.h
+++ b/ir/ir/irnode_t.h
@@ -762,6 +762,12 @@ static inline bool is_irn_null(ir_node const *const irn)
return is_Const(irn) && is_Const_null(irn);
}
+/** Return whether a node is the 1 constant. */
+static inline bool is_irn_one(ir_node const *const irn)
+{
+ return is_Const(irn) && is_Const_one(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) \