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
// Qt-Security score:significant reason:default
4
5
6
#
include
"glslastdump_p.h"
7
#
include
<
QTextStream
>
8
9
#
include
<
typeinfo
>
10
11
#
ifdef
Q_CC_GNU
12
#
include
<
cxxabi
.
h
>
13
#
endif
14
15
QT_BEGIN_NAMESPACE
16
17
using
namespace
GLSL;
18
19
ASTDump::ASTDump(QTextStream &out)
20
: out(out), _depth(0)
21
{
22
}
23
24
void
ASTDump::operator()(AST *ast)
25
{
26
_depth = 0;
27
accept(ast);
28
}
29
30
bool
ASTDump::preVisit(AST *ast)
31
{
32
const
char
*id =
typeid
(*ast).name();
33
#
ifdef
Q_CC_GNU
34
char
*cppId = abi::__cxa_demangle(id,
nullptr
,
nullptr
,
nullptr
);
35
id = cppId;
36
#
endif
37
out << QByteArray(_depth,
' '
) << id <<
'\n'
;
38
#
ifdef
Q_CC_GNU
39
free(cppId);
40
#
endif
41
++_depth;
42
return
true
;
43
}
44
45
void
ASTDump::postVisit(AST *)
46
{
47
--_depth;
48
}
49
50
QT_END_NAMESPACE
qtquick3d
src
glslparser
glslastdump.cpp
Generated on
for Qt by
1.16.1