diff options
author | Baligh Uddin <baligh@google.com> | 2013-11-01 16:01:19 -0700 |
---|---|---|
committer | Baligh Uddin <baligh@google.com> | 2013-11-01 16:01:19 -0700 |
commit | da1db04101b57a1bad4b2f98f8898a0cf01f56e6 (patch) | |
tree | e8aef2dd2cb1fd57c4c2cde0ba837800fea259ad /src/compiler/SearchSymbol.cpp | |
parent | 4e2494aba4b4026751c5e2c08deae2178086c3da (diff) | |
parent | 5e667cc092b51bf91ee9f6562dc824a2c753d1e6 (diff) | |
download | angle_dx11-idea133.tar.gz |
Merge remote-tracking branch 'origin/kitkat-dev'idea133
Diffstat (limited to 'src/compiler/SearchSymbol.cpp')
-rw-r--r-- | src/compiler/SearchSymbol.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/compiler/SearchSymbol.cpp b/src/compiler/SearchSymbol.cpp new file mode 100644 index 00000000..9368f1a4 --- /dev/null +++ b/src/compiler/SearchSymbol.cpp @@ -0,0 +1,38 @@ +// +// Copyright (c) 2002-2010 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. +// +// SearchSymbol is an AST traverser to detect the use of a given symbol name +// + +#include "compiler/SearchSymbol.h" + +#include "compiler/InfoSink.h" +#include "compiler/OutputHLSL.h" + +namespace sh +{ +SearchSymbol::SearchSymbol(const TString &symbol) : mSymbol(symbol) +{ + match = false; +} + +void SearchSymbol::traverse(TIntermNode *node) +{ + node->traverse(this); +} + +void SearchSymbol::visitSymbol(TIntermSymbol *symbolNode) +{ + if (symbolNode->getSymbol() == mSymbol) + { + match = true; + } +} + +bool SearchSymbol::foundMatch() const +{ + return match; +} +} |