Commit 4db7ded5 by Olli Etuaho Committed by Commit Bot

Change comma nodes to TIntermBinary

Comma nodes always have just two parameters. If there's an expression with several commas in the middle, it's parsed as a tree of comma operations. It makes more sense to represent it as a binary node rather than an aggregate node. After this patch, TIntermAggregate is still used for function prototypes, function parameter lists, function calls, and variable and invariant declarations. BUG=angleproject:1490 TEST=angle_unittests, angle_end2end_tests Change-Id: I66be10624bf27bcf25987b4d93958d4a07600771 Reviewed-on: https://chromium-review.googlesource.com/397320Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
parent 13e4d21b
...@@ -475,8 +475,8 @@ bool parentUsesResult(TIntermNode* parent, TIntermNode* node) ...@@ -475,8 +475,8 @@ bool parentUsesResult(TIntermNode* parent, TIntermNode* node)
{ {
return false; return false;
} }
TIntermAggregate *aggParent = parent->getAsAggregate(); TIntermBinary *binaryParent = parent->getAsBinaryNode();
if (aggParent && aggParent->getOp() == EOpComma && (aggParent->getSequence()->back() != node)) if (binaryParent && binaryParent->getOp() == EOpComma && (binaryParent->getRight() != node))
{ {
return false; return false;
} }
......
...@@ -823,6 +823,18 @@ void TIntermSwizzle::writeOffsetsAsXYZW(TInfoSinkBase *out) const ...@@ -823,6 +823,18 @@ void TIntermSwizzle::writeOffsetsAsXYZW(TInfoSinkBase *out) const
} }
} }
TQualifier TIntermBinary::GetCommaQualifier(int shaderVersion,
const TIntermTyped *left,
const TIntermTyped *right)
{
// ESSL3.00 section 12.43: The result of a sequence operator is not a constant-expression.
if (shaderVersion >= 300 || left->getQualifier() != EvqConst ||
right->getQualifier() != EvqConst)
{
return EvqTemporary;
}
return EvqConst;
}
// Establishes the type of the result of the binary operation. // Establishes the type of the result of the binary operation.
void TIntermBinary::promote() void TIntermBinary::promote()
...@@ -830,6 +842,13 @@ void TIntermBinary::promote() ...@@ -830,6 +842,13 @@ void TIntermBinary::promote()
ASSERT(!isMultiplication() || ASSERT(!isMultiplication() ||
mOp == GetMulOpBasedOnOperands(mLeft->getType(), mRight->getType())); mOp == GetMulOpBasedOnOperands(mLeft->getType(), mRight->getType()));
// Comma is handled as a special case.
if (mOp == EOpComma)
{
setType(mRight->getType());
return;
}
// Base assumption: just make the type the same as the left // Base assumption: just make the type the same as the left
// operand. Then only deviations from this need be coded. // operand. Then only deviations from this need be coded.
setType(mLeft->getType()); setType(mLeft->getType());
......
...@@ -462,6 +462,9 @@ class TIntermBinary : public TIntermOperator ...@@ -462,6 +462,9 @@ class TIntermBinary : public TIntermOperator
static TOperator GetMulOpBasedOnOperands(const TType &left, const TType &right); static TOperator GetMulOpBasedOnOperands(const TType &left, const TType &right);
static TOperator GetMulAssignOpBasedOnOperands(const TType &left, const TType &right); static TOperator GetMulAssignOpBasedOnOperands(const TType &left, const TType &right);
static TQualifier GetCommaQualifier(int shaderVersion,
const TIntermTyped *left,
const TIntermTyped *right);
TIntermBinary *getAsBinaryNode() override { return this; }; TIntermBinary *getAsBinaryNode() override { return this; };
void traverse(TIntermTraverser *it) override; void traverse(TIntermTraverser *it) override;
......
...@@ -198,19 +198,11 @@ TIntermNode *TIntermediate::addIfElse(TIntermTyped *cond, ...@@ -198,19 +198,11 @@ TIntermNode *TIntermediate::addIfElse(TIntermTyped *cond,
return node; return node;
} }
TIntermTyped *TIntermediate::addComma(TIntermTyped *left, TIntermTyped *TIntermediate::AddComma(TIntermTyped *left,
TIntermTyped *right, TIntermTyped *right,
const TSourceLoc &line, const TSourceLoc &line,
int shaderVersion) int shaderVersion)
{ {
TQualifier resultQualifier = EvqConst;
// ESSL3.00 section 12.43: The result of a sequence operator is not a constant-expression.
if (shaderVersion >= 300 || left->getQualifier() != EvqConst ||
right->getQualifier() != EvqConst)
{
resultQualifier = EvqTemporary;
}
TIntermTyped *commaNode = nullptr; TIntermTyped *commaNode = nullptr;
if (!left->hasSideEffects()) if (!left->hasSideEffects())
{ {
...@@ -218,10 +210,10 @@ TIntermTyped *TIntermediate::addComma(TIntermTyped *left, ...@@ -218,10 +210,10 @@ TIntermTyped *TIntermediate::addComma(TIntermTyped *left,
} }
else else
{ {
commaNode = growAggregate(left, right, line); commaNode = new TIntermBinary(EOpComma, left, right);
commaNode->getAsAggregate()->setOp(EOpComma); commaNode->setLine(line);
commaNode->setType(right->getType());
} }
TQualifier resultQualifier = TIntermBinary::GetCommaQualifier(shaderVersion, left, right);
commaNode->getTypePointer()->setQualifier(resultQualifier); commaNode->getTypePointer()->setQualifier(resultQualifier);
return commaNode; return commaNode;
} }
......
...@@ -48,10 +48,10 @@ class TIntermediate ...@@ -48,10 +48,10 @@ class TIntermediate
const TSourceLoc &line); const TSourceLoc &line);
TIntermCase *addCase( TIntermCase *addCase(
TIntermTyped *condition, const TSourceLoc &line); TIntermTyped *condition, const TSourceLoc &line);
TIntermTyped *addComma(TIntermTyped *left, static TIntermTyped *AddComma(TIntermTyped *left,
TIntermTyped *right, TIntermTyped *right,
const TSourceLoc &line, const TSourceLoc &line,
int shaderVersion); int shaderVersion);
TIntermConstantUnion *addConstantUnion(const TConstantUnion *constantUnion, TIntermConstantUnion *addConstantUnion(const TConstantUnion *constantUnion,
const TType &type, const TType &type,
const TSourceLoc &line); const TSourceLoc &line);
......
...@@ -867,133 +867,139 @@ bool OutputHLSL::visitBinary(Visit visit, TIntermBinary *node) ...@@ -867,133 +867,139 @@ bool OutputHLSL::visitBinary(Visit visit, TIntermBinary *node)
switch (node->getOp()) switch (node->getOp())
{ {
case EOpAssign: case EOpComma:
if (node->getLeft()->isArray()) outputTriplet(out, visit, "(", ", ", ")");
{ break;
TIntermAggregate *rightAgg = node->getRight()->getAsAggregate(); case EOpAssign:
if (rightAgg != nullptr && rightAgg->isConstructor()) if (node->getLeft()->isArray())
{ {
const TString &functionName = addArrayConstructIntoFunction(node->getType()); TIntermAggregate *rightAgg = node->getRight()->getAsAggregate();
out << functionName << "("; if (rightAgg != nullptr && rightAgg->isConstructor())
node->getLeft()->traverse(this);
TIntermSequence *seq = rightAgg->getSequence();
for (auto &arrayElement : *seq)
{ {
out << ", "; const TString &functionName = addArrayConstructIntoFunction(node->getType());
arrayElement->traverse(this); out << functionName << "(";
node->getLeft()->traverse(this);
TIntermSequence *seq = rightAgg->getSequence();
for (auto &arrayElement : *seq)
{
out << ", ";
arrayElement->traverse(this);
}
out << ")";
return false;
} }
out << ")"; // ArrayReturnValueToOutParameter should have eliminated expressions where a
return false; // function call is assigned.
} ASSERT(rightAgg == nullptr || rightAgg->getOp() != EOpFunctionCall);
// ArrayReturnValueToOutParameter should have eliminated expressions where a function call is assigned.
ASSERT(rightAgg == nullptr || rightAgg->getOp() != EOpFunctionCall);
const TString &functionName = addArrayAssignmentFunction(node->getType());
outputTriplet(out, visit, (functionName + "(").c_str(), ", ", ")");
}
else
{
outputTriplet(out, visit, "(", " = ", ")");
}
break;
case EOpInitialize:
if (visit == PreVisit)
{
TIntermSymbol *symbolNode = node->getLeft()->getAsSymbolNode();
ASSERT(symbolNode);
TIntermTyped *expression = node->getRight();
// Global initializers must be constant at this point.
ASSERT(symbolNode->getQualifier() != EvqGlobal || canWriteAsHLSLLiteral(expression));
// GLSL allows to write things like "float x = x;" where a new variable x is defined const TString &functionName = addArrayAssignmentFunction(node->getType());
// and the value of an existing variable x is assigned. HLSL uses C semantics (the outputTriplet(out, visit, (functionName + "(").c_str(), ", ", ")");
// new variable is created before the assignment is evaluated), so we need to convert }
// this to "float t = x, x = t;". else
if (writeSameSymbolInitializer(out, symbolNode, expression))
{ {
// Skip initializing the rest of the expression outputTriplet(out, visit, "(", " = ", ")");
return false;
} }
else if (writeConstantInitialization(out, symbolNode, expression)) break;
case EOpInitialize:
if (visit == PreVisit)
{ {
return false; TIntermSymbol *symbolNode = node->getLeft()->getAsSymbolNode();
ASSERT(symbolNode);
TIntermTyped *expression = node->getRight();
// Global initializers must be constant at this point.
ASSERT(symbolNode->getQualifier() != EvqGlobal ||
canWriteAsHLSLLiteral(expression));
// GLSL allows to write things like "float x = x;" where a new variable x is defined
// and the value of an existing variable x is assigned. HLSL uses C semantics (the
// new variable is created before the assignment is evaluated), so we need to
// convert
// this to "float t = x, x = t;".
if (writeSameSymbolInitializer(out, symbolNode, expression))
{
// Skip initializing the rest of the expression
return false;
}
else if (writeConstantInitialization(out, symbolNode, expression))
{
return false;
}
} }
} else if (visit == InVisit)
else if (visit == InVisit) {
{ out << " = ";
out << " = "; }
} break;
break; case EOpAddAssign:
case EOpAddAssign: outputTriplet(out, visit, "(", " += ", ")");
outputTriplet(out, visit, "(", " += ", ")"); break;
break; case EOpSubAssign:
case EOpSubAssign: outputTriplet(out, visit, "(", " -= ", ")");
outputTriplet(out, visit, "(", " -= ", ")"); break;
break; case EOpMulAssign:
case EOpMulAssign: outputTriplet(out, visit, "(", " *= ", ")");
outputTriplet(out, visit, "(", " *= ", ")"); break;
break; case EOpVectorTimesScalarAssign:
case EOpVectorTimesScalarAssign: outputTriplet(out, visit, "(", " *= ", ")");
outputTriplet(out, visit, "(", " *= ", ")"); break;
break; case EOpMatrixTimesScalarAssign:
case EOpMatrixTimesScalarAssign: outputTriplet(out, visit, "(", " *= ", ")");
outputTriplet(out, visit, "(", " *= ", ")"); break;
break; case EOpVectorTimesMatrixAssign:
case EOpVectorTimesMatrixAssign: if (visit == PreVisit)
if (visit == PreVisit) {
{ out << "(";
out << "("; }
} else if (visit == InVisit)
else if (visit == InVisit) {
{ out << " = mul(";
out << " = mul("; node->getLeft()->traverse(this);
node->getLeft()->traverse(this); out << ", transpose(";
out << ", transpose("; }
} else
else {
{ out << ")))";
out << ")))"; }
} break;
break; case EOpMatrixTimesMatrixAssign:
case EOpMatrixTimesMatrixAssign: if (visit == PreVisit)
if (visit == PreVisit) {
{ out << "(";
out << "("; }
} else if (visit == InVisit)
else if (visit == InVisit) {
{ out << " = transpose(mul(transpose(";
out << " = transpose(mul(transpose("; node->getLeft()->traverse(this);
node->getLeft()->traverse(this); out << "), transpose(";
out << "), transpose("; }
} else
else {
{ out << "))))";
out << "))))"; }
} break;
break; case EOpDivAssign:
case EOpDivAssign: outputTriplet(out, visit, "(", " /= ", ")");
outputTriplet(out, visit, "(", " /= ", ")"); break;
break; case EOpIModAssign:
case EOpIModAssign: outputTriplet(out, visit, "(", " %= ", ")");
outputTriplet(out, visit, "(", " %= ", ")"); break;
break; case EOpBitShiftLeftAssign:
case EOpBitShiftLeftAssign: outputTriplet(out, visit, "(", " <<= ", ")");
outputTriplet(out, visit, "(", " <<= ", ")"); break;
break; case EOpBitShiftRightAssign:
case EOpBitShiftRightAssign: outputTriplet(out, visit, "(", " >>= ", ")");
outputTriplet(out, visit, "(", " >>= ", ")"); break;
break; case EOpBitwiseAndAssign:
case EOpBitwiseAndAssign: outputTriplet(out, visit, "(", " &= ", ")");
outputTriplet(out, visit, "(", " &= ", ")"); break;
break; case EOpBitwiseXorAssign:
case EOpBitwiseXorAssign: outputTriplet(out, visit, "(", " ^= ", ")");
outputTriplet(out, visit, "(", " ^= ", ")"); break;
break; case EOpBitwiseOrAssign:
case EOpBitwiseOrAssign: outputTriplet(out, visit, "(", " |= ", ")");
outputTriplet(out, visit, "(", " |= ", ")"); break;
break; case EOpIndexDirect:
case EOpIndexDirect:
{ {
const TType& leftType = node->getLeft()->getType(); const TType& leftType = node->getLeft()->getType();
if (leftType.isInterfaceBlock()) if (leftType.isInterfaceBlock())
...@@ -1642,9 +1648,6 @@ bool OutputHLSL::visitAggregate(Visit visit, TIntermAggregate *node) ...@@ -1642,9 +1648,6 @@ bool OutputHLSL::visitAggregate(Visit visit, TIntermAggregate *node)
return false; return false;
} }
break; break;
case EOpComma:
outputTriplet(out, visit, "(", ", ", ")");
break;
case EOpFunctionCall: case EOpFunctionCall:
{ {
TIntermSequence *arguments = node->getSequence(); TIntermSequence *arguments = node->getSequence();
......
...@@ -3630,7 +3630,7 @@ TIntermTyped *TParseContext::addComma(TIntermTyped *left, ...@@ -3630,7 +3630,7 @@ TIntermTyped *TParseContext::addComma(TIntermTyped *left,
","); ",");
} }
return intermediate.addComma(left, right, loc, mShaderVersion); return TIntermediate::AddComma(left, right, loc, mShaderVersion);
} }
TIntermBranch *TParseContext::addBranch(TOperator op, const TSourceLoc &loc) TIntermBranch *TParseContext::addBranch(TOperator op, const TSourceLoc &loc)
......
...@@ -57,7 +57,7 @@ void SplitSequenceOperatorTraverser::nextIteration() ...@@ -57,7 +57,7 @@ void SplitSequenceOperatorTraverser::nextIteration()
nextTemporaryIndex(); nextTemporaryIndex();
} }
bool SplitSequenceOperatorTraverser::visitBinary(Visit visit, TIntermBinary *node) bool SplitSequenceOperatorTraverser::visitAggregate(Visit visit, TIntermAggregate *node)
{ {
if (mFoundExpressionToSplit) if (mFoundExpressionToSplit)
return false; return false;
...@@ -65,15 +65,14 @@ bool SplitSequenceOperatorTraverser::visitBinary(Visit visit, TIntermBinary *nod ...@@ -65,15 +65,14 @@ bool SplitSequenceOperatorTraverser::visitBinary(Visit visit, TIntermBinary *nod
if (mInsideSequenceOperator > 0 && visit == PreVisit) if (mInsideSequenceOperator > 0 && visit == PreVisit)
{ {
// Detect expressions that need to be simplified // Detect expressions that need to be simplified
mFoundExpressionToSplit = mFoundExpressionToSplit = mPatternToSplitMatcher.match(node, getParentNode());
mPatternToSplitMatcher.match(node, getParentNode(), isLValueRequiredHere());
return !mFoundExpressionToSplit; return !mFoundExpressionToSplit;
} }
return true; return true;
} }
bool SplitSequenceOperatorTraverser::visitAggregate(Visit visit, TIntermAggregate *node) bool SplitSequenceOperatorTraverser::visitBinary(Visit visit, TIntermBinary *node)
{ {
if (node->getOp() == EOpComma) if (node->getOp() == EOpComma)
{ {
...@@ -91,19 +90,12 @@ bool SplitSequenceOperatorTraverser::visitAggregate(Visit visit, TIntermAggregat ...@@ -91,19 +90,12 @@ bool SplitSequenceOperatorTraverser::visitAggregate(Visit visit, TIntermAggregat
// execution order. // execution order.
if (mFoundExpressionToSplit && mInsideSequenceOperator == 1) if (mFoundExpressionToSplit && mInsideSequenceOperator == 1)
{ {
// Move all operands of the sequence operation except the last one into separate // Move the left side operand into a separate statement in the parent block.
// statements in the parent block.
TIntermSequence insertions; TIntermSequence insertions;
for (auto *sequenceChild : *node->getSequence()) insertions.push_back(node->getLeft());
{
if (sequenceChild != node->getSequence()->back())
{
insertions.push_back(sequenceChild);
}
}
insertStatementsInParentBlock(insertions); insertStatementsInParentBlock(insertions);
// Replace the sequence with its last operand // Replace the comma node with its right side operand.
queueReplacement(node, node->getSequence()->back(), OriginalNode::IS_DROPPED); queueReplacement(node, node->getRight(), OriginalNode::IS_DROPPED);
} }
mInsideSequenceOperator--; mInsideSequenceOperator--;
} }
...@@ -116,7 +108,8 @@ bool SplitSequenceOperatorTraverser::visitAggregate(Visit visit, TIntermAggregat ...@@ -116,7 +108,8 @@ bool SplitSequenceOperatorTraverser::visitAggregate(Visit visit, TIntermAggregat
if (mInsideSequenceOperator > 0 && visit == PreVisit) if (mInsideSequenceOperator > 0 && visit == PreVisit)
{ {
// Detect expressions that need to be simplified // Detect expressions that need to be simplified
mFoundExpressionToSplit = mPatternToSplitMatcher.match(node, getParentNode()); mFoundExpressionToSplit =
mPatternToSplitMatcher.match(node, getParentNode(), isLValueRequiredHere());
return !mFoundExpressionToSplit; return !mFoundExpressionToSplit;
} }
......
...@@ -105,145 +105,148 @@ bool TOutputTraverser::visitBinary(Visit visit, TIntermBinary *node) ...@@ -105,145 +105,148 @@ bool TOutputTraverser::visitBinary(Visit visit, TIntermBinary *node)
switch (node->getOp()) switch (node->getOp())
{ {
case EOpAssign: case EOpComma:
out << "move second child to first child"; out << "comma";
break; break;
case EOpInitialize: case EOpAssign:
out << "initialize first child with second child"; out << "move second child to first child";
break; break;
case EOpAddAssign: case EOpInitialize:
out << "add second child into first child"; out << "initialize first child with second child";
break; break;
case EOpSubAssign: case EOpAddAssign:
out << "subtract second child into first child"; out << "add second child into first child";
break; break;
case EOpMulAssign: case EOpSubAssign:
out << "multiply second child into first child"; out << "subtract second child into first child";
break; break;
case EOpVectorTimesMatrixAssign: case EOpMulAssign:
out << "matrix mult second child into first child"; out << "multiply second child into first child";
break; break;
case EOpVectorTimesScalarAssign: case EOpVectorTimesMatrixAssign:
out << "vector scale second child into first child"; out << "matrix mult second child into first child";
break; break;
case EOpMatrixTimesScalarAssign: case EOpVectorTimesScalarAssign:
out << "matrix scale second child into first child"; out << "vector scale second child into first child";
break; break;
case EOpMatrixTimesMatrixAssign: case EOpMatrixTimesScalarAssign:
out << "matrix mult second child into first child"; out << "matrix scale second child into first child";
break; break;
case EOpDivAssign: case EOpMatrixTimesMatrixAssign:
out << "divide second child into first child"; out << "matrix mult second child into first child";
break; break;
case EOpIModAssign: case EOpDivAssign:
out << "modulo second child into first child"; out << "divide second child into first child";
break; break;
case EOpBitShiftLeftAssign: case EOpIModAssign:
out << "bit-wise shift first child left by second child"; out << "modulo second child into first child";
break; break;
case EOpBitShiftRightAssign: case EOpBitShiftLeftAssign:
out << "bit-wise shift first child right by second child"; out << "bit-wise shift first child left by second child";
break; break;
case EOpBitwiseAndAssign: case EOpBitShiftRightAssign:
out << "bit-wise and second child into first child"; out << "bit-wise shift first child right by second child";
break; break;
case EOpBitwiseXorAssign: case EOpBitwiseAndAssign:
out << "bit-wise xor second child into first child"; out << "bit-wise and second child into first child";
break; break;
case EOpBitwiseOrAssign: case EOpBitwiseXorAssign:
out << "bit-wise or second child into first child"; out << "bit-wise xor second child into first child";
break; break;
case EOpBitwiseOrAssign:
case EOpIndexDirect: out << "bit-wise or second child into first child";
out << "direct index"; break;
break;
case EOpIndexIndirect: case EOpIndexDirect:
out << "indirect index"; out << "direct index";
break; break;
case EOpIndexDirectStruct: case EOpIndexIndirect:
out << "direct index for structure"; out << "indirect index";
break; break;
case EOpIndexDirectInterfaceBlock: case EOpIndexDirectStruct:
out << "direct index for interface block"; out << "direct index for structure";
break; break;
case EOpIndexDirectInterfaceBlock:
case EOpAdd: out << "direct index for interface block";
out << "add"; break;
break;
case EOpSub: case EOpAdd:
out << "subtract"; out << "add";
break; break;
case EOpMul: case EOpSub:
out << "component-wise multiply"; out << "subtract";
break; break;
case EOpDiv: case EOpMul:
out << "divide"; out << "component-wise multiply";
break; break;
case EOpIMod: case EOpDiv:
out << "modulo"; out << "divide";
break; break;
case EOpBitShiftLeft: case EOpIMod:
out << "bit-wise shift left"; out << "modulo";
break; break;
case EOpBitShiftRight: case EOpBitShiftLeft:
out << "bit-wise shift right"; out << "bit-wise shift left";
break; break;
case EOpBitwiseAnd: case EOpBitShiftRight:
out << "bit-wise and"; out << "bit-wise shift right";
break; break;
case EOpBitwiseXor: case EOpBitwiseAnd:
out << "bit-wise xor"; out << "bit-wise and";
break; break;
case EOpBitwiseOr: case EOpBitwiseXor:
out << "bit-wise or"; out << "bit-wise xor";
break; break;
case EOpBitwiseOr:
case EOpEqual: out << "bit-wise or";
out << "Compare Equal"; break;
break;
case EOpNotEqual: case EOpEqual:
out << "Compare Not Equal"; out << "Compare Equal";
break; break;
case EOpLessThan: case EOpNotEqual:
out << "Compare Less Than"; out << "Compare Not Equal";
break; break;
case EOpGreaterThan: case EOpLessThan:
out << "Compare Greater Than"; out << "Compare Less Than";
break; break;
case EOpLessThanEqual: case EOpGreaterThan:
out << "Compare Less Than or Equal"; out << "Compare Greater Than";
break; break;
case EOpGreaterThanEqual: case EOpLessThanEqual:
out << "Compare Greater Than or Equal"; out << "Compare Less Than or Equal";
break; break;
case EOpGreaterThanEqual:
case EOpVectorTimesScalar: out << "Compare Greater Than or Equal";
out << "vector-scale"; break;
break;
case EOpVectorTimesMatrix: case EOpVectorTimesScalar:
out << "vector-times-matrix"; out << "vector-scale";
break; break;
case EOpMatrixTimesVector: case EOpVectorTimesMatrix:
out << "matrix-times-vector"; out << "vector-times-matrix";
break; break;
case EOpMatrixTimesScalar: case EOpMatrixTimesVector:
out << "matrix-scale"; out << "matrix-times-vector";
break; break;
case EOpMatrixTimesMatrix: case EOpMatrixTimesScalar:
out << "matrix-multiply"; out << "matrix-scale";
break; break;
case EOpMatrixTimesMatrix:
case EOpLogicalOr: out << "matrix-multiply";
out << "logical-or"; break;
break;
case EOpLogicalXor: case EOpLogicalOr:
out << "logical-xor"; out << "logical-or";
break; break;
case EOpLogicalAnd: case EOpLogicalXor:
out << "logical-and"; out << "logical-xor";
break; break;
default: case EOpLogicalAnd:
out << "<unknown op>"; out << "logical-and";
break;
default:
out << "<unknown op>";
} }
out << " (" << node->getCompleteString() << ")"; out << " (" << node->getCompleteString() << ")";
...@@ -399,7 +402,6 @@ bool TOutputTraverser::visitAggregate(Visit visit, TIntermAggregate *node) ...@@ -399,7 +402,6 @@ bool TOutputTraverser::visitAggregate(Visit visit, TIntermAggregate *node)
switch (node->getOp()) switch (node->getOp())
{ {
case EOpComma: out << "Comma\n"; return true;
case EOpFunctionCall: case EOpFunctionCall:
OutputFunction(out, "Function Call", node->getFunctionSymbolInfo()); OutputFunction(out, "Function Call", node->getFunctionSymbolInfo());
break; break;
......
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