Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
glslastdump.cpp
Go to the documentation of this file.
1// Copyright (C) 2021 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#include "glslastdump_p.h"
5#include <QTextStream>
6
7#include <typeinfo>
8
9#ifdef Q_CC_GNU
10# include <cxxabi.h>
11#endif
12
14
15using namespace GLSL;
16
18 : out(out), _depth(0)
19{
20}
21
23{
24 _depth = 0;
25 accept(ast);
26}
27
29{
30 const char *id = typeid(*ast).name();
31#ifdef Q_CC_GNU
32 char *cppId = abi::__cxa_demangle(id, nullptr, nullptr, nullptr);
33 id = cppId;
34#endif
35 out << QByteArray(_depth, ' ') << id << '\n';
36#ifdef Q_CC_GNU
37 free(cppId);
38#endif
39 ++_depth;
40 return true;
41}
42
44{
45 --_depth;
46}
47
bool preVisit(AST *) override
ASTDump(QTextStream &out)
void operator()(AST *ast)
void postVisit(AST *) override
void accept(AST *ast)
\inmodule QtCore
Definition qbytearray.h:57
\inmodule QtCore
Definition glsl_p.h:22
Combined button and popup list for selecting options.
QTextStream out(stdout)
[7]