Split TIntermFunctionPrototype from TIntermAggregate
Function prototypes now have their own class TIntermFunctionPrototype.
It's only used for prototypes, not function parameter lists.
TIntermAggregate is still used for parameter lists and function calls.
BUGS=angleproject:1490
TEST=angle_unittests
Change-Id: I6e246ad00a29c2335bd2ab7f61cf73fe463b74bb
Reviewed-on: https://chromium-review.googlesource.com/427944
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
diff --git a/src/compiler/translator/CallDAG.cpp b/src/compiler/translator/CallDAG.cpp
index 45273a0..e09f8c9 100644
--- a/src/compiler/translator/CallDAG.cpp
+++ b/src/compiler/translator/CallDAG.cpp
@@ -122,19 +122,22 @@
return true;
}
+ bool visitFunctionPrototype(Visit visit, TIntermFunctionPrototype *node) override
+ {
+ ASSERT(visit == PreVisit);
+ // Function declaration, create an empty record.
+ auto &record = mFunctions[node->getFunctionSymbolInfo()->getName()];
+ record.name = node->getFunctionSymbolInfo()->getName();
+
+ // No need to traverse the parameters.
+ return false;
+ }
+
// Aggregates the AST node for each function as well as the name of the functions called by it
bool visitAggregate(Visit visit, TIntermAggregate *node) override
{
switch (node->getOp())
{
- case EOpPrototype:
- if (visit == PreVisit)
- {
- // Function declaration, create an empty record.
- auto &record = mFunctions[node->getFunctionSymbolInfo()->getName()];
- record.name = node->getFunctionSymbolInfo()->getName();
- }
- break;
case EOpFunctionCall:
{
// Function call, add the callees