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/OutputGLSLBase.cpp b/src/compiler/translator/OutputGLSLBase.cpp
index 785eaed..d71c857 100644
--- a/src/compiler/translator/OutputGLSLBase.cpp
+++ b/src/compiler/translator/OutputGLSLBase.cpp
@@ -835,26 +835,9 @@
 
 bool TOutputGLSLBase::visitFunctionDefinition(Visit visit, TIntermFunctionDefinition *node)
 {
-    TInfoSinkBase &out = objSink();
-
-    ASSERT(visit == PreVisit);
-    {
-        const TType &type = node->getType();
-        writeVariableType(type);
-        if (type.isArray())
-            out << arrayBrackets(type);
-    }
-
-    out << " " << hashFunctionNameIfNeeded(node->getFunctionSymbolInfo()->getNameObj());
-
     incrementDepth(node);
-
-    // Traverse function parameters.
-    TIntermAggregate *params = node->getFunctionParameters()->getAsAggregate();
-    ASSERT(params->getOp() == EOpParameters);
-    params->traverse(this);
-
-    // Traverse function body.
+    TIntermFunctionPrototype *prototype = node->getFunctionPrototype();
+    prototype->traverse(this);
     visitCodeBlock(node->getBody());
     decrementDepth();
 
@@ -905,14 +888,6 @@
             else
                 out << ")";
             break;
-        case EOpParameters:
-            // Function parameters.
-            ASSERT(visit == PreVisit);
-            out << "(";
-            writeFunctionParameters(*(node->getSequence()));
-            out << ")";
-            visitChildren = false;
-            break;
         case EOpConstructFloat:
         case EOpConstructVec2:
         case EOpConstructVec3: