projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
be98c47
)
nir: Add a helper for getting the current block from a cursor
author
Jason Ekstrand
<jason.ekstrand@intel.com>
Fri, 25 Mar 2016 21:16:47 +0000
(14:16 -0700)
committer
Jason Ekstrand
<jason.ekstrand@intel.com>
Tue, 29 Mar 2016 01:32:48 +0000
(18:32 -0700)
Reviewed-by: Rob Clark <robdclark@gmail.com>
src/compiler/nir/nir.h
patch
|
blob
|
history
diff --git
a/src/compiler/nir/nir.h
b/src/compiler/nir/nir.h
index d5c6a056164ee390553c069cb154e3c32001fd52..c19ae5948bdc6a6e63b2deca296822d0e15b7177 100644
(file)
--- a/
src/compiler/nir/nir.h
+++ b/
src/compiler/nir/nir.h
@@
-1881,6
+1881,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