compiler/glsl: Move glsl_print_type from glsl_types.* to ir_print_visitor.cpp
authorYonggang Luo <luoyonggang@gmail.com>
Sun, 6 Aug 2023 05:08:09 +0000 (13:08 +0800)
committerMarge Bot <emma+marge@anholt.net>
Thu, 24 Aug 2023 02:54:09 +0000 (02:54 +0000)
glsl_print_type only referenced in ir_print_visitor.cpp
there is no need expose it

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24824>

src/compiler/glsl/ir_print_visitor.cpp
src/compiler/glsl_types.cpp
src/compiler/glsl_types.h

index 0b51051..45988bb 100644 (file)
@@ -45,6 +45,20 @@ ir_instruction::fprint(FILE *f) const
    deconsted->accept(&v);
 }
 
+static void
+glsl_print_type(FILE *f, const glsl_type *t)
+{
+   if (t->is_array()) {
+      fprintf(f, "(array ");
+      glsl_print_type(f, t->fields.array);
+      fprintf(f, " %u)", t->length);
+   } else if (t->is_struct() && !is_gl_identifier(t->name)) {
+      fprintf(f, "%s@%p", t->name, (void *) t);
+   } else {
+      fprintf(f, "%s", t->name);
+   }
+}
+
 extern "C" {
 void
 _mesa_print_ir(FILE *f, exec_list *instructions,
index 9e15305..cb5ebad 100644 (file)
@@ -3382,24 +3382,4 @@ glsl_get_sampler_dim_coordinate_components(enum glsl_sampler_dim dim)
    }
 }
 
-static inline bool
-is_gl_identifier(const char *s)
-{
-   return s && s[0] == 'g' && s[1] == 'l' && s[2] == '_';
-}
-
-void
-glsl_print_type(FILE *f, const glsl_type *t)
-{
-   if (t->is_array()) {
-      fprintf(f, "(array ");
-      glsl_print_type(f, t->fields.array);
-      fprintf(f, " %u)", t->length);
-   } else if (t->is_struct() && !is_gl_identifier(t->name)) {
-      fprintf(f, "%s@%p", t->name, (void *) t);
-   } else {
-      fprintf(f, "%s", t->name);
-   }
-}
-
 }
index d5c0721..51e233c 100644 (file)
@@ -54,9 +54,6 @@ glsl_type_singleton_decref();
 extern void
 _mesa_glsl_initialize_types(struct _mesa_glsl_parse_state *state);
 
-void
-glsl_print_type(FILE *f, const struct glsl_type *t);
-
 void encode_type_to_blob(struct blob *blob, const struct glsl_type *type);
 
 const struct glsl_type *decode_type_from_blob(struct blob_reader *blob);