Simplify parsing struct field declarators
This removes the dummy type that was attached to struct declarators
while parsing. This makes TParseContext::addStructDeclaratorList in
particular simpler to understand.
The new TDeclarator data type is the parsed representation of the
struct_declarator grammar rule. It is completely immutable. The name
and location stored in TField can also be qualified as constant now.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: I2834f87fc0eee0bdb7673ef495a55fb463023c55
Reviewed-on: https://chromium-review.googlesource.com/797033
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/compiler/translator/Initialize.cpp b/src/compiler/translator/Initialize.cpp
index 6f8baee..d637ed0 100644
--- a/src/compiler/translator/Initialize.cpp
+++ b/src/compiler/translator/Initialize.cpp
@@ -741,7 +741,7 @@
//
// Depth range in window coordinates
//
- TFieldList *fields = NewPoolTFieldList();
+ TFieldList *fields = new TFieldList();
TSourceLoc zeroSourceLoc = {0, 0, 0, 0};
auto highpFloat1 = new TType(EbtFloat, EbpHigh, EvqGlobal, 1);
TField *near = new TField(highpFloat1, NewPoolTString("near"), zeroSourceLoc);
@@ -1014,7 +1014,7 @@
const TString *glPerVertexString = NewPoolTString("gl_PerVertex");
symbolTable.insertInterfaceBlockNameExt(ESSL3_1_BUILTINS, extension, glPerVertexString);
- TFieldList *fieldList = NewPoolTFieldList();
+ TFieldList *fieldList = new TFieldList();
TSourceLoc zeroSourceLoc = {0, 0, 0, 0};
TField *glPositionField = new TField(new TType(EbtFloat, EbpHigh, EvqPosition, 4),
NewPoolTString("gl_Position"), zeroSourceLoc);