#include "compiler/translator/tree_ops/PruneNoOps.h"
#include "compiler/translator/Symbol.h"
#include "compiler/translator/tree_util/IntermTraverse.h"
namespace sh
{
namespace
{
uint32_t GetSwitchConstantAsUInt(const TConstantUnion *value)
{ … }
bool IsNoOpSwitch(TIntermSwitch *node)
{ … }
bool IsNoOp(TIntermNode *node)
{ … }
class PruneNoOpsTraverser : private TIntermTraverser
{ … };
bool PruneNoOpsTraverser::apply(TCompiler *compiler, TIntermBlock *root, TSymbolTable *symbolTable)
{ … }
PruneNoOpsTraverser::PruneNoOpsTraverser(TSymbolTable *symbolTable)
: … { … }
bool PruneNoOpsTraverser::visitDeclaration(Visit visit, TIntermDeclaration *node)
{ … }
bool PruneNoOpsTraverser::visitBlock(Visit visit, TIntermBlock *node)
{ … }
bool PruneNoOpsTraverser::visitLoop(Visit visit, TIntermLoop *loop)
{ … }
bool PruneNoOpsTraverser::visitBranch(Visit visit, TIntermBranch *node)
{ … }
}
bool PruneNoOps(TCompiler *compiler, TIntermBlock *root, TSymbolTable *symbolTable)
{ … }
}