Commit 58aa4e40 by Nicolas Capens Committed by Shannon Woods

Eliminate isVariableBuiltIn.

TRAC #21840 Signed-off-by: Jamie Madill Signed-off-by: Shannon Woods Author: Nicolas Capens
parent d4ceab12
...@@ -926,27 +926,6 @@ const TFunction* TParseContext::findFunction(const TSourceLoc& line, TFunction* ...@@ -926,27 +926,6 @@ const TFunction* TParseContext::findFunction(const TSourceLoc& line, TFunction*
return static_cast<const TFunction*>(symbol); 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 // Initializers show up in several places in the grammar. Have one set of
// code to handle them here. // code to handle them here.
......
// //
// 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 // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// //
...@@ -105,7 +105,6 @@ struct TParseContext { ...@@ -105,7 +105,6 @@ struct TParseContext {
bool containsSampler(TType& type); bool containsSampler(TType& type);
bool areAllChildConst(TIntermAggregate* aggrNode); bool areAllChildConst(TIntermAggregate* aggrNode);
const TFunction* findFunction(const TSourceLoc& line, TFunction* pfnCall, bool *builtIn = 0); 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, bool executeInitializer(const TSourceLoc& line, TString& identifier, TPublicType& pType,
TIntermTyped* initializer, TIntermNode*& intermNode, TVariable* variable = 0); TIntermTyped* initializer, TIntermNode*& intermNode, TVariable* variable = 0);
......
...@@ -200,7 +200,7 @@ variable_identifier ...@@ -200,7 +200,7 @@ variable_identifier
variable = static_cast<const TVariable*>(symbol); variable = static_cast<const TVariable*>(symbol);
if (context->isVariableBuiltIn(variable) && if (context->symbolTable.findBuiltIn(variable->getName()) &&
!variable->getExtension().empty() && !variable->getExtension().empty() &&
context->extensionErrorCheck(@1, variable->getExtension())) { context->extensionErrorCheck(@1, variable->getExtension())) {
context->recover(); context->recover();
......
...@@ -2265,7 +2265,7 @@ yyreduce: ...@@ -2265,7 +2265,7 @@ yyreduce:
variable = static_cast<const TVariable*>(symbol); variable = static_cast<const TVariable*>(symbol);
if (context->isVariableBuiltIn(variable) && if (context->symbolTable.findBuiltIn(variable->getName()) &&
!variable->getExtension().empty() && !variable->getExtension().empty() &&
context->extensionErrorCheck((yylsp[(1) - (1)]), variable->getExtension())) { context->extensionErrorCheck((yylsp[(1) - (1)]), variable->getExtension())) {
context->recover(); context->recover();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment