diff options
author | Nicolas Capens <nicolas@transgaming.com> | 2013-07-18 11:35:59 -0400 |
---|---|---|
committer | Shannon Woods <shannonwoods@chromium.org> | 2013-07-19 16:42:34 -0400 |
commit | 506d7617c080a08f4f783ab0a808d1109a42e8cb (patch) | |
tree | c6431c43474f5cee58eb85f144ada3057cef52b1 | |
parent | c66cd563c310039d456d3c1f9e6db8279d93b344 (diff) | |
download | angle_dx11-506d7617c080a08f4f783ab0a808d1109a42e8cb.tar.gz |
Eliminate isVariableBuiltIn.
TRAC #21840
Signed-off-by: Jamie Madill
Signed-off-by: Shannon Woods
Author: Nicolas Capens
-rw-r--r-- | src/compiler/ParseHelper.cpp | 21 | ||||
-rw-r--r-- | src/compiler/ParseHelper.h | 3 | ||||
-rw-r--r-- | src/compiler/glslang.y | 2 | ||||
-rw-r--r-- | src/compiler/glslang_tab.cpp | 4 |
4 files changed, 4 insertions, 26 deletions
diff --git a/src/compiler/ParseHelper.cpp b/src/compiler/ParseHelper.cpp index 48efbd4d..0fd62530 100644 --- a/src/compiler/ParseHelper.cpp +++ b/src/compiler/ParseHelper.cpp @@ -939,27 +939,6 @@ const TFunction* TParseContext::findFunction(const TSourceLoc& line, TFunction* return static_cast<const TFunction*>(symbol); } -bool TParseContext::isVariableBuiltIn(const TVariable* var) -{ - bool builtIn = false; - // First find by unmangled name to check whether the function name has been - // hidden by a variable name or struct typename. - const TSymbol* symbol = symbolTable.find(var->getName(), &builtIn); - if (symbol == 0) { - symbol = symbolTable.find(var->getMangledName(), &builtIn); - } - - if (symbol == 0) { - return false; - } - - if (!symbol->isVariable()) { - return false; - } - - return builtIn; -} - // // Initializers show up in several places in the grammar. Have one set of // code to handle them here. diff --git a/src/compiler/ParseHelper.h b/src/compiler/ParseHelper.h index dfffdca7..c2b3c3f7 100644 --- a/src/compiler/ParseHelper.h +++ b/src/compiler/ParseHelper.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2002-2012 The ANGLE Project Authors. All rights reserved. +// Copyright (c) 2002-2013 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. // @@ -106,7 +106,6 @@ struct TParseContext { bool containsSampler(TType& type); bool areAllChildConst(TIntermAggregate* aggrNode); const TFunction* findFunction(const TSourceLoc& line, TFunction* pfnCall, bool *builtIn = 0); - bool isVariableBuiltIn(const TVariable* pVar); bool executeInitializer(const TSourceLoc& line, TString& identifier, TPublicType& pType, TIntermTyped* initializer, TIntermNode*& intermNode, TVariable* variable = 0); diff --git a/src/compiler/glslang.y b/src/compiler/glslang.y index 5e965124..0e8c3c3b 100644 --- a/src/compiler/glslang.y +++ b/src/compiler/glslang.y @@ -200,7 +200,7 @@ variable_identifier variable = static_cast<const TVariable*>(symbol); - if (context->isVariableBuiltIn(variable) && + if (context->symbolTable.findBuiltIn(variable->getName()) && !variable->getExtension().empty() && context->extensionErrorCheck(@1, variable->getExtension())) { context->recover(); diff --git a/src/compiler/glslang_tab.cpp b/src/compiler/glslang_tab.cpp index bae97173..7afd4ca8 100644 --- a/src/compiler/glslang_tab.cpp +++ b/src/compiler/glslang_tab.cpp @@ -2265,7 +2265,7 @@ yyreduce: variable = static_cast<const TVariable*>(symbol); - if (context->isVariableBuiltIn(variable) && + if (context->symbolTable.findBuiltIn(variable->getName()) && !variable->getExtension().empty() && context->extensionErrorCheck((yylsp[(1) - (1)]), variable->getExtension())) { context->recover(); @@ -3226,7 +3226,7 @@ yyreduce: } else { - // Insert the unmangled name to detect potential future redefinition as a variable. + // Insert the unmangled name to detect potential future redefinition as a variable. context->symbolTable.getOuterLevel()->insert((yyvsp[(1) - (2)].interm.function)->getName(), *(yyvsp[(1) - (2)].interm.function)); } |