summaryrefslogtreecommitdiff
path: root/ir.h
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2010-06-04 16:30:07 -0700
committerIan Romanick <ian.d.romanick@intel.com>2010-06-11 13:51:09 -0700
commit31881908ebc11d84c2ff1821410c91340686aa17 (patch)
tree2e064c4e42e2c714888772dd1df7130d23f547f9 /ir.h
parentc9cb1032be454ff5fdb802a629565cfaeb2e5d5a (diff)
Add methods to ir_constant to get scalar components in a particular type
Diffstat (limited to 'ir.h')
-rw-r--r--ir.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/ir.h b/ir.h
index 102f2f3727..033d6f2261 100644
--- a/ir.h
+++ b/ir.h
@@ -1056,6 +1056,20 @@ public:
}
/**
+ * Get a particular component of a constant as a specific type
+ *
+ * This is useful, for example, to get a value from an integer constant
+ * as a float or bool. This appears frequently when constructors are
+ * called with all constant parameters.
+ */
+ /*@{*/
+ bool get_bool_component(unsigned i) const;
+ float get_float_component(unsigned i) const;
+ int get_int_component(unsigned i) const;
+ unsigned get_uint_component(unsigned i) const;
+ /*@}*/
+
+ /**
* Value of the constant.
*
* The field used to back the values supplied by the constant is determined