+ append(layout, format("Layout: %s", layout.interface));
+ append_subtree(layout.layout);
+}
+
+void DumpTree::visit(BasicTypeDeclaration &type)
+{
+ append(type, format("%s typedef %s", get_label(type), format_type(type.name)));
+
+ vector<Branch> branches;
+ if(type.base_type)
+ branches.emplace_back(format("%s: %s %s", (type.kind==BasicTypeDeclaration::ALIAS ? "Alias of" : "Base"), get_label(*type.base_type), format_type(type.base_type->name)));
+ if(type.kind==BasicTypeDeclaration::VECTOR)
+ branches.emplace_back(format("Vector: %d", type.size));
+ else if(type.kind==BasicTypeDeclaration::MATRIX)
+ branches.emplace_back(format("Matrix: %dx%d", type.size&0xFFFF, type.size>>16));
+ if(type.extended_alignment)
+ branches.emplace_back("Extended alignment");
+ append_subtree(branches);
+}
+
+void DumpTree::visit(ImageTypeDeclaration &type)
+{
+ static const char *const dims[] = { "1D", "2D", "3D", "Cube" };
+
+ append(type, format("%s typedef %s", get_label(type), format_type(type.name)));
+
+ vector<Branch> branches;
+ branches.emplace_back(format("Dimensions: %s%s", dims[type.dimensions-1], (type.array ? " array" : "")));
+ if(type.base_type)
+ branches.emplace_back(format("Element type: %s %s", get_label(*type.base_type), format_type(type.base_type->name)));
+ if(type.shadow)
+ branches.emplace_back("Shadow");
+ append_subtree(branches);