Module: Mesa
Branch: main
Commit: 19f8e0e3aa3ebb5d9c5a07cc2711e95ec64c58fb
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=19f8e0e3aa3ebb5d9c5a07cc2711e95ec64c58fb

Author: Alyssa Rosenzweig <[email protected]>
Date:   Mon Aug 14 10:33:18 2023 -0400

nir: Add trivial nir_src_* getters

These will become nontrivial later in the series. For now these have no smarts
in them, in order to make the conversion completely mechanical.

Signed-off-by: Alyssa Rosenzweig <[email protected]>
Reviewed-by: Rhys Perry <[email protected]>
Acked-by: Faith Ekstrand <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24671>

---

 src/compiler/nir/nir.h | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
index 42776b5607d..7623bc2b0be 100644
--- a/src/compiler/nir/nir.h
+++ b/src/compiler/nir/nir.h
@@ -1009,6 +1009,24 @@ typedef struct nir_src {
    bool is_if;
 } nir_src;
 
+static inline bool
+nir_src_is_if(const nir_src *src)
+{
+   return src->is_if;
+}
+
+static inline nir_instr *
+nir_src_parent_instr(const nir_src *src)
+{
+   return src->parent_instr;
+}
+
+static inline struct nir_if *
+nir_src_parent_if(const nir_src *src)
+{
+   return src->parent_if;
+}
+
 static inline void
 nir_src_set_parent_instr(nir_src *src, nir_instr *parent_instr)
 {

Reply via email to