Commit 7b7d2e6a by Olli Etuaho Committed by Commit Bot

Remove createAssign: only called once

This will make it easier to add tracking of static reads. BUG=angleproject:2262 TEST=angle_unittests Change-Id: I23e0587c022c45ac62434a2a0d8170e8978d1c24 Reviewed-on: https://chromium-review.googlesource.com/983916Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
parent 78c5eb2a
...@@ -5327,41 +5327,34 @@ TIntermTyped *TParseContext::addBinaryMathBooleanResult(TOperator op, ...@@ -5327,41 +5327,34 @@ TIntermTyped *TParseContext::addBinaryMathBooleanResult(TOperator op,
return node; return node;
} }
TIntermBinary *TParseContext::createAssign(TOperator op, TIntermTyped *TParseContext::addAssign(TOperator op,
TIntermTyped *left, TIntermTyped *left,
TIntermTyped *right, TIntermTyped *right,
const TSourceLoc &loc) const TSourceLoc &loc)
{ {
checkCanBeLValue(loc, "assign", left);
TIntermBinary *node = nullptr;
if (binaryOpCommonCheck(op, left, right, loc)) if (binaryOpCommonCheck(op, left, right, loc))
{ {
if (op == EOpMulAssign) if (op == EOpMulAssign)
{ {
op = TIntermBinary::GetMulAssignOpBasedOnOperands(left->getType(), right->getType()); op = TIntermBinary::GetMulAssignOpBasedOnOperands(left->getType(), right->getType());
if (!isMultiplicationTypeCombinationValid(op, left->getType(), right->getType())) if (isMultiplicationTypeCombinationValid(op, left->getType(), right->getType()))
{ {
return nullptr; node = new TIntermBinary(op, left, right);
} }
} }
TIntermBinary *node = new TIntermBinary(op, left, right); else
node->setLine(loc); {
node = new TIntermBinary(op, left, right);
return node; }
} }
return nullptr;
}
TIntermTyped *TParseContext::addAssign(TOperator op,
TIntermTyped *left,
TIntermTyped *right,
const TSourceLoc &loc)
{
checkCanBeLValue(loc, "assign", left);
TIntermTyped *node = createAssign(op, left, right, loc);
if (node == nullptr) if (node == nullptr)
{ {
assignError(loc, "assign", left->getCompleteString(), right->getCompleteString()); assignError(loc, "assign", left->getCompleteString(), right->getCompleteString());
return left; return left;
} }
node->setLine(loc);
return node; return node;
} }
......
...@@ -545,10 +545,6 @@ class TParseContext : angle::NonCopyable ...@@ -545,10 +545,6 @@ class TParseContext : angle::NonCopyable
TIntermTyped *left, TIntermTyped *left,
TIntermTyped *right, TIntermTyped *right,
const TSourceLoc &loc); const TSourceLoc &loc);
TIntermBinary *createAssign(TOperator op,
TIntermTyped *left,
TIntermTyped *right,
const TSourceLoc &loc);
TIntermTyped *createUnaryMath(TOperator op, TIntermTyped *child, const TSourceLoc &loc); TIntermTyped *createUnaryMath(TOperator op, TIntermTyped *child, const TSourceLoc &loc);
TIntermTyped *addMethod(TFunctionLookup *fnCall, const TSourceLoc &loc); TIntermTyped *addMethod(TFunctionLookup *fnCall, const TSourceLoc &loc);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment