Make aggregate node creation more robust
Now aggregate nodes are always built with their return type, op and
arguments set. They'll determine their qualifier and precision
automatically.
This fixes setting of gotPrecisionFromChildren in a few cases.
This will also make it easier to split TIntermAggregate further into
specialized classes if that is desired.
BUG=angleproject:1490
TEST=angle_unittests
Change-Id: I1fbe0c75679c517a22d44dfc1ea160ad7a7fdfda
Reviewed-on: https://chromium-review.googlesource.com/433468
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
diff --git a/src/compiler/translator/DeferGlobalInitializers.cpp b/src/compiler/translator/DeferGlobalInitializers.cpp
index 3e2224b..7353506 100644
--- a/src/compiler/translator/DeferGlobalInitializers.cpp
+++ b/src/compiler/translator/DeferGlobalInitializers.cpp
@@ -50,10 +50,10 @@
TIntermAggregate *CreateFunctionCallNode(const char *name, const int functionId)
{
- TIntermAggregate *functionNode = new TIntermAggregate(EOpCallFunctionInAST);
- SetInternalFunctionName(functionNode->getFunctionSymbolInfo(), name);
TType returnType(EbtVoid);
- functionNode->setType(returnType);
+ TIntermAggregate *functionNode =
+ new TIntermAggregate(returnType, EOpCallFunctionInAST, nullptr);
+ SetInternalFunctionName(functionNode->getFunctionSymbolInfo(), name);
functionNode->getFunctionSymbolInfo()->setId(functionId);
return functionNode;
}