nir: Print array deref indices as decimal
[mesa.git] / src / compiler / glsl / list.h
index 59ed766f2e1794077b4d2ae7002d017dcf5d66f5..ed77dcfab416940db5fb77df4f33cd44ece74bd7 100644 (file)
@@ -81,6 +81,12 @@ struct exec_node {
     * Insert a node in the list after the current node
     */
    void insert_after(exec_node *after);
+
+   /**
+    * Insert another list in the list after the current node
+    */
+   void insert_after(struct exec_list *after);
+
    /**
     * Insert a node in the list before the current node
     */
@@ -366,6 +372,13 @@ exec_list_is_empty(const struct exec_list *list)
    return list->head_sentinel.next == &list->tail_sentinel;
 }
 
+static inline bool
+exec_list_is_singular(const struct exec_list *list)
+{
+   return !exec_list_is_empty(list) &&
+          list->head_sentinel.next->next == &list->tail_sentinel;
+}
+
 static inline const struct exec_node *
 exec_list_get_head_const(const struct exec_list *list)
 {
@@ -507,6 +520,21 @@ exec_list_append(struct exec_list *list, struct exec_list *source)
    exec_list_make_empty(source);
 }
 
+static inline void
+exec_node_insert_list_after(struct exec_node *n, struct exec_list *after)
+{
+   if (exec_list_is_empty(after))
+      return;
+
+   after->tail_sentinel.prev->next = n->next;
+   after->head_sentinel.next->prev = n;
+
+   n->next->prev = after->tail_sentinel.prev;
+   n->next = after->head_sentinel.next;
+
+   exec_list_make_empty(after);
+}
+
 static inline void
 exec_list_prepend(struct exec_list *list, struct exec_list *source)
 {
@@ -635,6 +663,11 @@ inline void exec_list::append_list(exec_list *source)
    exec_list_append(this, source);
 }
 
+inline void exec_node::insert_after(exec_list *after)
+{
+   exec_node_insert_list_after(this, after);
+}
+
 inline void exec_list::prepend_list(exec_list *source)
 {
    exec_list_prepend(this, source);