Flutter Engine
The Flutter Engine
third_party
skia
src
sksl
analysis
SkSLSymbolTableStackBuilder.cpp
Go to the documentation of this file.
1
/*
2
* Copyright 2021 Google LLC
3
*
4
* Use of this source code is governed by a BSD-style license that can be
5
* found in the LICENSE file.
6
*/
7
8
#include "
src/sksl/SkSLAnalysis.h
"
9
#include "
src/sksl/ir/SkSLBlock.h
"
10
#include "
src/sksl/ir/SkSLForStatement.h
"
11
#include "
src/sksl/ir/SkSLIRNode.h
"
12
#include "
src/sksl/ir/SkSLStatement.h
"
13
14
#include <vector>
15
16
namespace
SkSL
{
17
18
class
SymbolTable;
19
20
namespace
Analysis {
21
22
SymbolTableStackBuilder::SymbolTableStackBuilder
(
const
Statement
* stmt,
23
std::vector<SymbolTable*>* stack) {
24
if
(stmt) {
25
switch
(stmt->
kind
()) {
26
case
Statement::Kind::kBlock:
27
if
(
SymbolTable
*
symbols
= stmt->
as
<
Block
>().
symbolTable
()) {
28
stack->push_back(
symbols
);
29
fStackToPop = stack;
30
}
31
break
;
32
33
case
Statement::Kind::kFor:
34
if
(
SymbolTable
*
symbols
= stmt->
as
<
ForStatement
>().
symbols
()) {
35
stack->push_back(
symbols
);
36
fStackToPop = stack;
37
}
38
break
;
39
40
default
:
41
break
;
42
}
43
}
44
}
45
46
SymbolTableStackBuilder::~SymbolTableStackBuilder
() {
47
if
(fStackToPop) {
48
fStackToPop->pop_back();
49
}
50
}
51
52
}
// namespace Analysis
53
}
// namespace SkSL
SkSLAnalysis.h
SkSLBlock.h
SkSLForStatement.h
SkSLIRNode.h
SkSLStatement.h
SkSL::Analysis::SymbolTableStackBuilder::SymbolTableStackBuilder
SymbolTableStackBuilder(const Statement *stmt, std::vector< SymbolTable * > *stack)
Definition:
SkSLSymbolTableStackBuilder.cpp:22
SkSL::Analysis::SymbolTableStackBuilder::~SymbolTableStackBuilder
~SymbolTableStackBuilder()
Definition:
SkSLSymbolTableStackBuilder.cpp:46
SkSL::Block
Definition:
SkSLBlock.h:26
SkSL::Block::symbolTable
SymbolTable * symbolTable() const
Definition:
SkSLBlock.h:91
SkSL::ForStatement
Definition:
SkSLForStatement.h:39
SkSL::ForStatement::symbols
SymbolTable * symbols() const
Definition:
SkSLForStatement.h:123
SkSL::IRNode::as
const T & as() const
Definition:
SkSLIRNode.h:133
SkSL::Statement
Definition:
SkSLStatement.h:19
SkSL::Statement::kind
Kind kind() const
Definition:
SkSLStatement.h:28
SkSL::SymbolTable
Definition:
SkSLSymbolTable.h:35
SkSL
Definition:
SkCapabilities.h:15
dart_profiler_symbols.symbols
list symbols
Definition:
dart_profiler_symbols.py:62
Generated on Sun Jun 23 2024 21:56:33 for Flutter Engine by
1.9.4