Always store function headers in TIntermFunctionPrototype nodes

TIntermFunctionDefinition nodes now have a TIntermFunctionPrototype
child that stores the function signature, instead of having a separate
type and an aggregate child that stores the parameters.

This makes parsing functions simpler, and paves the way for further
simplifications of function parsing, like reducing conversions between
symbol table structures and AST structures.

TIntermAggregate is now only used for function calls.

BUG=angleproject:1490
TEST=angle_unittests, angle_end2end_tests

Change-Id: Ib56a77b5ef5123b142963a18499690bf37fed987
Reviewed-on: https://chromium-review.googlesource.com/427945
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
diff --git a/src/compiler/translator/VersionGLSL.cpp b/src/compiler/translator/VersionGLSL.cpp
index ad70479..938325b 100644
--- a/src/compiler/translator/VersionGLSL.cpp
+++ b/src/compiler/translator/VersionGLSL.cpp
@@ -98,33 +98,30 @@
     return true;
 }
 
+bool TVersionGLSL::visitFunctionPrototype(Visit, TIntermFunctionPrototype *node)
+{
+    const TIntermSequence &params = *(node->getSequence());
+    for (TIntermSequence::const_iterator iter = params.begin(); iter != params.end(); ++iter)
+    {
+        const TIntermTyped *param = (*iter)->getAsTyped();
+        if (param->isArray())
+        {
+            TQualifier qualifier = param->getQualifier();
+            if ((qualifier == EvqOut) || (qualifier == EvqInOut))
+            {
+                ensureVersionIsAtLeast(GLSL_VERSION_120);
+                break;
+            }
+        }
+    }
+    // Fully processed. No need to visit children.
+    return false;
+}
+
 bool TVersionGLSL::visitAggregate(Visit, TIntermAggregate *node)
 {
-    bool visitChildren = true;
-
     switch (node->getOp())
     {
-        case EOpParameters:
-        {
-            const TIntermSequence &params = *(node->getSequence());
-            for (TIntermSequence::const_iterator iter = params.begin(); iter != params.end();
-                 ++iter)
-            {
-                const TIntermTyped *param = (*iter)->getAsTyped();
-                if (param->isArray())
-                {
-                    TQualifier qualifier = param->getQualifier();
-                    if ((qualifier == EvqOut) || (qualifier == EvqInOut))
-                    {
-                        ensureVersionIsAtLeast(GLSL_VERSION_120);
-                        break;
-                    }
-                }
-            }
-            // Fully processed. No need to visit children.
-            visitChildren = false;
-            break;
-        }
         case EOpConstructMat2:
         case EOpConstructMat2x3:
         case EOpConstructMat2x4:
@@ -149,8 +146,7 @@
         default:
             break;
     }
-
-    return visitChildren;
+    return true;
 }
 
 void TVersionGLSL::ensureVersionIsAtLeast(int version)