summaryrefslogtreecommitdiff
path: root/ir_print_visitor.cpp
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2010-04-07 14:41:13 -0700
committerIan Romanick <ian.d.romanick@intel.com>2010-04-28 15:34:52 -0700
commit295bb7ff8d3c508320a6af60a69901999196f05f (patch)
tree72cd84a00edd6d25b6537b291c99ec5e7b7145f0 /ir_print_visitor.cpp
parent1f0cb24f8bd0f2dba23c95331b04d0a1f89d2af4 (diff)
ir_print_visitor: Remove unnecessary parenthesis around type names.
Parenthesis should only be present for compound types (i.e. arrays or structures). For atomic types, simply print the symbol.
Diffstat (limited to 'ir_print_visitor.cpp')
-rw-r--r--ir_print_visitor.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/ir_print_visitor.cpp b/ir_print_visitor.cpp
index 99dbacca11..cbe7d976ce 100644
--- a/ir_print_visitor.cpp
+++ b/ir_print_visitor.cpp
@@ -28,11 +28,11 @@ static void
print_type(const glsl_type *t)
{
if (t->base_type == GLSL_TYPE_ARRAY) {
- printf("array (");
+ printf("(array ");
print_type(t->fields.array);
- printf(") (%u))", t->length);
+ printf(" (%u))", t->length);
} else if (t->base_type == GLSL_TYPE_STRUCT) {
- printf("struct (%s %u ", t->name ? t->name : "@", t->length);
+ printf("(struct (%s %u ", t->name ? t->name : "@", t->length);
printf("(FINISHME: structure fields go here) ");
printf(")");
} else {
@@ -56,9 +56,7 @@ void ir_print_visitor::visit(ir_variable *ir)
printf("(%s%s%s%s) ",
cent, inv, mode[ir->mode], interp[ir->interpolation]);
- printf("(");
print_type(ir->type);
- printf(") ");
printf("(%s)) ", ir->name);
}
}
@@ -237,9 +235,9 @@ void ir_print_visitor::visit(ir_constant *ir)
{
const glsl_type *const base_type = ir->type->get_base_type();
- printf("(constant (");
+ printf("(constant ");
print_type(ir->type);
- printf(") (");
+ printf(" (");
for (unsigned i = 0; i < ir->type->components(); i++) {
if (i != 0)