]> git.tdb.fi Git - libs/gl.git/commitdiff
Tweaks to the AST debug output
authorMikko Rasa <tdb@tdb.fi>
Sun, 21 Feb 2021 02:39:57 +0000 (04:39 +0200)
committerMikko Rasa <tdb@tdb.fi>
Sun, 21 Feb 2021 03:02:28 +0000 (05:02 +0200)
source/glsl/debug.cpp

index 80346dd0af6a86cc09c13785335c7aad28a2108d..0a5b6ef375be2efccb77261fdf6c9e124c4f2b05 100644 (file)
@@ -147,7 +147,7 @@ void DumpTree::visit(BinaryExpression &binary)
 
 void DumpTree::visit(Assignment &assign)
 {
-       append(format("Assignment%s", (assign.self_referencing ? " (self-referencing)" : "")));
+       append(format("Assignment: %s%s", assign.oper, (assign.self_referencing ? " (self-referencing)" : "")));
        begin_sub();
        assign.left->visit(*this);
        last_branch();
@@ -157,11 +157,12 @@ void DumpTree::visit(Assignment &assign)
 
 void DumpTree::visit(FunctionCall &call)
 {
-       string head = format("Function call: %s", call.name);
+       string head = "Function call: ";
        if(call.declaration)
-               head += format(", declaration %%%d", get_label(*call.declaration));
+               head += format("%%%d ", get_label(*call.declaration));
+       head += call.name;
        if(call.constructor)
-               head += ", constructor";
+               head += " (constructor)";
        append(head);
 
        begin_sub();
@@ -227,6 +228,8 @@ void DumpTree::visit(VariableDeclaration &var)
        if(!var.precision.empty())
                decl += format("%s ", var.precision);
        decl += format("%s %s", var.type, var.name);
+       if(var.linked_declaration)
+               decl += " (linked)";
        append(decl);
 
        begin_sub();