Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
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
13
QT_BEGIN_NAMESPACE
14
15
using
namespace
GLSL;
16
17
ASTDump::ASTDump(QTextStream &out)
18
: out(out), _depth(0)
19
{
20
}
21
22
void
ASTDump::operator()(AST *ast)
23
{
24
_depth = 0;
25
accept(ast);
26
}
27
28
bool
ASTDump::preVisit(AST *ast)
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
43
void
ASTDump::postVisit(AST *)
44
{
45
--_depth;
46
}
47
48
QT_END_NAMESPACE
qtquick3d
src
glslparser
glslastdump.cpp
Generated on
for Qt by
1.14.0