diff options
Diffstat (limited to 'src/3rdparty/angle/src/compiler/translator/FindSymbolNode.cpp')
-rw-r--r-- | src/3rdparty/angle/src/compiler/translator/FindSymbolNode.cpp | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/src/3rdparty/angle/src/compiler/translator/FindSymbolNode.cpp b/src/3rdparty/angle/src/compiler/translator/FindSymbolNode.cpp deleted file mode 100644 index a2a10f128d..0000000000 --- a/src/3rdparty/angle/src/compiler/translator/FindSymbolNode.cpp +++ /dev/null @@ -1,58 +0,0 @@ -// -// Copyright (c) 2015 The ANGLE Project Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. -// -// FindSymbol.cpp: -// Utility for finding a symbol node inside an AST tree. - -#include "compiler/translator/FindSymbolNode.h" - -#include "compiler/translator/IntermTraverse.h" - -namespace sh -{ - -namespace -{ - -class SymbolFinder : public TIntermTraverser -{ - public: - SymbolFinder(const TString &symbolName, TBasicType basicType) - : TIntermTraverser(true, false, false), - mSymbolName(symbolName), - mNodeFound(nullptr), - mBasicType(basicType) - { - } - - void visitSymbol(TIntermSymbol *node) - { - if (node->getBasicType() == mBasicType && node->getSymbol() == mSymbolName) - { - mNodeFound = node; - } - } - - bool isFound() const { return mNodeFound != nullptr; } - const TIntermSymbol *getNode() const { return mNodeFound; } - - private: - TString mSymbolName; - TIntermSymbol *mNodeFound; - TBasicType mBasicType; -}; - -} // anonymous namespace - -const TIntermSymbol *FindSymbolNode(TIntermNode *root, - const TString &symbolName, - TBasicType basicType) -{ - SymbolFinder finder(symbolName, basicType); - root->traverse(&finder); - return finder.getNode(); -} - -} // namespace sh |