nir: Mark nir_start_block()/nir_impl_last_block() with returns_nonnull.
authorMatt Turner <mattst88@gmail.com>
Fri, 13 May 2016 20:17:34 +0000 (13:17 -0700)
committerMatt Turner <mattst88@gmail.com>
Mon, 16 May 2016 18:06:15 +0000 (11:06 -0700)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/compiler/nir/nir.h

index cb9d44abafb4955487c55d656111e784b4d99858..2cfca3ed80a846916a7ef383bdcfa4e08bd935fb 100644 (file)
@@ -34,6 +34,7 @@
 #include "util/ralloc.h"
 #include "util/set.h"
 #include "util/bitset.h"
+#include "util/macros.h"
 #include "compiler/nir_types.h"
 #include "compiler/shader_enums.h"
 #include <stdio.h>
@@ -1550,16 +1551,16 @@ typedef struct {
    nir_metadata valid_metadata;
 } nir_function_impl;
 
-static inline nir_block *
+ATTRIBUTE_RETURNS_NONNULL static inline nir_block *
 nir_start_block(nir_function_impl *impl)
 {
-   return (nir_block *) exec_list_get_head(&impl->body);
+   return (nir_block *) impl->body.head;
 }
 
-static inline nir_block *
+ATTRIBUTE_RETURNS_NONNULL static inline nir_block *
 nir_impl_last_block(nir_function_impl *impl)
 {
-   return (nir_block *) exec_list_get_tail(&impl->body);
+   return (nir_block *) impl->body.tail_pred;
 }
 
 static inline nir_cf_node *