Refactor class to represent structure.

We had a TTypeLine to represent a structure field,
which simply encapsulated a TType and line number.
The line number was only used during parsing for error reporting.
There is no need to store a line number because it is already
available in the parser token.

TEST=WebGL conformance tests
R=kbr@chromium.org

Review URL: https://codereview.appspot.com/9223045


Additional edits required for dx11proto branch:

    src/compiler/OutputHLSL.cpp
    src/compiler/Types.h

Conflicts:

	src/compiler/glslang_tab.cpp
	src/compiler/glslang_tab.h

git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@2235 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/compiler/Intermediate.cpp b/src/compiler/Intermediate.cpp
index edf279e..11ca25e 100644
--- a/src/compiler/Intermediate.cpp
+++ b/src/compiler/Intermediate.cpp
@@ -1041,10 +1041,10 @@
     int index = 0;
 
     for (size_t j = 0; j < structSize; j++) {
-        int size = (*fields)[j].type->getObjectSize();
+        int size = (*fields)[j]->getObjectSize();
         for (int i = 0; i < size; i++) {
-            if ((*fields)[j].type->getBasicType() == EbtStruct) {
-                if (!CompareStructure(*(*fields)[j].type, &rightUnionArray[index], &leftUnionArray[index]))
+            if ((*fields)[j]->getBasicType() == EbtStruct) {
+                if (!CompareStructure(*(*fields)[j], &rightUnionArray[index], &leftUnionArray[index]))
                     return false;
             } else {
                 if (leftUnionArray[index] != rightUnionArray[index])
diff --git a/src/compiler/OutputGLSLBase.cpp b/src/compiler/OutputGLSLBase.cpp
index 1b9a10d..169e79f 100644
--- a/src/compiler/OutputGLSLBase.cpp
+++ b/src/compiler/OutputGLSLBase.cpp
@@ -87,7 +87,7 @@
         ASSERT(structure != NULL);
         for (size_t i = 0; i < structure->size(); ++i)
         {
-            const TType* fieldType = (*structure)[i].type;
+            const TType* fieldType = (*structure)[i];
             ASSERT(fieldType != NULL);
             if (writeVariablePrecision(fieldType->getPrecision()))
                 out << " ";
@@ -143,7 +143,7 @@
         ASSERT(structure != NULL);
         for (size_t i = 0; i < structure->size(); ++i)
         {
-            const TType* fieldType = (*structure)[i].type;
+            const TType* fieldType = (*structure)[i];
             ASSERT(fieldType != NULL);
             pConstUnion = writeConstantUnion(*fieldType, pConstUnion);
             if (i != structure->size() - 1) out << ", ";
diff --git a/src/compiler/OutputHLSL.cpp b/src/compiler/OutputHLSL.cpp
index 8e501db..cb686fe 100644
--- a/src/compiler/OutputHLSL.cpp
+++ b/src/compiler/OutputHLSL.cpp
@@ -1353,7 +1353,7 @@
 
             for (size_t i = 0; i < fields->size(); i++)
             {
-                const TType *fieldType = (*fields)[i].type;
+                const TType *fieldType = (*fields)[i];
 
                 node->getLeft()->traverse(this);
                 out << "." + decorateField(fieldType->getFieldName(), node->getLeft()->getType()) + " == ";
@@ -2583,7 +2583,7 @@
 
             for (unsigned int i = 0; i < fields.size(); i++)
             {
-                const TType &field = *fields[i].type;
+                const TType &field = *fields[i];
 
                 string += "    " + typeString(field) + " " + decorate(field.getFieldName()) + arrayString(field) + ";\n";
             }
@@ -2726,7 +2726,7 @@
 
         for (unsigned int i = 0; i < fields.size(); i++)
         {
-            const TType &field = *fields[i].type;
+            const TType &field = *fields[i];
 
             structure += "    " + typeString(field) + " " + decorateField(field.getFieldName(), type) + arrayString(field) + ";\n";
         }
@@ -2740,7 +2740,7 @@
 
         for (unsigned int i = 0; i < fields.size(); i++)
         {
-            ctorParameters.push_back(*fields[i].type);
+            ctorParameters.push_back(*fields[i]);
         }
     }
     else if (parameters)
@@ -2915,7 +2915,7 @@
 
         for (size_t i = 0; i < structure->size(); i++)
         {
-            const TType *fieldType = (*structure)[i].type;
+            const TType *fieldType = (*structure)[i];
 
             constUnion = writeConstantUnion(*fieldType, constUnion);
 
@@ -3090,7 +3090,7 @@
             {
                 for (size_t j = 0; j < structure->size(); j++)
                 {
-                    const TType &fieldType = *(*structure)[j].type;
+                    const TType &fieldType = *(*structure)[j];
                     const TString &fieldName = fieldType.getFieldName();
 
                     const TString uniformName = name + "[" + str(i) + "]." + fieldName;
@@ -3105,7 +3105,7 @@
 
             for (size_t i = 0; i < structure->size(); i++)
             {
-                const TType &fieldType = *(*structure)[i].type;
+                const TType &fieldType = *(*structure)[i];
                 const TString &fieldName = fieldType.getFieldName();
 
                 const TString uniformName = name + "." + fieldName;
diff --git a/src/compiler/ParseHelper.cpp b/src/compiler/ParseHelper.cpp
index 441ff35..e9f1b63 100644
--- a/src/compiler/ParseHelper.cpp
+++ b/src/compiler/ParseHelper.cpp
@@ -659,7 +659,7 @@
     if (type.getBasicType() == EbtStruct) {
         TTypeList& structure = *type.getStruct();
         for (unsigned int i = 0; i < structure.size(); ++i) {
-            if (containsSampler(*structure[i].type))
+            if (containsSampler(*structure[i]))
                 return true;
         }
     }
@@ -1139,7 +1139,7 @@
         if (type->isArray())
             newNode = constructStruct(node, &elementType, 1, node->getLine(), false);
         else if (op == EOpConstructStruct)
-            newNode = constructStruct(node, (*memberTypes).type, 1, node->getLine(), false);
+            newNode = constructStruct(node, *memberTypes, 1, node->getLine(), false);
         else
             newNode = constructBuiltIn(type, op, node, node->getLine(), false);
 
@@ -1170,7 +1170,7 @@
         if (type->isArray())
             newNode = constructStruct(*p, &elementType, paramCount+1, node->getLine(), true);
         else if (op == EOpConstructStruct)
-            newNode = constructStruct(*p, (memberTypes[paramCount]).type, paramCount+1, node->getLine(), true);
+            newNode = constructStruct(*p, memberTypes[paramCount], paramCount+1, node->getLine(), true);
         else
             newNode = constructBuiltIn(type, op, *p, node->getLine(), true);
         
@@ -1430,10 +1430,10 @@
     TIntermConstantUnion *tempConstantNode = node->getAsConstantUnion();
 
     for ( index = 0; index < fields->size(); ++index) {
-        if ((*fields)[index].type->getFieldName() == identifier) {
+        if ((*fields)[index]->getFieldName() == identifier) {
             break;
         } else {
-            instanceSize += (*fields)[index].type->getObjectSize();
+            instanceSize += (*fields)[index]->getObjectSize();
         }
     }
 
diff --git a/src/compiler/SymbolTable.cpp b/src/compiler/SymbolTable.cpp
index a63789d..cd625da 100644
--- a/src/compiler/SymbolTable.cpp
+++ b/src/compiler/SymbolTable.cpp
@@ -52,7 +52,7 @@
         {// support MSVC++6.0
             for (unsigned int i = 0; i < structure->size(); ++i) {
                 mangledName += '-';
-                (*structure)[i].type->buildMangledName(mangledName);
+                (*structure)[i]->buildMangledName(mangledName);
             }
         }
     default:
@@ -78,7 +78,7 @@
 
     if (structureSize == 0)
         for (TTypeList::const_iterator tl = getStruct()->begin(); tl != getStruct()->end(); tl++)
-            structureSize += ((*tl).type)->getObjectSize();
+            structureSize += (*tl)->getObjectSize();
 
     return structureSize;
 }
@@ -91,7 +91,7 @@
 
     int maxNesting = 0;
     for (TTypeList::const_iterator tl = getStruct()->begin(); tl != getStruct()->end(); ++tl) {
-        maxNesting = std::max(maxNesting, ((*tl).type)->getDeepestStructNesting());
+        maxNesting = std::max(maxNesting, (*tl)->getDeepestStructNesting());
     }
 
     deepestStructNesting = 1 + maxNesting;
@@ -106,8 +106,8 @@
 
     for (TTypeList::const_iterator member = structure->begin(); member != structure->end(); member++)
     {
-        if (member->type->isArray() ||
-            member->type->isStructureContainingArrays())
+        if ((*member)->isArray() ||
+            (*member)->isStructureContainingArrays())
         {
             return true;
         }
diff --git a/src/compiler/Types.h b/src/compiler/Types.h
index ee09c49..b6fd5e7 100644
--- a/src/compiler/Types.h
+++ b/src/compiler/Types.h
@@ -14,14 +14,7 @@
 class TType;
 struct TPublicType;
 
-//
-// Need to have association of line numbers to types in a list for building structs.
-//
-struct TTypeLine {
-    TType* type;
-    int line;
-};
-typedef TVector<TTypeLine> TTypeList;
+typedef TVector<TType*> TTypeList;
 
 inline TTypeList* NewPoolTTypeList()
 {
@@ -90,7 +83,7 @@
 
             for (size_t i = 0; i < structure->size(); i++)
             {
-                registerCount += (*structure)[i].type->totalRegisterCount();
+                registerCount += (*structure)[i]->totalRegisterCount();
             }
 
             return registerCount;
diff --git a/src/compiler/VariableInfo.cpp b/src/compiler/VariableInfo.cpp
index eb6bea9..5a1402e 100644
--- a/src/compiler/VariableInfo.cpp
+++ b/src/compiler/VariableInfo.cpp
@@ -133,7 +133,7 @@
 
     const TTypeList* structure = type.getStruct();
     for (size_t i = 0; i < structure->size(); ++i) {
-        const TType* fieldType = (*structure)[i].type;
+        const TType* fieldType = (*structure)[i];
         getVariableInfo(*fieldType,
                         name + "." + fieldType->getFieldName(),
                         mappedName + "." + TIntermTraverser::hash(fieldType->getFieldName(), hashFunction),
diff --git a/src/compiler/glslang.y b/src/compiler/glslang.y
index 6c6782e..eed9fa8 100644
--- a/src/compiler/glslang.y
+++ b/src/compiler/glslang.y
@@ -74,8 +74,8 @@
             TQualifier qualifier;
             TFunction* function;
             TParameter param;
-            TTypeLine typeLine;
-            TTypeList* typeList;
+            TType* field;
+            TTypeList* structure;
         };
     } interm;
 }
@@ -154,8 +154,8 @@
 %type <interm.type> type_qualifier fully_specified_type type_specifier
 %type <interm.type> type_specifier_no_prec type_specifier_nonarray
 %type <interm.type> struct_specifier
-%type <interm.typeLine> struct_declarator
-%type <interm.typeList> struct_declarator_list struct_declaration struct_declaration_list
+%type <interm.field> struct_declarator
+%type <interm> struct_declarator_list struct_declaration struct_declaration_list
 %type <interm.function> function_header function_declarator function_identifier
 %type <interm.function> function_header_with_parameters function_call_header
 %type <interm> function_call_header_with_parameters function_call_header_no_parameters function_call_generic function_prototype
@@ -384,7 +384,7 @@
             } else {
                 unsigned int i;
                 for (i = 0; i < fields->size(); ++i) {
-                    if ((*fields)[i].type->getFieldName() == *$3.string) {
+                    if ((*fields)[i]->getFieldName() == *$3.string) {
                         fieldFound = true;
                         break;
                     }
@@ -397,7 +397,7 @@
                             $$ = $1;
                         }
                         else {
-                            $$->setType(*(*fields)[i].type);
+                            $$->setType(*(*fields)[i]);
                             // change the qualifier of the return type, not of the structure field
                             // as the structure definition is shared between various structures.
                             $$->getTypePointer()->setQualifier(EvqConst);
@@ -405,9 +405,9 @@
                     } else {
                         ConstantUnion *unionArray = new ConstantUnion[1];
                         unionArray->setIConst(i);
-                        TIntermTyped* index = context->intermediate.addConstantUnion(unionArray, *(*fields)[i].type, $3.line);
+                        TIntermTyped* index = context->intermediate.addConstantUnion(unionArray, *(*fields)[i], $3.line);
                         $$ = context->intermediate.addIndex(EOpIndexDirectStruct, $1, index, $2.line);
-                        $$->setType(*(*fields)[i].type);
+                        $$->setType(*(*fields)[i]);
                     }
                 } else {
                     context->error($2.line, " no such field in structure", $3.string->c_str());
@@ -1698,7 +1698,7 @@
         if (context->reservedErrorCheck($2.line, *$2.string))
             context->recover();
 
-        TType* structure = new TType($5, *$2.string);
+        TType* structure = new TType($5.structure, *$2.string);
         TVariable* userTypeDef = new TVariable($2.string, *structure, true);
         if (! context->symbolTable.insert(*userTypeDef)) {
             context->error($2.line, "redefinition", $2.string->c_str(), "struct");
@@ -1709,7 +1709,7 @@
         context->exitStructDeclaration();
     }
     | STRUCT LEFT_BRACE { if (context->enterStructDeclaration($2.line, *$2.string)) context->recover(); } struct_declaration_list RIGHT_BRACE {
-        TType* structure = new TType($4, TString(""));
+        TType* structure = new TType($4.structure, TString(""));
         $$.setBasic(EbtStruct, EvqTemporary, $1.line);
         $$.userDef = structure;
         context->exitStructDeclaration();
@@ -1722,14 +1722,15 @@
     }
     | struct_declaration_list struct_declaration {
         $$ = $1;
-        for (unsigned int i = 0; i < $2->size(); ++i) {
-            for (unsigned int j = 0; j < $$->size(); ++j) {
-                if ((*$$)[j].type->getFieldName() == (*$2)[i].type->getFieldName()) {
-                    context->error((*$2)[i].line, "duplicate field name in structure:", "struct", (*$2)[i].type->getFieldName().c_str());
+        for (size_t i = 0; i < $2.structure->size(); ++i) {
+            TType* field = (*$2.structure)[i];
+            for (size_t j = 0; j < $$.structure->size(); ++j) {
+                if ((*$$.structure)[j]->getFieldName() == field->getFieldName()) {
+                    context->error($2.line, "duplicate field name in structure:", "struct", field->getFieldName().c_str());
                     context->recover();
                 }
             }
-            $$->push_back((*$2)[i]);
+            $$.structure->push_back(field);
         }
     }
     ;
@@ -1738,14 +1739,14 @@
     : type_specifier struct_declarator_list SEMICOLON {
         $$ = $2;
 
-        if (context->voidErrorCheck($1.line, (*$2)[0].type->getFieldName(), $1)) {
+        if (context->voidErrorCheck($1.line, (*$2.structure)[0]->getFieldName(), $1)) {
             context->recover();
         }
-        for (unsigned int i = 0; i < $$->size(); ++i) {
+        for (unsigned int i = 0; i < $$.structure->size(); ++i) {
             //
             // Careful not to replace already known aspects of type, like array-ness
             //
-            TType* type = (*$$)[i].type;
+            TType* type = (*$$.structure)[i];
             type->setBasicType($1.type);
             type->setNominalSize($1.size);
             type->setMatrix($1.matrix);
@@ -1772,11 +1773,11 @@
 
 struct_declarator_list
     : struct_declarator {
-        $$ = NewPoolTTypeList();
-        $$->push_back($1);
+        $$.structure = NewPoolTTypeList();
+        $$.structure->push_back($1);
     }
     | struct_declarator_list COMMA struct_declarator {
-        $$->push_back($3);
+        $$.structure->push_back($3);
     }
     ;
 
@@ -1785,22 +1786,20 @@
         if (context->reservedErrorCheck($1.line, *$1.string))
             context->recover();
 
-        $$.type = new TType(EbtVoid, EbpUndefined);
-        $$.line = $1.line;
-        $$.type->setFieldName(*$1.string);
+        $$ = new TType(EbtVoid, EbpUndefined);
+        $$->setFieldName(*$1.string);
     }
     | identifier LEFT_BRACKET constant_expression RIGHT_BRACKET {
         if (context->reservedErrorCheck($1.line, *$1.string))
             context->recover();
 
-        $$.type = new TType(EbtVoid, EbpUndefined);
-        $$.line = $1.line;
-        $$.type->setFieldName(*$1.string);
+        $$ = new TType(EbtVoid, EbpUndefined);
+        $$->setFieldName(*$1.string);
 
         int size;
         if (context->arraySizeErrorCheck($2.line, $3, size))
             context->recover();
-        $$.type->setArraySize(size);
+        $$->setArraySize(size);
     }
     ;
 
diff --git a/src/compiler/glslang_tab.cpp b/src/compiler/glslang_tab.cpp
index a29aadf..74502fb 100644
--- a/src/compiler/glslang_tab.cpp
+++ b/src/compiler/glslang_tab.cpp
@@ -255,8 +255,8 @@
             TQualifier qualifier;
             TFunction* function;
             TParameter param;
-            TTypeLine typeLine;
-            TTypeList* typeList;
+            TType* field;
+            TTypeList* structure;
         };
     } interm;
 
@@ -699,13 +699,13 @@
     1520,  1530,  1537,  1540,  1543,  1549,  1552,  1567,  1571,  1575,
     1579,  1588,  1593,  1598,  1603,  1608,  1613,  1618,  1623,  1628,
     1633,  1639,  1645,  1651,  1656,  1661,  1670,  1679,  1684,  1697,
-    1697,  1711,  1711,  1720,  1723,  1738,  1774,  1778,  1784,  1792,
-    1808,  1812,  1816,  1817,  1823,  1824,  1825,  1826,  1827,  1831,
-    1832,  1832,  1832,  1842,  1843,  1847,  1847,  1848,  1848,  1853,
-    1856,  1866,  1869,  1875,  1876,  1880,  1888,  1892,  1902,  1907,
-    1924,  1924,  1929,  1929,  1936,  1936,  1944,  1947,  1953,  1956,
-    1962,  1966,  1973,  1980,  1987,  1994,  2005,  2014,  2018,  2025,
-    2028,  2034,  2034
+    1697,  1711,  1711,  1720,  1723,  1739,  1775,  1779,  1785,  1792,
+    1807,  1811,  1815,  1816,  1822,  1823,  1824,  1825,  1826,  1830,
+    1831,  1831,  1831,  1841,  1842,  1846,  1846,  1847,  1847,  1852,
+    1855,  1865,  1868,  1874,  1875,  1879,  1887,  1891,  1901,  1906,
+    1923,  1923,  1928,  1928,  1935,  1935,  1943,  1946,  1952,  1955,
+    1961,  1965,  1972,  1979,  1986,  1993,  2004,  2013,  2017,  2024,
+    2027,  2033,  2033
 };
 #endif
 
@@ -2354,7 +2354,7 @@
             } else {
                 unsigned int i;
                 for (i = 0; i < fields->size(); ++i) {
-                    if ((*fields)[i].type->getFieldName() == *(yyvsp[(3) - (3)].lex).string) {
+                    if ((*fields)[i]->getFieldName() == *(yyvsp[(3) - (3)].lex).string) {
                         fieldFound = true;
                         break;
                     }
@@ -2367,7 +2367,7 @@
                             (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
                         }
                         else {
-                            (yyval.interm.intermTypedNode)->setType(*(*fields)[i].type);
+                            (yyval.interm.intermTypedNode)->setType(*(*fields)[i]);
                             // change the qualifier of the return type, not of the structure field
                             // as the structure definition is shared between various structures.
                             (yyval.interm.intermTypedNode)->getTypePointer()->setQualifier(EvqConst);
@@ -2375,9 +2375,9 @@
                     } else {
                         ConstantUnion *unionArray = new ConstantUnion[1];
                         unionArray->setIConst(i);
-                        TIntermTyped* index = context->intermediate.addConstantUnion(unionArray, *(*fields)[i].type, (yyvsp[(3) - (3)].lex).line);
+                        TIntermTyped* index = context->intermediate.addConstantUnion(unionArray, *(*fields)[i], (yyvsp[(3) - (3)].lex).line);
                         (yyval.interm.intermTypedNode) = context->intermediate.addIndex(EOpIndexDirectStruct, (yyvsp[(1) - (3)].interm.intermTypedNode), index, (yyvsp[(2) - (3)].lex).line);
-                        (yyval.interm.intermTypedNode)->setType(*(*fields)[i].type);
+                        (yyval.interm.intermTypedNode)->setType(*(*fields)[i]);
                     }
                 } else {
                     context->error((yyvsp[(2) - (3)].lex).line, " no such field in structure", (yyvsp[(3) - (3)].lex).string->c_str());
@@ -3955,7 +3955,7 @@
         if (context->reservedErrorCheck((yyvsp[(2) - (6)].lex).line, *(yyvsp[(2) - (6)].lex).string))
             context->recover();
 
-        TType* structure = new TType((yyvsp[(5) - (6)].interm.typeList), *(yyvsp[(2) - (6)].lex).string);
+        TType* structure = new TType((yyvsp[(5) - (6)].interm).structure, *(yyvsp[(2) - (6)].lex).string);
         TVariable* userTypeDef = new TVariable((yyvsp[(2) - (6)].lex).string, *structure, true);
         if (! context->symbolTable.insert(*userTypeDef)) {
             context->error((yyvsp[(2) - (6)].lex).line, "redefinition", (yyvsp[(2) - (6)].lex).string->c_str(), "struct");
@@ -3975,7 +3975,7 @@
   case 142:
 
     {
-        TType* structure = new TType((yyvsp[(4) - (5)].interm.typeList), TString(""));
+        TType* structure = new TType((yyvsp[(4) - (5)].interm).structure, TString(""));
         (yyval.interm.type).setBasic(EbtStruct, EvqTemporary, (yyvsp[(1) - (5)].lex).line);
         (yyval.interm.type).userDef = structure;
         context->exitStructDeclaration();
@@ -3985,22 +3985,23 @@
   case 143:
 
     {
-        (yyval.interm.typeList) = (yyvsp[(1) - (1)].interm.typeList);
+        (yyval.interm) = (yyvsp[(1) - (1)].interm);
     }
     break;
 
   case 144:
 
     {
-        (yyval.interm.typeList) = (yyvsp[(1) - (2)].interm.typeList);
-        for (unsigned int i = 0; i < (yyvsp[(2) - (2)].interm.typeList)->size(); ++i) {
-            for (unsigned int j = 0; j < (yyval.interm.typeList)->size(); ++j) {
-                if ((*(yyval.interm.typeList))[j].type->getFieldName() == (*(yyvsp[(2) - (2)].interm.typeList))[i].type->getFieldName()) {
-                    context->error((*(yyvsp[(2) - (2)].interm.typeList))[i].line, "duplicate field name in structure:", "struct", (*(yyvsp[(2) - (2)].interm.typeList))[i].type->getFieldName().c_str());
+        (yyval.interm) = (yyvsp[(1) - (2)].interm);
+        for (size_t i = 0; i < (yyvsp[(2) - (2)].interm).structure->size(); ++i) {
+            TType* field = (*(yyvsp[(2) - (2)].interm).structure)[i];
+            for (size_t j = 0; j < (yyval.interm).structure->size(); ++j) {
+                if ((*(yyval.interm).structure)[j]->getFieldName() == field->getFieldName()) {
+                    context->error((yyvsp[(2) - (2)].interm).line, "duplicate field name in structure:", "struct", field->getFieldName().c_str());
                     context->recover();
                 }
             }
-            (yyval.interm.typeList)->push_back((*(yyvsp[(2) - (2)].interm.typeList))[i]);
+            (yyval.interm).structure->push_back(field);
         }
     }
     break;
@@ -4008,16 +4009,16 @@
   case 145:
 
     {
-        (yyval.interm.typeList) = (yyvsp[(2) - (3)].interm.typeList);
+        (yyval.interm) = (yyvsp[(2) - (3)].interm);
 
-        if (context->voidErrorCheck((yyvsp[(1) - (3)].interm.type).line, (*(yyvsp[(2) - (3)].interm.typeList))[0].type->getFieldName(), (yyvsp[(1) - (3)].interm.type))) {
+        if (context->voidErrorCheck((yyvsp[(1) - (3)].interm.type).line, (*(yyvsp[(2) - (3)].interm).structure)[0]->getFieldName(), (yyvsp[(1) - (3)].interm.type))) {
             context->recover();
         }
-        for (unsigned int i = 0; i < (yyval.interm.typeList)->size(); ++i) {
+        for (unsigned int i = 0; i < (yyval.interm).structure->size(); ++i) {
             //
             // Careful not to replace already known aspects of type, like array-ness
             //
-            TType* type = (*(yyval.interm.typeList))[i].type;
+            TType* type = (*(yyval.interm).structure)[i];
             type->setBasicType((yyvsp[(1) - (3)].interm.type).type);
             type->setNominalSize((yyvsp[(1) - (3)].interm.type).size);
             type->setMatrix((yyvsp[(1) - (3)].interm.type).matrix);
@@ -4045,15 +4046,15 @@
   case 146:
 
     {
-        (yyval.interm.typeList) = NewPoolTTypeList();
-        (yyval.interm.typeList)->push_back((yyvsp[(1) - (1)].interm.typeLine));
+        (yyval.interm).structure = NewPoolTTypeList();
+        (yyval.interm).structure->push_back((yyvsp[(1) - (1)].interm.field));
     }
     break;
 
   case 147:
 
     {
-        (yyval.interm.typeList)->push_back((yyvsp[(3) - (3)].interm.typeLine));
+        (yyval.interm).structure->push_back((yyvsp[(3) - (3)].interm.field));
     }
     break;
 
@@ -4063,9 +4064,8 @@
         if (context->reservedErrorCheck((yyvsp[(1) - (1)].lex).line, *(yyvsp[(1) - (1)].lex).string))
             context->recover();
 
-        (yyval.interm.typeLine).type = new TType(EbtVoid, EbpUndefined);
-        (yyval.interm.typeLine).line = (yyvsp[(1) - (1)].lex).line;
-        (yyval.interm.typeLine).type->setFieldName(*(yyvsp[(1) - (1)].lex).string);
+        (yyval.interm.field) = new TType(EbtVoid, EbpUndefined);
+        (yyval.interm.field)->setFieldName(*(yyvsp[(1) - (1)].lex).string);
     }
     break;
 
@@ -4075,14 +4075,13 @@
         if (context->reservedErrorCheck((yyvsp[(1) - (4)].lex).line, *(yyvsp[(1) - (4)].lex).string))
             context->recover();
 
-        (yyval.interm.typeLine).type = new TType(EbtVoid, EbpUndefined);
-        (yyval.interm.typeLine).line = (yyvsp[(1) - (4)].lex).line;
-        (yyval.interm.typeLine).type->setFieldName(*(yyvsp[(1) - (4)].lex).string);
+        (yyval.interm.field) = new TType(EbtVoid, EbpUndefined);
+        (yyval.interm.field)->setFieldName(*(yyvsp[(1) - (4)].lex).string);
 
         int size;
         if (context->arraySizeErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(3) - (4)].interm.intermTypedNode), size))
             context->recover();
-        (yyval.interm.typeLine).type->setArraySize(size);
+        (yyval.interm.field)->setArraySize(size);
     }
     break;
 
diff --git a/src/compiler/glslang_tab.h b/src/compiler/glslang_tab.h
index cc32471..681b50a 100644
--- a/src/compiler/glslang_tab.h
+++ b/src/compiler/glslang_tab.h
@@ -172,8 +172,8 @@
             TQualifier qualifier;
             TFunction* function;
             TParameter param;
-            TTypeLine typeLine;
-            TTypeList* typeList;
+            TType* field;
+            TTypeList* structure;
         };
     } interm;