Replace setArray function in TPublicType with functions from TType
Having only one way of setting or clearing arrayness of types clarifies
code dealing with arrays.
TEST=angle_unittests
BUG=angleproject:941
Change-Id: I98cb7c44fd66440c9de8b4c6c4a02827e9300db7
Reviewed-on: https://chromium-review.googlesource.com/264361
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
diff --git a/src/compiler/translator/ParseContext.cpp b/src/compiler/translator/ParseContext.cpp
index f162e42..a181e7e 100644
--- a/src/compiler/translator/ParseContext.cpp
+++ b/src/compiler/translator/ParseContext.cpp
@@ -1238,7 +1238,7 @@
{
error(typeSpecifier.line, "not supported", "first-class array");
recover();
- returnType.setArray(false);
+ returnType.clearArrayness();
}
if (shaderVersion < 300)
@@ -1347,7 +1347,7 @@
}
else
{
- arrayType.setArray(true, size);
+ arrayType.setArraySize(size);
}
TIntermSymbol* symbol = intermediate.addSymbol(0, identifier, TType(arrayType), identifierLocation);
@@ -1468,7 +1468,7 @@
if (arraySizeErrorCheck(arrayLocation, indexExpression, size))
recover();
TPublicType arrayType(publicType);
- arrayType.setArray(true, size);
+ arrayType.setArraySize(size);
TVariable* variable = NULL;
if (arrayErrorCheck(arrayLocation, identifier, arrayType, variable))
recover();