#include "compiler/translator/ValidateAST.h"
#include "common/utilities.h"
#include "compiler/translator/Diagnostics.h"
#include "compiler/translator/ImmutableStringBuilder.h"
#include "compiler/translator/Symbol.h"
#include "compiler/translator/tree_util/IntermTraverse.h"
#include "compiler/translator/tree_util/SpecializationConstant.h"
#include "compiler/translator/util.h"
namespace sh
{
namespace
{
class ValidateAST : public TIntermTraverser
{ … };
bool IsSameType(const TType &a, const TType &b)
{ … }
bool IsUnaryOp(TOperator op)
{ … }
bool IsBinaryOp(TOperator op)
{ … }
bool IsBranchOp(TOperator op)
{ … }
bool ValidateAST::validate(TIntermNode *root,
TDiagnostics *diagnostics,
const ValidateASTOptions &options)
{ … }
ValidateAST::ValidateAST(TIntermNode *root,
TDiagnostics *diagnostics,
const ValidateASTOptions &options)
: … { … }
void ValidateAST::visitNode(Visit visit, TIntermNode *node)
{ … }
void ValidateAST::visitStructOrInterfaceBlockDeclaration(const TType &type,
const TSourceLoc &location)
{ … }
void ValidateAST::visitStructUsage(const TType &type, const TSourceLoc &location)
{ … }
void ValidateAST::visitBuiltInFunction(TIntermOperator *node, const TFunction *function)
{ … }
void ValidateAST::visitFunctionCall(TIntermAggregate *node)
{ … }
void ValidateAST::validateExpressionTypeBinary(TIntermBinary *node)
{ … }
void ValidateAST::validateExpressionTypeSwitch(TIntermSwitch *node)
{ … }
void ValidateAST::visitVariableNeedingDeclaration(TIntermSymbol *node)
{ … }
void ValidateAST::visitBuiltInVariable(TIntermSymbol *node)
{ … }
void ValidateAST::scope(Visit visit)
{ … }
bool ValidateAST::isVariableDeclared(const TVariable *variable)
{ … }
bool ValidateAST::variableNeedsDeclaration(const TVariable *variable)
{ … }
const TFieldListCollection *ValidateAST::getStructOrInterfaceBlock(const TType &type,
ImmutableString *typeNameOut)
{ … }
void ValidateAST::expectNonNullChildren(Visit visit, TIntermNode *node, size_t least_count)
{ … }
void ValidateAST::visitSymbol(TIntermSymbol *node)
{ … }
void ValidateAST::visitConstantUnion(TIntermConstantUnion *node)
{ … }
bool ValidateAST::visitSwizzle(Visit visit, TIntermSwizzle *node)
{ … }
bool ValidateAST::visitBinary(Visit visit, TIntermBinary *node)
{ … }
bool ValidateAST::visitUnary(Visit visit, TIntermUnary *node)
{ … }
bool ValidateAST::visitTernary(Visit visit, TIntermTernary *node)
{ … }
bool ValidateAST::visitIfElse(Visit visit, TIntermIfElse *node)
{ … }
bool ValidateAST::visitSwitch(Visit visit, TIntermSwitch *node)
{ … }
bool ValidateAST::visitCase(Visit visit, TIntermCase *node)
{ … }
void ValidateAST::visitFunctionPrototype(TIntermFunctionPrototype *node)
{ … }
bool ValidateAST::visitFunctionDefinition(Visit visit, TIntermFunctionDefinition *node)
{ … }
bool ValidateAST::visitAggregate(Visit visit, TIntermAggregate *node)
{ … }
bool ValidateAST::visitBlock(Visit visit, TIntermBlock *node)
{ … }
bool ValidateAST::visitGlobalQualifierDeclaration(Visit visit,
TIntermGlobalQualifierDeclaration *node)
{ … }
bool ValidateAST::visitDeclaration(Visit visit, TIntermDeclaration *node)
{ … }
bool ValidateAST::visitLoop(Visit visit, TIntermLoop *node)
{ … }
bool ValidateAST::visitBranch(Visit visit, TIntermBranch *node)
{ … }
void ValidateAST::visitPreprocessorDirective(TIntermPreprocessorDirective *node)
{ … }
bool ValidateAST::validateInternal()
{ … }
}
bool ValidateAST(TIntermNode *root, TDiagnostics *diagnostics, const ValidateASTOptions &options)
{ … }
}