nir: clean up white-space in deref-printing
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Fri, 14 Apr 2023 11:07:32 +0000 (13:07 +0200)
committerMarge Bot <emma+marge@anholt.net>
Thu, 27 Apr 2023 05:39:57 +0000 (05:39 +0000)
Without this, we get some trailing spaces in some cases, and some
double space in some other cases. Let's clean that up a bit.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22550>

src/compiler/nir/nir_print.c

index 05ad3f3..edab512 100644 (file)
@@ -850,12 +850,12 @@ print_deref_instr(nir_deref_instr *instr, print_state *state)
       fprintf(fp, "%s%s", get_variable_mode_str(1 << m, true),
                           modes ? "|" : "");
    }
-   fprintf(fp, " %s) ", glsl_get_type_name(instr->type));
+   fprintf(fp, " %s)", glsl_get_type_name(instr->type));
 
    if (instr->deref_type != nir_deref_type_var &&
        instr->deref_type != nir_deref_type_cast) {
       /* Print the entire chain as a comment */
-      fprintf(fp, "/* &");
+      fprintf(fp, " /* &");
       print_deref_link(instr, true, state);
       fprintf(fp, " */");
    }