gfx/angle/src/compiler/SearchSymbol.cpp

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gfx/angle/src/compiler/SearchSymbol.cpp	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,38 @@
     1.4 +//
     1.5 +// Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved.
     1.6 +// Use of this source code is governed by a BSD-style license that can be
     1.7 +// found in the LICENSE file.
     1.8 +//
     1.9 +// SearchSymbol is an AST traverser to detect the use of a given symbol name
    1.10 +//
    1.11 +
    1.12 +#include "compiler/SearchSymbol.h"
    1.13 +
    1.14 +#include "compiler/InfoSink.h"
    1.15 +#include "compiler/OutputHLSL.h"
    1.16 +
    1.17 +namespace sh
    1.18 +{
    1.19 +SearchSymbol::SearchSymbol(const TString &symbol) : mSymbol(symbol)
    1.20 +{
    1.21 +    match = false;
    1.22 +}
    1.23 +
    1.24 +void SearchSymbol::traverse(TIntermNode *node)
    1.25 +{
    1.26 +    node->traverse(this);
    1.27 +}
    1.28 +
    1.29 +void SearchSymbol::visitSymbol(TIntermSymbol *symbolNode)
    1.30 +{
    1.31 +    if (symbolNode->getSymbol() == mSymbol)
    1.32 +    {
    1.33 +        match = true;
    1.34 +    }
    1.35 +}
    1.36 +
    1.37 +bool SearchSymbol::foundMatch() const
    1.38 +{
    1.39 +    return match;
    1.40 +}
    1.41 +}

mercurial