glsl: Mark functions static
authorMatt Turner <mattst88@gmail.com>
Sun, 9 Jul 2017 21:12:31 +0000 (14:12 -0700)
committerMatt Turner <mattst88@gmail.com>
Mon, 21 Aug 2017 21:45:44 +0000 (14:45 -0700)
Cuts 3224 bytes of .text

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
src/compiler/glsl/ast_function.cpp
src/compiler/glsl/ast_to_hir.cpp
src/compiler/glsl/glsl_parser_extras.cpp
src/compiler/glsl/ir_validate.cpp
src/compiler/glsl/link_uniform_initializers.cpp
src/compiler/glsl/link_varyings.cpp
src/compiler/glsl/linker.cpp
src/compiler/glsl/lower_if_to_cond_assign.cpp
src/compiler/glsl/lower_vector.cpp
src/compiler/glsl/main.cpp
src/compiler/glsl/standalone.cpp

index b121ab92107e418bb10304d4bb4ccb14c4ee64f5..d528eccf313ff9bcf0b0e788be18391832f175fd 100644 (file)
@@ -1277,7 +1277,7 @@ process_array_constructor(exec_list *instructions,
 /**
  * Determine if a list consists of a single scalar r-value
  */
-bool
+static bool
 single_scalar_parameter(exec_list *parameters)
 {
    const ir_rvalue *const p = (ir_rvalue *) parameters->get_head_raw();
@@ -1298,7 +1298,7 @@ single_scalar_parameter(exec_list *parameters)
  * An \c ir_dereference_variable of the temprorary generated in the constructor
  * body.
  */
-ir_rvalue *
+static ir_rvalue *
 emit_inline_vector_constructor(const glsl_type *type,
                                exec_list *instructions,
                                exec_list *parameters,
@@ -1462,7 +1462,7 @@ emit_inline_vector_constructor(const glsl_type *type,
  * \c src_base + \c count must be less than or equal to the number of
  * components in the source vector.
  */
-ir_instruction *
+static ir_instruction *
 assign_to_matrix_column(ir_variable *var, unsigned column, unsigned row_base,
                         ir_rvalue *src, unsigned src_base, unsigned count,
                         void *mem_ctx)
@@ -1502,7 +1502,7 @@ assign_to_matrix_column(ir_variable *var, unsigned column, unsigned row_base,
  * An \c ir_dereference_variable of the temprorary generated in the constructor
  * body.
  */
-ir_rvalue *
+static ir_rvalue *
 emit_inline_matrix_constructor(const glsl_type *type,
                                exec_list *instructions,
                                exec_list *parameters,
@@ -1771,7 +1771,7 @@ emit_inline_matrix_constructor(const glsl_type *type,
 }
 
 
-ir_rvalue *
+static ir_rvalue *
 emit_inline_record_constructor(const glsl_type *type,
                                exec_list *instructions,
                                exec_list *parameters,
index f0a96c3e1e80c8a6605a56f88925cb3866b3f315..98d2f94e12991b7f68f4c9068f6d79e341ae6dd7 100644 (file)
@@ -1182,7 +1182,7 @@ do_comparison(void *mem_ctx, int operation, ir_rvalue *op0, ir_rvalue *op1)
  * scalar booleans.  If it isn't, emit an error and return a constant
  * boolean to avoid triggering cascading error messages.
  */
-ir_rvalue *
+static ir_rvalue *
 get_scalar_boolean_operand(exec_list *instructions,
                            struct _mesa_glsl_parse_state *state,
                            ast_expression *parent_expr,
@@ -4322,7 +4322,7 @@ get_variable_being_redeclared(ir_variable *var, YYLTYPE loc,
 /**
  * Generate the IR for an initializer in a variable declaration
  */
-ir_rvalue *
+static ir_rvalue *
 process_initializer(ir_variable *var, ast_declaration *decl,
                     ast_fully_specified_type *type,
                     exec_list *initializer_instructions,
@@ -4719,7 +4719,7 @@ handle_geometry_shader_input_decl(struct _mesa_glsl_parse_state *state,
                                           "geometry shader input");
 }
 
-void
+static void
 validate_identifier(const char *identifier, YYLTYPE loc,
                     struct _mesa_glsl_parse_state *state)
 {
index 8f1651d494fd26dbb2af563b02649a3e0efae471..cfb214e4404b527a22400d41f17b1940fb522dd5 100644 (file)
@@ -1079,7 +1079,7 @@ _mesa_ast_process_interface_block(YYLTYPE *locp,
    }
 }
 
-void
+static void
 _mesa_ast_type_qualifier_print(const struct ast_type_qualifier *q)
 {
    if (q->is_subroutine_decl())
index 397cd080b19d2fd61a0fa352aba4c6f80bebe74a..becce771be230645a0480b3f76a33de8a7ab8057 100644 (file)
@@ -1043,7 +1043,7 @@ ir_validate::validate_ir(ir_instruction *ir, void *data)
    _mesa_set_add(ir_set, ir);
 }
 
-void
+static void
 check_node_type(ir_instruction *ir, void *data)
 {
    (void) data;
index e7f9c9d8ac0ed51c5f9bb101eb8087d86b2628bd..24b9ba574841677d2870439eb563ad5f6212c1e0 100644 (file)
@@ -33,7 +33,7 @@
  */
 namespace linker {
 
-gl_uniform_storage *
+static gl_uniform_storage *
 get_storage(struct gl_shader_program *prog, const char *name)
 {
    unsigned id;
@@ -44,7 +44,7 @@ get_storage(struct gl_shader_program *prog, const char *name)
    return NULL;
 }
 
-void
+static void
 copy_constant_to_storage(union gl_constant_value *storage,
                          const ir_constant *val,
                          const enum glsl_base_type base_type,
@@ -95,7 +95,7 @@ copy_constant_to_storage(union gl_constant_value *storage,
  * qualifier specified in the shader.  Atomic counters are different because
  * they have no storage and should be handled elsewhere.
  */
-void
+static void
 set_opaque_binding(void *mem_ctx, gl_shader_program *prog,
                    const ir_variable *var, const glsl_type *type,
                    const char *name, int *binding)
@@ -179,7 +179,7 @@ set_opaque_binding(void *mem_ctx, gl_shader_program *prog,
    }
 }
 
-void
+static void
 set_block_binding(gl_shader_program *prog, const char *block_name,
                   unsigned mode, int binding)
 {
@@ -199,7 +199,7 @@ set_block_binding(gl_shader_program *prog, const char *block_name,
    unreachable("Failed to initialize block binding");
 }
 
-void
+static void
 set_uniform_initializer(void *mem_ctx, gl_shader_program *prog,
                         const char *name, const glsl_type *type,
                         ir_constant *val, unsigned int boolean_true)
index de3754c423a19dd46a309d6a3d610a6fed45bce0..764d9af1c19f5614956691b6e5ef5cb915ee5d1d 100644 (file)
@@ -1893,7 +1893,7 @@ private:
 
 namespace linker {
 
-void
+static void
 populate_consumer_input_sets(void *mem_ctx, exec_list *ir,
                              hash_table *consumer_inputs,
                              hash_table *consumer_interface_inputs,
@@ -1951,7 +1951,7 @@ populate_consumer_input_sets(void *mem_ctx, exec_list *ir,
  * This function only finds inputs with names that match.  There is no
  * validation (here) that the types, etc. are compatible.
  */
-ir_variable *
+static ir_variable *
 get_matching_input(void *mem_ctx,
                    const ir_variable *output_var,
                    hash_table *consumer_inputs,
@@ -2349,7 +2349,7 @@ assign_varying_locations(struct gl_context *ctx,
    return true;
 }
 
-bool
+static bool
 check_against_output_limit(struct gl_context *ctx,
                            struct gl_shader_program *prog,
                            gl_linked_shader *producer,
@@ -2393,7 +2393,7 @@ check_against_output_limit(struct gl_context *ctx,
    return true;
 }
 
-bool
+static bool
 check_against_input_limit(struct gl_context *ctx,
                           struct gl_shader_program *prog,
                           gl_linked_shader *consumer,
index 9af7d8033aab505819dae39ec26e2b29fb2f37ad..974dba931fbc72950c236f2c8f7e35169f8ac056 100644 (file)
@@ -675,7 +675,7 @@ analyze_clip_cull_usage(struct gl_shader_program *prog,
  *
  * \param shader  Vertex shader executable to be verified
  */
-void
+static void
 validate_vertex_shader_executable(struct gl_shader_program *prog,
                                   struct gl_linked_shader *shader,
                                   struct gl_context *ctx)
@@ -730,7 +730,7 @@ validate_vertex_shader_executable(struct gl_shader_program *prog,
                            &shader->Program->info.cull_distance_array_size);
 }
 
-void
+static void
 validate_tess_eval_shader_executable(struct gl_shader_program *prog,
                                      struct gl_linked_shader *shader,
                                      struct gl_context *ctx)
@@ -749,7 +749,7 @@ validate_tess_eval_shader_executable(struct gl_shader_program *prog,
  *
  * \param shader  Fragment shader executable to be verified
  */
-void
+static void
 validate_fragment_shader_executable(struct gl_shader_program *prog,
                                     struct gl_linked_shader *shader)
 {
@@ -775,7 +775,7 @@ validate_fragment_shader_executable(struct gl_shader_program *prog,
  *
  * \param shader Geometry shader executable to be verified
  */
-void
+static void
 validate_geometry_shader_executable(struct gl_shader_program *prog,
                                     struct gl_linked_shader *shader,
                                     struct gl_context *ctx)
@@ -892,7 +892,7 @@ validate_intrastage_arrays(struct gl_shader_program *prog,
 /**
  * Perform validation of global variables used across multiple shaders
  */
-void
+static void
 cross_validate_globals(struct gl_shader_program *prog,
                        struct exec_list *ir, glsl_symbol_table *variables,
                        bool uniforms_only)
@@ -1135,7 +1135,7 @@ cross_validate_globals(struct gl_shader_program *prog,
 /**
  * Perform validation of uniforms used across multiple shader stages
  */
-void
+static void
 cross_validate_uniforms(struct gl_shader_program *prog)
 {
    glsl_symbol_table variables;
@@ -1292,7 +1292,7 @@ populate_symbol_table(gl_linked_shader *sh)
  * \param instructions Instruction stream where new variable declarations
  *                     should be added.
  */
-void
+static void
 remap_variables(ir_instruction *inst, struct gl_linked_shader *target,
                 hash_table *temps)
 {
@@ -1366,7 +1366,7 @@ remap_variables(ir_instruction *inst, struct gl_linked_shader *target,
  * is suitable for use as the \c last parameter of a later call to this
  * function.
  */
-exec_node *
+static exec_node *
 move_non_declarations(exec_list *instructions, exec_node *last,
                       bool make_copies, gl_linked_shader *target)
 {
@@ -2548,7 +2548,7 @@ resize_tes_inputs(struct gl_context *ctx,
  * \return
  * Base location of the available bits on success or -1 on failure.
  */
-int
+static int
 find_available_slots(unsigned used_mask, unsigned needed_count)
 {
    unsigned needed_mask = (1 << needed_count) - 1;
@@ -2585,7 +2585,7 @@ find_available_slots(unsigned used_mask, unsigned needed_count)
  * If locations are successfully assigned, true is returned.  Otherwise an
  * error is emitted to the shader link log and false is returned.
  */
-bool
+static bool
 assign_attribute_or_color_locations(void *mem_ctx,
                                     gl_shader_program *prog,
                                     struct gl_constants *constants,
index 37f1ec8600c82e0794389b36a4ae0112ef67638f..54bcae75ecb5da2f13ba683626b572b0c57fa25a 100644 (file)
@@ -115,7 +115,7 @@ lower_if_to_cond_assign(gl_shader_stage stage, exec_list *instructions,
    return v.progress;
 }
 
-void
+static void
 check_ir_node(ir_instruction *ir, void *data)
 {
    ir_if_to_cond_assign_visitor *v = (ir_if_to_cond_assign_visitor *)data;
@@ -168,7 +168,7 @@ check_ir_node(ir_instruction *ir, void *data)
    }
 }
 
-void
+static void
 move_block_to_cond_assign(void *mem_ctx,
                          ir_if *if_ir, ir_rvalue *cond_expr,
                          exec_list *instructions,
index 72192b1b25862a813538bcd0ba12bf1bc0e01a56..4024644b0628f11193584a0e40e29b3b2bdf2dae 100644 (file)
@@ -58,7 +58,7 @@ public:
  * Extended swizzles consist of access of a single vector source (with possible
  * per component negation) and the constants -1, 0, or 1.
  */
-bool
+static bool
 is_extended_swizzle(ir_expression *ir)
 {
    /* Track any variables that are accessed by this expression.
index e0d3ab75d16679c74d0e6be47871ac452c112ca0..123e41f9dcc212521ef36ec929a8f889909c93ea 100644 (file)
@@ -52,7 +52,7 @@ const struct option compiler_opts[] = {
 /**
  * \brief Print proper usage and exit with failure.
  */
-void
+static void
 usage_fail(const char *name)
 {
 
index 8e5bc352fc6ae91a37db3ff36581e42e0c06cb00..7e5c06d20541ebeff1e1f5c87db80f8539ee406a 100644 (file)
@@ -100,7 +100,7 @@ private:
    set *variables;
 };
 
-void
+static void
 init_gl_program(struct gl_program *prog, GLenum target, bool is_arb_asm)
 {
    prog->RefCount = 1;
@@ -108,7 +108,7 @@ init_gl_program(struct gl_program *prog, GLenum target, bool is_arb_asm)
    prog->is_arb_asm = is_arb_asm;
 }
 
-struct gl_program *
+static struct gl_program *
 new_program(struct gl_context *ctx, GLenum target, GLuint id, bool is_arb_asm)
 {
    switch (target) {
@@ -374,7 +374,7 @@ load_text_file(void *ctx, const char *file_name)
    return text;
 }
 
-void
+static void
 compile_shader(struct gl_context *ctx, struct gl_shader *shader)
 {
    struct _mesa_glsl_parse_state *state =