Simplify and rationalize constant folding for dereferences (array, matrix, vector, swizzle, struct).

git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24259 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
John Kessenich 2013-12-01 23:37:08 +00:00
parent 1fbaa35ce7
commit 3591813a8b
8 changed files with 95 additions and 180 deletions

View file

@ -120,7 +120,7 @@ void TType::buildMangledName(TString& mangledName)
int TType::getStructSize() const
{
if (!getStruct()) {
if (! isStruct()) {
assert(false && "Not a struct");
return 0;
}
@ -255,7 +255,7 @@ TVariable::TVariable(const TVariable& copyOf) : TSymbol(copyOf)
setExtensions(copyOf.numExtensions, copyOf.extensions);
if (! copyOf.unionArray.empty()) {
assert(!copyOf.type.getStruct());
assert(! copyOf.type.isStruct());
assert(copyOf.type.getObjectSize() == 1);
TConstUnionArray newArray(1);
newArray[0] = copyOf.unionArray[0];