nir: Add a helper for getting the current block from a cursor
Reviewed-by: Rob Clark <robdclark@gmail.com>
This commit is contained in:
parent
be98c47528
commit
35e2e96b30
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue