]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/debug.cpp
Remove the using declarations from visitors
[libs/gl.git] / source / glsl / debug.cpp
index 4de8ac90ad927ed05175923827a25895ab176d71..32eb0ec307a05db3904e2313f74008e0127a32c3 100644 (file)
@@ -17,7 +17,7 @@ const std::string &DumpTree::apply(Stage &stage)
        for(map<string, VariableDeclaration *>::const_iterator i=stage.out_variables.begin(); i!=stage.out_variables.end(); ++i)
                append(format("Output: %%%d %s %s", get_label(*i->second), i->second->type, i->first));
        last_branch();
-       visit(stage.content);
+       stage.content.visit(*this);
        return formatted;
 }
 
@@ -127,7 +127,11 @@ void DumpTree::visit(VariableReference &var)
 
 void DumpTree::visit(MemberAccess &memacc)
 {
-       annotated_branch(format("Member access: .%s", memacc.member), *memacc.left);
+       string text = "Member access:";
+       if(memacc.declaration)
+               text += format(" %%%d", get_label(*memacc.declaration));
+       text += format(" .%s", memacc.member);
+       annotated_branch(text, *memacc.left);
 }
 
 void DumpTree::visit(UnaryExpression &unary)
@@ -241,7 +245,12 @@ void DumpTree::visit(VariableDeclaration &var)
        if(!var.init_expression)
                last_branch();
        if(var.array)
-               annotated_branch("Array []", *var.array_size);
+       {
+               if(var.array_size)
+                       annotated_branch("Array []", *var.array_size);
+               else
+                       append("Array []");
+       }
 
        last_branch();
        if(var.init_expression)