nir/builder: Use nir_after_instr to advance the cursor
[mesa.git] / src / glsl / nir / nir_builder.h
index 08b40f8ea7cf71a332ad4521f15b2fa01f17344d..ba988d71dde406cff6e0284ec6befac0233101b1 100644 (file)
@@ -49,8 +49,7 @@ nir_builder_instr_insert(nir_builder *build, nir_instr *instr)
    nir_instr_insert(build->cursor, instr);
 
    /* Move the cursor forward. */
-   if (build->cursor.option == nir_cursor_after_instr)
-      build->cursor.instr = instr;
+   build->cursor = nir_after_instr(instr);
 }
 
 static inline void