Don't use TIntermSymbol nodes for function parameters

Parameter nodes are not needed - it's simpler to just create a
TVariable object for each parameter when the TFunction is initialized.

With this change we also store only one object per each parameter type
used in built-in functions, instead of one array of TConstParameter
entries for each unique parameter sequence.

This simplifies code and reduces binary size and compiler memory use.
Compiler perf does not seem to be significantly affected.

BUG=angleproject:2267
TEST=angle_unittests

Change-Id: I2b82400dd594731074309f92a705e75135a4c82c
Reviewed-on: https://chromium-review.googlesource.com/955589
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/compiler/translator/RemoveUnreferencedVariables.cpp b/src/compiler/translator/RemoveUnreferencedVariables.cpp
index 6445eb8..b76648f 100644
--- a/src/compiler/translator/RemoveUnreferencedVariables.cpp
+++ b/src/compiler/translator/RemoveUnreferencedVariables.cpp
@@ -30,7 +30,7 @@
 
     void visitSymbol(TIntermSymbol *node) override;
     bool visitAggregate(Visit visit, TIntermAggregate *node) override;
-    bool visitFunctionPrototype(Visit visit, TIntermFunctionPrototype *node) override;
+    void visitFunctionPrototype(TIntermFunctionPrototype *node) override;
 
   private:
     void incrementStructTypeRefCount(const TType &type);
@@ -108,11 +108,14 @@
     return true;
 }
 
-bool CollectVariableRefCountsTraverser::visitFunctionPrototype(Visit visit,
-                                                               TIntermFunctionPrototype *node)
+void CollectVariableRefCountsTraverser::visitFunctionPrototype(TIntermFunctionPrototype *node)
 {
     incrementStructTypeRefCount(node->getType());
-    return true;
+    size_t paramCount = node->getFunction()->getParamCount();
+    for (size_t i = 0; i < paramCount; ++i)
+    {
+        incrementStructTypeRefCount(node->getFunction()->getParam(i)->getType());
+    }
 }
 
 // Traverser that removes all unreferenced variables on one traversal.