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/IntermNode.cpp b/src/compiler/translator/IntermNode.cpp
index a1602b4..77c6000 100644
--- a/src/compiler/translator/IntermNode.cpp
+++ b/src/compiler/translator/IntermNode.cpp
@@ -211,7 +211,7 @@
bool TIntermFunctionDefinition::replaceChildNode(TIntermNode *original, TIntermNode *replacement)
{
- REPLACE_IF_IS(mParameters, TIntermAggregate, original, replacement);
+ REPLACE_IF_IS(mPrototype, TIntermFunctionPrototype, original, replacement);
REPLACE_IF_IS(mBody, TIntermBlock, original, replacement);
return false;
}