summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2016-12-10 12:00:12 -0800
committerJason Ekstrand <[email protected]>2017-01-06 16:44:28 -0800
commit830dca74fe888cc6cc2d27f99a6c2488d69fc1c0 (patch)
tree6dc1a4c7e72d1261bc01b445376be1cf3529998d /src
parent75a6707984d520d70df14fca46f29ac9e4e7e8d9 (diff)
nir/builder: Add a helper for getting the most recently added instruction
Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/compiler/nir/nir_builder.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/compiler/nir/nir_builder.h b/src/compiler/nir/nir_builder.h
index 1da30ab8fc1..194d32709f1 100644
--- a/src/compiler/nir/nir_builder.h
+++ b/src/compiler/nir/nir_builder.h
@@ -68,6 +68,13 @@ nir_builder_instr_insert(nir_builder *build, nir_instr *instr)
build->cursor = nir_after_instr(instr);
}
+static inline nir_instr *
+nir_builder_last_instr(nir_builder *build)
+{
+ assert(build->cursor.option == nir_cursor_after_instr);
+ return build->cursor.instr;
+}
+
static inline void
nir_builder_cf_insert(nir_builder *build, nir_cf_node *cf)
{