Non-functional: Rationalizing parse helper hierarchy, step 3 (effected editable symbols and IO resize).

This commit is contained in:
John Kessenich 2016-10-01 18:44:38 -06:00
parent a2a5dd474e
commit de97fe0ad4
6 changed files with 51 additions and 237 deletions

View file

@ -381,7 +381,9 @@ TIntermTyped* TParseContext::handleVariable(const TSourceLoc& loc, TSymbol* symb
// If this is a variable or a block, check it and all it contains, but if this
// is a member of an anonymous block, check the whole block, as the whole block
// will need to be copied up if it contains an implicitly-sized array.
if (symbol->getType().containsImplicitlySizedArray() || (symbol->getAsAnonMember() && symbol->getAsAnonMember()->getAnonContainer().getType().containsImplicitlySizedArray()))
if (symbol->getType().containsImplicitlySizedArray() ||
(symbol->getAsAnonMember() &&
symbol->getAsAnonMember()->getAnonContainer().getType().containsImplicitlySizedArray()))
makeEditable(symbol);
}
@ -564,35 +566,11 @@ void TParseContext::handleIndexLimits(const TSourceLoc& /*loc*/, TIntermTyped* b
// effect all nodes sharing it.
void TParseContext::makeEditable(TSymbol*& symbol)
{
// copyUp() does a deep copy of the type.
symbol = symbolTable.copyUp(symbol);
TParseContextBase::makeEditable(symbol);
// Also, see if it's tied to IO resizing
// See if it's tied to IO resizing
if (isIoResizeArray(symbol->getType()))
ioArraySymbolResizeList.push_back(symbol);
// Also, save it in the AST for linker use.
intermediate.addSymbolLinkageNode(linkage, *symbol);
}
// Return a writable version of the variable 'name'.
//
// Return nullptr if 'name' is not found. This should mean
// something is seriously wrong (e.g., compiler asking self for
// built-in that doesn't exist).
TVariable* TParseContext::getEditableVariable(const char* name)
{
bool builtIn;
TSymbol* symbol = symbolTable.find(name, &builtIn);
assert(symbol != nullptr);
if (symbol == nullptr)
return nullptr;
if (builtIn)
makeEditable(symbol);
return symbol->getAsVariable();
}
// Return true if this is a geometry shader input array or tessellation control output array.