CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
ReferenceAnalyzer.hpp
Go to the documentation of this file.
1//
2// CeresEngine - A game development framework
3//
4// Created by Rogiel Sulzbach.
5// Copyright (c) 2018-2022 Rogiel Sulzbach. All rights reserved.
6//
7
8#pragma once
9
10#include "VisitorTracker.hpp"
11
14
16
18
24 private:
25 Program* mProgram = nullptr;
27
29
30 public:
31 // Marks all declarational AST nodes (i.e. function decl, structure decl etc.) that are reachable from the specififed entry point.
32 void markReferencesFromEntryPoint(Program& program, const ShaderTarget shaderTarget);
33
34 private:
35 // Marks the specified AST node as reachable and returns false if the AST node has already been marked as reachable.
37
39
40 void markLValueExpression(const Expression* expression);
42
43 private: // Visitor implementation
47
52
58
64 };
65
66} // namespace CeresEngine::ShaderCompiler
#define DECLARATION_VISIT_PROC(CLASS_NAME)
Definition Visitor.hpp:88
Object reference analyzer.
Definition ReferenceAnalyzer.hpp:23
void markLValueExpression(const Expression *expression)
void visitStatementList(const Vector< StatementPtr > &statements)
ShaderTarget mShaderTarget
Definition ReferenceAnalyzer.hpp:26
void markReferencesFromEntryPoint(Program &program, const ShaderTarget shaderTarget)
Vector< CallExpression * > mCallExpressionStack
Definition ReferenceAnalyzer.hpp:28
Program * mProgram
Definition ReferenceAnalyzer.hpp:25
void markLValueExpressionObject(const ObjectExpression *objectExpression)
Definition VisitorTracker.hpp:18
Definition AST.hpp:33
ShaderTarget
Shader target enumeration.
Definition Targets.hpp:16
std::vector< T, ScopedAllocatorAdaptor< StdAllocator< T, RawAllocator > > > Vector
Vector is a sequence container that encapsulates dynamic size arrays.
Definition Vector.hpp:17
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25
Definition AST.hpp:1159