glsl: consistently use ifndef guards over pragma once

Through the glsl headers we had an odd mix of guards be that
"ifndef", "pragma once" neither or both.

Simplify things by using the more common ones (ifndef) and annotating
all the sources, barring the generated builting header -
builtin_int64.h.

The final header - udivmod64.h - is [seemingly] unused and on its way
out (patch purge it is on the mailing list).

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Vedran Miletić <vedran@miletic.net>
Acked-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
This commit is contained in:
Emil Velikov
2017-03-20 16:04:08 +00:00
parent b0bfb5f89c
commit b08aee305e
31 changed files with 48 additions and 23 deletions

View File

@@ -22,7 +22,6 @@
* DEALINGS IN THE SOFTWARE.
*/
#pragma once
#ifndef AST_H
#define AST_H

View File

@@ -21,7 +21,6 @@
* IN THE SOFTWARE.
*/
#pragma once
#ifndef BLOB_H
#define BLOB_H

View File

@@ -21,7 +21,6 @@
* DEALINGS IN THE SOFTWARE.
*/
#pragma once
#ifndef GLSL_PARSER_EXTRAS_H
#define GLSL_PARSER_EXTRAS_H

View File

@@ -22,7 +22,6 @@
* DEALINGS IN THE SOFTWARE.
*/
#pragma once
#ifndef GLSL_SYMBOL_TABLE
#define GLSL_SYMBOL_TABLE

View File

@@ -25,6 +25,9 @@
*
*/
#ifndef GLSL_TO_NIR_H
#define GLSL_TO_NIR_H
#include "compiler/nir/nir.h"
#ifdef __cplusplus
@@ -40,3 +43,5 @@ nir_shader *glsl_to_nir(const struct gl_shader_program *shader_prog,
#ifdef __cplusplus
}
#endif
#endif /* GLSL_TO_NIR_H */

View File

@@ -22,7 +22,6 @@
* DEALINGS IN THE SOFTWARE.
*/
#pragma once
#ifndef IR_H
#define IR_H

View File

@@ -27,6 +27,9 @@
* Provides a visitor which produces a list of variables referenced.
*/
#ifndef GLSL_IR_ARRAY_REFCOUNT_H
#define GLSL_IR_ARRAY_REFCOUNT_H
#include "ir.h"
#include "ir_visitor.h"
#include "compiler/glsl_types.h"
@@ -181,3 +184,5 @@ private:
unsigned derefs_size;
/*@}*/
};
#endif /* GLSL_IR_ARRAY_REFCOUNT_H */

View File

@@ -21,8 +21,13 @@
* DEALINGS IN THE SOFTWARE.
*/
#ifndef GLSL_IR_BASIC_BLOCK_H
#define GLSL_IR_BASIC_BLOCK_H
void call_for_basic_blocks(exec_list *instructions,
void (*callback)(ir_instruction *first,
ir_instruction *last,
void *data),
void *data);
#endif /* GLSL_IR_BASIC_BLOCK_H */

View File

@@ -22,7 +22,6 @@
* DEALINGS IN THE SOFTWARE.
*/
#pragma once
#ifndef IR_BUILDER_PRINT_VISITOR_H
#define IR_BUILDER_PRINT_VISITOR_H

View File

@@ -34,5 +34,10 @@
* instruction stream.
*/
#ifndef GLSL_IR_EXPRESSION_FLATTENING_H
#define GLSL_IR_EXPRESSION_FLATTENING_H
void do_expression_flattening(exec_list *instructions,
bool (*predicate)(ir_instruction *ir));
#endif /* GLSL_IR_EXPRESSION_FLATTENING_H */

View File

@@ -27,4 +27,9 @@
* Replaces calls to functions with the body of the function.
*/
#ifndef GLSL_IR_FUNCTION_INLINING_H
#define GLSL_IR_FUNCTION_INLINING_H
bool can_inline(ir_call *call);
#endif /* GLSL_IR_FUNCTION_INLINING_H */

View File

@@ -22,7 +22,6 @@
* DEALINGS IN THE SOFTWARE.
*/
#pragma once
#ifndef IR_HIERARCHICAL_VISITOR_H
#define IR_HIERARCHICAL_VISITOR_H

View File

@@ -21,13 +21,15 @@
* DEALINGS IN THE SOFTWARE.
*/
/**
* \file ir_optimization.h
*
* Prototypes for optimization passes to be called by the compiler and drivers.
*/
#ifndef GLSL_IR_OPTIMIZATION_H
#define GLSL_IR_OPTIMIZATION_H
/* Operations for lower_instructions() */
#define SUB_TO_ADD_NEG 0x01
#define FDIV_TO_MUL_RCP 0x02
@@ -173,3 +175,5 @@ compare_index_block(exec_list *instructions, ir_variable *index,
bool lower_64bit_integer_instructions(exec_list *instructions,
unsigned what_to_lower);
#endif /* GLSL_IR_OPTIMIZATION_H */

View File

@@ -22,7 +22,6 @@
* DEALINGS IN THE SOFTWARE.
*/
#pragma once
#ifndef IR_PRINT_VISITOR_H
#define IR_PRINT_VISITOR_H

View File

@@ -22,7 +22,6 @@
* DEALINGS IN THE SOFTWARE.
*/
#pragma once
#ifndef IR_READER_H
#define IR_READER_H

View File

@@ -30,6 +30,9 @@
* a pointer to each rvalue in the tree.
*/
#ifndef GLSL_IR_RVALUE_VISITOR_H
#define GLSL_IR_RVALUE_VISITOR_H
class ir_rvalue_base_visitor : public ir_hierarchical_visitor {
public:
ir_visitor_status rvalue_visit(ir_assignment *);
@@ -81,3 +84,5 @@ public:
virtual ir_visitor_status visit_enter(ir_emit_vertex *);
virtual ir_visitor_status visit_enter(ir_end_primitive *);
};
#endif /* GLSL_IR_RVALUE_VISITOR_H */

View File

@@ -21,7 +21,6 @@
* DEALINGS IN THE SOFTWARE.
*/
#pragma once
#ifndef IR_UNIFORM_H
#define IR_UNIFORM_H

View File

@@ -29,6 +29,9 @@
* were defined in the scope.
*/
#ifndef GLSL_IR_VARIABLE_REFCOUNT_H
#define GLSL_IR_VARIABLE_REFCOUNT_H
#include "ir.h"
#include "ir_visitor.h"
#include "compiler/glsl_types.h"
@@ -84,3 +87,5 @@ public:
void *mem_ctx;
};
#endif /* GLSL_IR_VARIABLE_REFCOUNT_H */

View File

@@ -22,7 +22,6 @@
* DEALINGS IN THE SOFTWARE.
*/
#pragma once
#ifndef IR_VISITOR_H
#define IR_VISITOR_H

View File

@@ -21,7 +21,6 @@
* DEALINGS IN THE SOFTWARE.
*/
#pragma once
#ifndef LINK_UNIFORM_BLOCK_ACTIVE_VISITOR_H
#define LINK_UNIFORM_BLOCK_ACTIVE_VISITOR_H

View File

@@ -21,7 +21,6 @@
* DEALINGS IN THE SOFTWARE.
*/
#pragma once
#ifndef GLSL_LINK_VARYINGS_H
#define GLSL_LINK_VARYINGS_H

View File

@@ -22,7 +22,6 @@
* DEALINGS IN THE SOFTWARE.
*/
#pragma once
#ifndef GLSL_LINKER_H
#define GLSL_LINKER_H

View File

@@ -40,7 +40,6 @@
* exec_list or any structure in which an \c exec_list is embedded.
*/
#pragma once
#ifndef LIST_CONTAINER_H
#define LIST_CONTAINER_H

View File

@@ -22,7 +22,6 @@
* DEALINGS IN THE SOFTWARE.
*/
#pragma once
#ifndef LOOP_ANALYSIS_H
#define LOOP_ANALYSIS_H

View File

@@ -31,7 +31,6 @@
* shared variables.
*/
#pragma once
#ifndef LOWER_BUFFER_ACCESS_H
#define LOWER_BUFFER_ACCESS_H

View File

@@ -22,6 +22,8 @@
* OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef GLSL_PROGRAM_H
#define GLSL_PROGRAM_H
#ifdef __cplusplus
extern "C" {
@@ -57,3 +59,5 @@ linker_warning(struct gl_shader_program *prog, const char *fmt, ...)
extern long
parse_program_resource_name(const GLchar *name,
const GLchar **out_base_name_end);
#endif /* GLSL_PROGRAM_H */

View File

@@ -22,7 +22,6 @@
* DEALINGS IN THE SOFTWARE.
*/
#pragma once
#ifndef S_EXPRESSION_H
#define S_EXPRESSION_H

View File

@@ -21,7 +21,6 @@
* DEALINGS IN THE SOFTWARE.
*/
#pragma once
#ifndef SHADER_CACHE
#define SHADER_CACHE

View File

@@ -27,7 +27,6 @@
* compiling builtins).
*/
#pragma once
#ifndef STANDALONE_SCAFFOLDING_H
#define STANDALONE_SCAFFOLDING_H

View File

@@ -21,7 +21,6 @@
* DEALINGS IN THE SOFTWARE.
*/
#pragma once
#ifndef TEST_OPTPASS_H
#define TEST_OPTPASS_H

View File

@@ -21,7 +21,8 @@
* DEALINGS IN THE SOFTWARE.
*/
#pragma once
#ifndef GLSL_UNIFORM_INITIALIZER_UTILS_H
#define GLSL_UNIFORM_INITIALIZER_UTILS_H
#include "program/prog_parameter.h"
#include "ir.h"
@@ -46,3 +47,5 @@ extern void
verify_data(gl_constant_value *storage, unsigned storage_array_size,
ir_constant *val, unsigned red_zone_size,
unsigned int boolean_true);
#endif /* GLSL_UNIFORM_INITIALIZER_UTILS_H */