[Mesa-dev] [PATCH 25/26] nir: Add a helper for getting the current block from a cursor
Jason Ekstrand
jason at jlekstrand.net
Fri Mar 25 23:12:39 UTC 2016
---
src/compiler/nir/nir.h | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
index 45f208a..03c1f76 100644
--- a/src/compiler/nir/nir.h
+++ b/src/compiler/nir/nir.h
@@ -1936,6 +1936,17 @@ typedef struct {
};
} nir_cursor;
+static inline nir_block *
+nir_cursor_current_block(nir_cursor cursor)
+{
+ if (cursor.option == nir_cursor_before_instr ||
+ cursor.option == nir_cursor_after_instr) {
+ return cursor.instr->block;
+ } else {
+ return cursor.block;
+ }
+}
+
bool nir_cursors_equal(nir_cursor a, nir_cursor b);
static inline nir_cursor
--
2.5.0.400.gff86faf
More information about the mesa-dev
mailing list