Refactor type_specifier_nonarray parsing to reduce code repetition
When type_specifier_nonarray gets parsed the scope gets saved into
TType and the code becomes repetitive. Setting of the scope is moved
to type_specifier_no_prec as it occurs less times.
BUG=angleproject:911
TEST=angle_unittests
TEST=angle_end2end_tests
Change-Id: I6da5fe7bc2d60ba2996221af71b719b818f5e9b1
Reviewed-on: https://chromium-review.googlesource.com/380535
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
diff --git a/src/compiler/translator/ParseContext.h b/src/compiler/translator/ParseContext.h
index aadc881..aa8619c 100644
--- a/src/compiler/translator/ParseContext.h
+++ b/src/compiler/translator/ParseContext.h
@@ -160,7 +160,9 @@
bool checkIsNonVoid(const TSourceLoc &line, const TString &identifier, const TBasicType &type);
void checkIsScalarBool(const TSourceLoc &line, const TIntermTyped *type);
void checkIsScalarBool(const TSourceLoc &line, const TPublicType &pType);
- bool checkIsNotSampler(const TSourceLoc &line, const TPublicType &pType, const char *reason);
+ bool checkIsNotSampler(const TSourceLoc &line,
+ const TTypeSpecifierNonArray &pType,
+ const char *reason);
void checkDeclaratorLocationIsNotSpecified(const TSourceLoc &line, const TPublicType &pType);
void checkLocationIsNotSpecified(const TSourceLoc &location,
const TLayoutQualifier &layoutQualifier);
@@ -298,10 +300,10 @@
TPublicType *typeSpecifier,
TFieldList *fieldList);
TFieldList *addStructDeclaratorList(const TPublicType &typeSpecifier, TFieldList *fieldList);
- TPublicType addStructure(const TSourceLoc &structLine,
- const TSourceLoc &nameLine,
- const TString *structName,
- TFieldList *fieldList);
+ TTypeSpecifierNonArray addStructure(const TSourceLoc &structLine,
+ const TSourceLoc &nameLine,
+ const TString *structName,
+ TFieldList *fieldList);
TIntermAggregate *addInterfaceBlock(const TTypeQualifierBuilder &typeQualifierBuilder,
const TSourceLoc &nameLine,