Refactor function call node creation
This makes function call node creation code simpler and more type
safe. It also prepares for further simplification by removing usage of
TFunction in places where the arguments node is sufficient.
BUG=angleproject:1490
TEST=angle_unittests
Change-Id: I75d9e059bb32c475487f0be24e40ac0d78012d86
Reviewed-on: https://chromium-review.googlesource.com/433217
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/ParseContext.h b/src/compiler/translator/ParseContext.h
index 55c5c4c..ced5802 100644
--- a/src/compiler/translator/ParseContext.h
+++ b/src/compiler/translator/ParseContext.h
@@ -112,8 +112,7 @@
void checkIsScalarInteger(TIntermTyped *node, const char *token);
bool checkIsAtGlobalLevel(const TSourceLoc &line, const char *token);
bool checkConstructorArguments(const TSourceLoc &line,
- TIntermNode *argumentsNode,
- const TFunction &function,
+ const TIntermAggregate *argumentsNode,
TOperator op,
const TType &type);
@@ -253,9 +252,9 @@
const TString *name,
const TSourceLoc &location);
TFunction *addConstructorFunc(const TPublicType &publicType);
- TIntermTyped *addConstructor(TIntermNode *arguments,
+ TIntermTyped *addConstructor(TIntermAggregate *arguments,
TOperator op,
- TFunction *fnCall,
+ TType type,
const TSourceLoc &line);
TIntermTyped *addIndexExpression(TIntermTyped *baseExpression,
@@ -346,11 +345,14 @@
void checkImageMemoryAccessForBuiltinFunctions(TIntermAggregate *functionCall);
void checkImageMemoryAccessForUserDefinedFunctions(const TFunction *functionDefinition,
const TIntermAggregate *functionCall);
+ TIntermAggregate *createEmptyArgumentsNode(const TSourceLoc &loc);
+
+ // fnCall is only storing the built-in op, and function name or constructor type. argumentsNode
+ // has the arguments.
TIntermTyped *addFunctionCallOrMethod(TFunction *fnCall,
- TIntermNode *paramNode,
+ TIntermAggregate *argumentsNode,
TIntermNode *thisNode,
- const TSourceLoc &loc,
- bool *fatalError);
+ const TSourceLoc &loc);
TIntermTyped *addTernarySelection(TIntermTyped *cond,
TIntermTyped *trueExpression,