[Mesa-dev] [PATCH 06/18] nir: consistently use ifndef guards over pragma once

Emil Velikov emil.l.velikov at gmail.com
Mon Mar 20 16:12:56 UTC 2017


Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
---
 src/compiler/nir/nir.h                      | 5 ++++-
 src/compiler/nir/nir_array.h                | 5 ++++-
 src/compiler/nir/nir_constant_expressions.h | 5 +++++
 src/compiler/nir/nir_control_flow.h         | 7 +++++--
 src/compiler/nir/nir_control_flow_private.h | 6 +++++-
 src/compiler/nir/nir_instr_set.h            | 4 +++-
 src/compiler/nir/nir_loop_analyze.h         | 5 ++++-
 src/compiler/nir/nir_phi_builder.h          | 5 ++++-
 src/compiler/nir/nir_vla.h                  | 6 ++++--
 src/compiler/nir/nir_worklist.h             | 1 -
 10 files changed, 38 insertions(+), 11 deletions(-)

diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
index 57b8be3dde2..405e6739436 100644
--- a/src/compiler/nir/nir.h
+++ b/src/compiler/nir/nir.h
@@ -25,7 +25,8 @@
  *
  */
 
-#pragma once
+#ifndef NIR_H
+#define NIR_H
 
 #include "util/hash_table.h"
 #include "compiler/glsl/list.h"
@@ -2634,3 +2635,5 @@ gl_system_value nir_system_value_from_intrinsic(nir_intrinsic_op intrin);
 #ifdef __cplusplus
 } /* extern "C" */
 #endif
+
+#endif /* NIR_H */
diff --git a/src/compiler/nir/nir_array.h b/src/compiler/nir/nir_array.h
index 1db4e8cea36..4d7a532a7f1 100644
--- a/src/compiler/nir/nir_array.h
+++ b/src/compiler/nir/nir_array.h
@@ -25,7 +25,8 @@
  *
  */
 
-#pragma once
+#ifndef NIR_ARRAY_H
+#define NIR_ARRAY_H
 
 #ifdef __cplusplus
 extern "C" {
@@ -94,3 +95,5 @@ nir_array_grow(nir_array *arr, size_t additional)
 #ifdef __cplusplus
 } /* extern "C" */
 #endif
+
+#endif /* NIR_ARRAY_H */
diff --git a/src/compiler/nir/nir_constant_expressions.h b/src/compiler/nir/nir_constant_expressions.h
index 201f278c71c..1d6bbbc25d3 100644
--- a/src/compiler/nir/nir_constant_expressions.h
+++ b/src/compiler/nir/nir_constant_expressions.h
@@ -25,7 +25,12 @@
  *
  */
 
+#ifndef NIR_CONSTANT_EXPRESSIONS_H
+#define NIR_CONSTANT_EXPRESSIONS_H
+
 #include "nir.h"
 
 nir_const_value nir_eval_const_opcode(nir_op op, unsigned num_components,
                                       unsigned bit_size, nir_const_value *src);
+
+#endif /* NIR_CONSTANT_EXPRESSIONS_H */
diff --git a/src/compiler/nir/nir_control_flow.h b/src/compiler/nir/nir_control_flow.h
index b496aec035a..a487eb04660 100644
--- a/src/compiler/nir/nir_control_flow.h
+++ b/src/compiler/nir/nir_control_flow.h
@@ -25,9 +25,10 @@
  *
  */
 
-#include "nir.h"
+#ifndef NIR_CONTROL_FLOW_H
+#define NIR_CONTROL_FLOW_H
 
-#pragma once
+#include "nir.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -163,3 +164,5 @@ nir_cf_node_remove(nir_cf_node *node)
 #ifdef __cplusplus
 }
 #endif
+
+#endif /* NIR_CONTROL_FLOW_H */
diff --git a/src/compiler/nir/nir_control_flow_private.h b/src/compiler/nir/nir_control_flow_private.h
index f32b57a8cef..31e6d3c0e9f 100644
--- a/src/compiler/nir/nir_control_flow_private.h
+++ b/src/compiler/nir/nir_control_flow_private.h
@@ -25,9 +25,11 @@
  *
  */
 
+#ifndef NIR_CONTROL_FLOW_PRIVATE_H
+#define NIR_CONTROL_FLOW_PRIVATE_H
+
 #include "nir_control_flow.h"
 
-#pragma once
 
 /* Internal control-flow modification functions used when inserting/removing
  * instructions.
@@ -35,3 +37,5 @@
 
 void nir_handle_add_jump(nir_block *block);
 void nir_handle_remove_jump(nir_block *block, nir_jump_type type);
+
+#endif /* NIR_CONTROL_FLOW_PRIVATE_H */
diff --git a/src/compiler/nir/nir_instr_set.h b/src/compiler/nir/nir_instr_set.h
index 939e8ddbf58..26817f62e96 100644
--- a/src/compiler/nir/nir_instr_set.h
+++ b/src/compiler/nir/nir_instr_set.h
@@ -21,7 +21,8 @@
  * IN THE SOFTWARE.
  */
 
-#pragma once
+#ifndef NIR_INSTR_SET_H
+#define NIR_INSTR_SET_H
 
 #include "nir.h"
 
@@ -60,3 +61,4 @@ void nir_instr_set_remove(struct set *instr_set, nir_instr *instr);
 
 /*@}*/
 
+#endif /* NIR_INSTR_SET_H */
diff --git a/src/compiler/nir/nir_loop_analyze.h b/src/compiler/nir/nir_loop_analyze.h
index b7f862e8c04..18c23051717 100644
--- a/src/compiler/nir/nir_loop_analyze.h
+++ b/src/compiler/nir/nir_loop_analyze.h
@@ -21,7 +21,8 @@
  * IN THE SOFTWARE.
  */
 
-#pragma once
+#ifndef NIR_LOOP_ANALYZE_H
+#define NIR_LOOP_ANALYZE_H
 
 #include "nir.h"
 
@@ -90,3 +91,5 @@ nir_is_trivial_loop_if(nir_if *nif, nir_block *break_block)
 
    return true;
 }
+
+#endif /* NIR_LOOP_ANALYZE_H */
diff --git a/src/compiler/nir/nir_phi_builder.h b/src/compiler/nir/nir_phi_builder.h
index a4dc18a2b22..c663d04183f 100644
--- a/src/compiler/nir/nir_phi_builder.h
+++ b/src/compiler/nir/nir_phi_builder.h
@@ -21,7 +21,8 @@
  * IN THE SOFTWARE.
  */
 
-#pragma once
+#ifndef NIR_PHI_BUILDER_H
+#define NIR_PHI_BUILDER_H
 
 #include "nir.h"
 
@@ -114,3 +115,5 @@ nir_phi_builder_value_get_block_def(struct nir_phi_builder_value *val,
  * adds the phi nodes to the program.
  */
 void nir_phi_builder_finish(struct nir_phi_builder *pb);
+
+#endif /* NIR_PHI_BUILDER_H */
diff --git a/src/compiler/nir/nir_vla.h b/src/compiler/nir/nir_vla.h
index 753783316a2..d01c039cfd2 100644
--- a/src/compiler/nir/nir_vla.h
+++ b/src/compiler/nir/nir_vla.h
@@ -25,8 +25,8 @@
  *
  **************************************************************************/
 
-#pragma once
-
+#ifndef NIR_VLA_H
+#define NIR_VLA_H
 
 #include "c99_alloca.h"
 
@@ -52,3 +52,5 @@
  */
 #define NIR_VLA_ZERO(_type, _name, _length) \
    NIR_VLA_FILL(_type, _name, _length, 0)
+
+#endif /* NIR_VLA_H */
diff --git a/src/compiler/nir/nir_worklist.h b/src/compiler/nir/nir_worklist.h
index 829bff24a55..39521a386ce 100644
--- a/src/compiler/nir/nir_worklist.h
+++ b/src/compiler/nir/nir_worklist.h
@@ -25,7 +25,6 @@
  *
  */
 
-#pragma once
 
 #ifndef _NIR_WORKLIST_
 #define _NIR_WORKLIST_
-- 
2.11.1



More information about the mesa-dev mailing list