Commit aaaec130 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 d4a9b8dd
......@@ -1027,22 +1027,6 @@ const TFunction* TParseContext::findFunction(const TSourceLoc& line, TFunction*
return static_cast<const TFunction*>(symbol);
}
bool TParseContext::isVariableBuiltIn(const TVariable* var)
{
// 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.findBuiltIn(var->getName(), shaderVersion);
if (symbol == 0) {
symbol = symbolTable.findBuiltIn(var->getMangledName(), shaderVersion);
}
if (symbol == 0) {
return false;
}
return symbol->isVariable();
}
//
// Initializers show up in several places in the grammar. Have one set of
// code to handle them here.
......
......@@ -118,7 +118,6 @@ struct TParseContext {
bool containsSampler(TType& type);
bool areAllChildConst(TIntermAggregate* aggrNode);
const TFunction* findFunction(const TSourceLoc& line, TFunction* pfnCall, int shaderVersion, bool *builtIn = 0);
bool isVariableBuiltIn(const TVariable* var);
bool executeInitializer(const TSourceLoc& line, const TString& identifier, TPublicType& pType,
TIntermTyped* initializer, TIntermNode*& intermNode, TVariable* variable = 0);
......
......@@ -225,7 +225,7 @@ variable_identifier
}
variable = static_cast<const TVariable*>(symbol);
if (context->isVariableBuiltIn(variable) &&
if (context->symbolTable.findBuiltIn(variable->getName(), context->shaderVersion) &&
!variable->getExtension().empty() &&
context->extensionErrorCheck(@1, variable->getExtension())) {
context->recover();
......
......@@ -2542,7 +2542,7 @@ yyreduce:
}
variable = static_cast<const TVariable*>(symbol);
if (context->isVariableBuiltIn(variable) &&
if (context->symbolTable.findBuiltIn(variable->getName(), context->shaderVersion) &&
!variable->getExtension().empty() &&
context->extensionErrorCheck((yylsp[(1) - (1)]), variable->getExtension())) {
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