Add a constexpr constructor for TFunction
Access to TFunction parameters is now handled through two new members:
a pointer to a parameter array and a parameter count.
There's still also a vector pointer in TFunction for adding function
parameters one by one. This is used when parsing user-defined
functions.
TEST=angle_unittests
BUG=angleproject:2267
Change-Id: I86987ae56b7cf37f010d0651e9861789050aec2b
Reviewed-on: https://chromium-review.googlesource.com/923987
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 1704d41..0e14054 100644
--- a/src/compiler/translator/DeferGlobalInitializers.cpp
+++ b/src/compiler/translator/DeferGlobalInitializers.cpp
@@ -22,6 +22,7 @@
#include "compiler/translator/IntermNode.h"
#include "compiler/translator/IntermNode_util.h"
#include "compiler/translator/ReplaceVariable.h"
+#include "compiler/translator/StaticType.h"
#include "compiler/translator/SymbolTable.h"
namespace sh
@@ -104,8 +105,9 @@
TIntermBlock *initGlobalsBlock = new TIntermBlock();
initGlobalsBlock->getSequence()->swap(*deferredInitializers);
- TFunction *initGlobalsFunction = new TFunction(
- symbolTable, kInitGlobalsString, new TType(EbtVoid), SymbolType::AngleInternal, false);
+ TFunction *initGlobalsFunction =
+ new TFunction(symbolTable, kInitGlobalsString, SymbolType::AngleInternal,
+ StaticType::GetBasic<EbtVoid>(), false);
TIntermFunctionPrototype *initGlobalsFunctionPrototype =
CreateInternalFunctionPrototypeNode(*initGlobalsFunction);