Commit 5796127e by Olli Etuaho Committed by Commit Bot

Rename TIntermSelection to TIntermIfElse

Now that ternary nodes are not represented by TIntermSelection any more, TIntermIfElse is an easier name to understand for newcomers to the code. BUG=angleproject:1490 TEST=angle_unittests Change-Id: Ia1e04e356ab93409400245092a84533d7dfd129d Reviewed-on: https://chromium-review.googlesource.com/385416Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
parent 28b6528c
......@@ -72,9 +72,9 @@ class PullGradient : public TIntermTraverser
return true;
}
bool visitSelection(Visit visit, TIntermSelection *selection) override
bool visitIfElse(Visit visit, TIntermIfElse *ifElse) override
{
visitControlFlow(visit, selection);
visitControlFlow(visit, ifElse);
return true;
}
......@@ -196,7 +196,7 @@ class PullComputeDiscontinuousAndGradientLoops : public TIntermTraverser
return true;
}
bool visitSelection(Visit visit, TIntermSelection *node) override
bool visitIfElse(Visit visit, TIntermIfElse *node) override
{
if (visit == PreVisit)
{
......@@ -310,7 +310,7 @@ class PullComputeDiscontinuousAndGradientLoops : public TIntermTraverser
const CallDAG &mDag;
std::vector<TIntermNode*> mLoopsAndSwitches;
std::vector<TIntermSelection*> mIfs;
std::vector<TIntermIfElse *> mIfs;
};
// Tags all the functions called in a discontinuous loop
......@@ -385,7 +385,7 @@ bool ASTMetadataHLSL::hasGradientInCallGraph(TIntermLoop *node)
return mControlFlowsContainingGradient.count(node) > 0;
}
bool ASTMetadataHLSL::hasGradientLoop(TIntermSelection *node)
bool ASTMetadataHLSL::hasGradientLoop(TIntermIfElse *node)
{
return mIfsContainingGradientLoop.count(node) > 0;
}
......
......@@ -14,7 +14,7 @@
class CallDAG;
class TIntermNode;
class TIntermSelection;
class TIntermIfElse;
class TIntermLoop;
struct ASTMetadataHLSL
......@@ -30,7 +30,7 @@ struct ASTMetadataHLSL
// Here "something uses a gradient" means here that it either contains a
// gradient operation, or a call to a function that uses a gradient.
bool hasGradientInCallGraph(TIntermLoop *node);
bool hasGradientLoop(TIntermSelection *node);
bool hasGradientLoop(TIntermIfElse *node);
// Does the function use a gradient.
bool mUsesGradient;
......@@ -44,7 +44,7 @@ struct ASTMetadataHLSL
bool mCalledInDiscontinuousLoop;
bool mHasGradientLoopInCallGraph;
std::set<TIntermLoop*> mDiscontinuousLoops;
std::set<TIntermSelection *> mIfsContainingGradientLoop;
std::set<TIntermIfElse *> mIfsContainingGradientLoop;
// Will we need to generate a Lod0 version of the function.
bool mNeedsLod0;
......
......@@ -25,7 +25,7 @@ class VariableInitializer : public TIntermTraverser
protected:
bool visitBinary(Visit, TIntermBinary *node) override { return false; }
bool visitUnary(Visit, TIntermUnary *node) override { return false; }
bool visitSelection(Visit, TIntermSelection *node) override { return false; }
bool visitIfElse(Visit, TIntermIfElse *node) override { return false; }
bool visitLoop(Visit, TIntermLoop *node) override { return false; }
bool visitBranch(Visit, TIntermBranch *node) override { return false; }
......
......@@ -300,8 +300,7 @@ bool TIntermTernary::replaceChildNode(TIntermNode *original, TIntermNode *replac
return false;
}
bool TIntermSelection::replaceChildNode(
TIntermNode *original, TIntermNode *replacement)
bool TIntermIfElse::replaceChildNode(TIntermNode *original, TIntermNode *replacement)
{
REPLACE_IF_IS(mCondition, TIntermTyped, original, replacement);
REPLACE_IF_IS(mTrueBlock, TIntermNode, original, replacement);
......
......@@ -35,7 +35,7 @@ class TIntermBinary;
class TIntermUnary;
class TIntermConstantUnion;
class TIntermTernary;
class TIntermSelection;
class TIntermIfElse;
class TIntermSwitch;
class TIntermCase;
class TIntermTyped;
......@@ -95,7 +95,7 @@ class TIntermNode : angle::NonCopyable
virtual TIntermBinary *getAsBinaryNode() { return 0; }
virtual TIntermUnary *getAsUnaryNode() { return 0; }
virtual TIntermTernary *getAsTernaryNode() { return nullptr; }
virtual TIntermSelection *getAsSelectionNode() { return 0; }
virtual TIntermIfElse *getAsIfElseNode() { return nullptr; }
virtual TIntermSwitch *getAsSwitchNode() { return 0; }
virtual TIntermCase *getAsCaseNode() { return 0; }
virtual TIntermSymbol *getAsSymbolNode() { return 0; }
......@@ -603,11 +603,10 @@ class TIntermTernary : public TIntermTyped
TIntermTyped *mFalseExpression;
};
// For if tests.
class TIntermSelection : public TIntermNode
class TIntermIfElse : public TIntermNode
{
public:
TIntermSelection(TIntermTyped *cond, TIntermNode *trueB, TIntermNode *falseB)
TIntermIfElse(TIntermTyped *cond, TIntermNode *trueB, TIntermNode *falseB)
: TIntermNode(), mCondition(cond), mTrueBlock(trueB), mFalseBlock(falseB)
{
}
......@@ -618,7 +617,7 @@ class TIntermSelection : public TIntermNode
TIntermTyped *getCondition() const { return mCondition; }
TIntermNode *getTrueBlock() const { return mTrueBlock; }
TIntermNode *getFalseBlock() const { return mFalseBlock; }
TIntermSelection *getAsSelectionNode() override { return this; }
TIntermIfElse *getAsIfElseNode() override { return this; }
protected:
TIntermTyped *mCondition;
......@@ -710,7 +709,7 @@ class TIntermTraverser : angle::NonCopyable
virtual bool visitBinary(Visit visit, TIntermBinary *node) { return true; }
virtual bool visitUnary(Visit visit, TIntermUnary *node) { return true; }
virtual bool visitTernary(Visit visit, TIntermTernary *node) { return true; }
virtual bool visitSelection(Visit visit, TIntermSelection *node) { return true; }
virtual bool visitIfElse(Visit visit, TIntermIfElse *node) { return true; }
virtual bool visitSwitch(Visit visit, TIntermSwitch *node) { return true; }
virtual bool visitCase(Visit visit, TIntermCase *node) { return true; }
virtual bool visitAggregate(Visit visit, TIntermAggregate *node) { return true; }
......@@ -726,7 +725,7 @@ class TIntermTraverser : angle::NonCopyable
virtual void traverseBinary(TIntermBinary *node);
virtual void traverseUnary(TIntermUnary *node);
virtual void traverseTernary(TIntermTernary *node);
virtual void traverseSelection(TIntermSelection *node);
virtual void traverseIfElse(TIntermIfElse *node);
virtual void traverseSwitch(TIntermSwitch *node);
virtual void traverseCase(TIntermCase *node);
virtual void traverseAggregate(TIntermAggregate *node);
......@@ -1014,7 +1013,7 @@ class TMaxDepthTraverser : public TIntermTraverser
bool visitBinary(Visit, TIntermBinary *) override { return depthCheck(); }
bool visitUnary(Visit, TIntermUnary *) override { return depthCheck(); }
bool visitTernary(Visit, TIntermTernary *) override { return depthCheck(); }
bool visitSelection(Visit, TIntermSelection *) override { return depthCheck(); }
bool visitIfElse(Visit, TIntermIfElse *) override { return depthCheck(); }
bool visitAggregate(Visit, TIntermAggregate *) override { return depthCheck(); }
bool visitLoop(Visit, TIntermLoop *) override { return depthCheck(); }
bool visitBranch(Visit, TIntermBranch *) override { return depthCheck(); }
......
......@@ -38,9 +38,9 @@ void TIntermTernary::traverse(TIntermTraverser *it)
it->traverseTernary(this);
}
void TIntermSelection::traverse(TIntermTraverser *it)
void TIntermIfElse::traverse(TIntermTraverser *it)
{
it->traverseSelection(this);
it->traverseIfElse(this);
}
void TIntermSwitch::traverse(TIntermTraverser *it)
......@@ -596,15 +596,13 @@ void TIntermTraverser::traverseTernary(TIntermTernary *node)
visitTernary(PostVisit, node);
}
//
// Traverse a selection node. Same comments in binary node apply here.
//
void TIntermTraverser::traverseSelection(TIntermSelection *node)
// Traverse an if-else node. Same comments in binary node apply here.
void TIntermTraverser::traverseIfElse(TIntermIfElse *node)
{
bool visit = true;
if (preVisit)
visit = visitSelection(PreVisit, node);
visit = visitIfElse(PreVisit, node);
if (visit)
{
......@@ -618,7 +616,7 @@ void TIntermTraverser::traverseSelection(TIntermSelection *node)
}
if (visit && postVisit)
visitSelection(PostVisit, node);
visitIfElse(PostVisit, node);
}
//
......
......@@ -172,37 +172,35 @@ TIntermAggregate *TIntermediate::ensureSequence(TIntermNode *node)
return aggNode;
}
//
// For "if" test nodes. There are three children; a condition,
// a true path, and a false path. The two paths are in the
// nodePair.
//
// Returns the selection node created.
//
TIntermNode *TIntermediate::addSelection(
TIntermTyped *cond, TIntermNodePair nodePair, const TSourceLoc &line)
// Returns the node created.
TIntermNode *TIntermediate::addIfElse(TIntermTyped *cond,
TIntermNodePair nodePair,
const TSourceLoc &line)
{
//
// For compile time constant selections, prune the code and
// test now.
//
// For compile time constant conditions, prune the code now.
if (cond->getAsConstantUnion())
{
if (cond->getAsConstantUnion()->getBConst(0) == true)
{
return nodePair.node1 ? setAggregateOperator(
nodePair.node1, EOpSequence, nodePair.node1->getLine()) : NULL;
return nodePair.node1 ? setAggregateOperator(nodePair.node1, EOpSequence,
nodePair.node1->getLine())
: nullptr;
}
else
{
return nodePair.node2 ? setAggregateOperator(
nodePair.node2, EOpSequence, nodePair.node2->getLine()) : NULL;
return nodePair.node2 ? setAggregateOperator(nodePair.node2, EOpSequence,
nodePair.node2->getLine())
: nullptr;
}
}
TIntermSelection *node = new TIntermSelection(
cond, ensureSequence(nodePair.node1), ensureSequence(nodePair.node2));
TIntermIfElse *node =
new TIntermIfElse(cond, ensureSequence(nodePair.node1), ensureSequence(nodePair.node2));
node->setLine(line);
return node;
......
......@@ -38,7 +38,7 @@ class TIntermediate
TIntermAggregate *makeAggregate(TIntermNode *node, const TSourceLoc &);
TIntermAggregate *ensureSequence(TIntermNode *node);
TIntermAggregate *setAggregateOperator(TIntermNode *, TOperator, const TSourceLoc &);
TIntermNode *addSelection(TIntermTyped *cond, TIntermNodePair code, const TSourceLoc &line);
TIntermNode *addIfElse(TIntermTyped *cond, TIntermNodePair code, const TSourceLoc &line);
static TIntermTyped *AddTernarySelection(TIntermTyped *cond,
TIntermTyped *trueExpression,
TIntermTyped *falseExpression,
......
......@@ -27,7 +27,7 @@ bool isSingleStatement(TIntermNode *node)
return (aggregate->getOp() != EOpFunction) &&
(aggregate->getOp() != EOpSequence);
}
else if (node->getAsSelectionNode())
else if (node->getAsIfElseNode())
{
return false;
}
......@@ -726,7 +726,7 @@ bool TOutputGLSLBase::visitTernary(Visit visit, TIntermTernary *node)
return false;
}
bool TOutputGLSLBase::visitSelection(Visit visit, TIntermSelection *node)
bool TOutputGLSLBase::visitIfElse(Visit visit, TIntermIfElse *node)
{
TInfoSinkBase &out = objSink();
......
......@@ -45,7 +45,7 @@ class TOutputGLSLBase : public TIntermTraverser
bool visitBinary(Visit visit, TIntermBinary *node) override;
bool visitUnary(Visit visit, TIntermUnary *node) override;
bool visitTernary(Visit visit, TIntermTernary *node) override;
bool visitSelection(Visit visit, TIntermSelection *node) override;
bool visitIfElse(Visit visit, TIntermIfElse *node) override;
bool visitSwitch(Visit visit, TIntermSwitch *node) override;
bool visitCase(Visit visit, TIntermCase *node) override;
bool visitAggregate(Visit visit, TIntermAggregate *node) override;
......
......@@ -1457,9 +1457,9 @@ bool OutputHLSL::visitAggregate(Visit visit, TIntermAggregate *node)
// Don't output ; after case labels, they're terminated by :
// This is needed especially since outputting a ; after a case statement would turn empty
// case statements into non-empty case statements, disallowing fall-through from them.
// Also no need to output ; after selection (if) statements or sequences. This is done just
// for code clarity.
if ((*sit)->getAsCaseNode() == nullptr && (*sit)->getAsSelectionNode() == nullptr &&
// Also no need to output ; after if statements or sequences. This is done just for
// code clarity.
if ((*sit)->getAsCaseNode() == nullptr && (*sit)->getAsIfElseNode() == nullptr &&
!IsSequence(*sit))
out << ";\n";
}
......@@ -1929,7 +1929,7 @@ bool OutputHLSL::visitAggregate(Visit visit, TIntermAggregate *node)
return true;
}
void OutputHLSL::writeSelection(TInfoSinkBase &out, TIntermSelection *node)
void OutputHLSL::writeIfElse(TInfoSinkBase &out, TIntermIfElse *node)
{
out << "if (";
......@@ -1967,7 +1967,8 @@ void OutputHLSL::writeSelection(TInfoSinkBase &out, TIntermSelection *node)
outputLineDirective(out, node->getFalseBlock()->getLine().first_line);
// Either this is "else if" or the falseBlock child node will output braces.
ASSERT(IsSequence(node->getFalseBlock()) || node->getFalseBlock()->getAsSelectionNode() != nullptr);
ASSERT(IsSequence(node->getFalseBlock()) ||
node->getFalseBlock()->getAsIfElseNode() != nullptr);
node->getFalseBlock()->traverse(this);
......@@ -1992,7 +1993,7 @@ bool OutputHLSL::visitTernary(Visit, TIntermTernary *)
return false;
}
bool OutputHLSL::visitSelection(Visit visit, TIntermSelection *node)
bool OutputHLSL::visitIfElse(Visit visit, TIntermIfElse *node)
{
TInfoSinkBase &out = getInfoSink();
......@@ -2004,7 +2005,7 @@ bool OutputHLSL::visitSelection(Visit visit, TIntermSelection *node)
out << "FLATTEN ";
}
writeSelection(out, node);
writeIfElse(out, node);
return false;
}
......
......@@ -62,7 +62,7 @@ class OutputHLSL : public TIntermTraverser
bool visitBinary(Visit visit, TIntermBinary*);
bool visitUnary(Visit visit, TIntermUnary*);
bool visitTernary(Visit visit, TIntermTernary *);
bool visitSelection(Visit visit, TIntermSelection*);
bool visitIfElse(Visit visit, TIntermIfElse *);
bool visitSwitch(Visit visit, TIntermSwitch *);
bool visitCase(Visit visit, TIntermCase *);
bool visitAggregate(Visit visit, TIntermAggregate*);
......@@ -105,7 +105,7 @@ class OutputHLSL : public TIntermTraverser
TIntermTyped *expression);
void writeDeferredGlobalInitializers(TInfoSinkBase &out);
void writeSelection(TInfoSinkBase &out, TIntermSelection *node);
void writeIfElse(TInfoSinkBase &out, TIntermIfElse *node);
// Returns the function name
TString addStructEqualityFunction(const TStructure &structure);
......
......@@ -280,7 +280,7 @@ TIntermAggregate *GetIndexFunctionDefinition(TType type, bool write)
TIntermBranch *returnLastNode = new TIntermBranch(EOpReturn, indexLastNode);
useLastBlock->getSequence()->push_back(returnLastNode);
}
TIntermSelection *ifNode = new TIntermSelection(cond, useFirstBlock, nullptr);
TIntermIfElse *ifNode = new TIntermIfElse(cond, useFirstBlock, nullptr);
bodyNode->getSequence()->push_back(ifNode);
bodyNode->getSequence()->push_back(useLastBlock);
......
......@@ -69,7 +69,7 @@ bool RemoveSwitchFallThrough::visitTernary(Visit, TIntermTernary *node)
return false;
}
bool RemoveSwitchFallThrough::visitSelection(Visit, TIntermSelection *node)
bool RemoveSwitchFallThrough::visitIfElse(Visit, TIntermIfElse *node)
{
mPreviousCase->getSequence()->push_back(node);
mLastStatementWasBreak = false;
......
......@@ -24,7 +24,7 @@ class RemoveSwitchFallThrough : public TIntermTraverser
bool visitBinary(Visit, TIntermBinary *node) override;
bool visitUnary(Visit, TIntermUnary *node) override;
bool visitTernary(Visit visit, TIntermTernary *node) override;
bool visitSelection(Visit visit, TIntermSelection *node) override;
bool visitIfElse(Visit visit, TIntermIfElse *node) override;
bool visitSwitch(Visit, TIntermSwitch *node) override;
bool visitCase(Visit, TIntermCase *node) override;
bool visitAggregate(Visit, TIntermAggregate *node) override;
......
......@@ -95,7 +95,7 @@ class DoWhileRewriter : public TIntermTraverser
// break;
// }
// }
TIntermSelection *breakIf = nullptr;
TIntermIfElse *breakIf = nullptr;
{
TIntermBranch *breakStatement = new TIntermBranch(EOpBreak, nullptr);
......@@ -105,13 +105,12 @@ class DoWhileRewriter : public TIntermTraverser
TIntermUnary *negatedCondition =
new TIntermUnary(EOpLogicalNot, loop->getCondition());
TIntermSelection *innerIf =
new TIntermSelection(negatedCondition, breakBlock, nullptr);
TIntermIfElse *innerIf = new TIntermIfElse(negatedCondition, breakBlock, nullptr);
TIntermAggregate *innerIfBlock = new TIntermAggregate(EOpSequence);
innerIfBlock->getSequence()->push_back(innerIf);
breakIf = new TIntermSelection(createTempSymbol(boolType), innerIfBlock, nullptr);
breakIf = new TIntermIfElse(createTempSymbol(boolType), innerIfBlock, nullptr);
}
// Assemble the replacement loops, reusing the do-while loop's body and inserting our
......
......@@ -28,7 +28,7 @@ class ElseBlockRewriter : public TIntermTraverser
private:
const TType *mFunctionType;
TIntermNode *rewriteSelection(TIntermSelection *selection);
TIntermNode *rewriteIfElse(TIntermIfElse *ifElse);
};
ElseBlockRewriter::ElseBlockRewriter()
......@@ -46,19 +46,19 @@ bool ElseBlockRewriter::visitAggregate(Visit visit, TIntermAggregate *node)
for (size_t statementIndex = 0; statementIndex != node->getSequence()->size(); statementIndex++)
{
TIntermNode *statement = (*node->getSequence())[statementIndex];
TIntermSelection *selection = statement->getAsSelectionNode();
if (selection && selection->getFalseBlock() != nullptr)
TIntermIfElse *ifElse = statement->getAsIfElseNode();
if (ifElse && ifElse->getFalseBlock() != nullptr)
{
// Check for if / else if
TIntermSelection *elseIfBranch = selection->getFalseBlock()->getAsSelectionNode();
TIntermIfElse *elseIfBranch = ifElse->getFalseBlock()->getAsIfElseNode();
if (elseIfBranch)
{
selection->replaceChildNode(elseIfBranch, rewriteSelection(elseIfBranch));
ifElse->replaceChildNode(elseIfBranch, rewriteIfElse(elseIfBranch));
delete elseIfBranch;
}
(*node->getSequence())[statementIndex] = rewriteSelection(selection);
delete selection;
(*node->getSequence())[statementIndex] = rewriteIfElse(ifElse);
delete ifElse;
}
}
}
......@@ -75,20 +75,20 @@ bool ElseBlockRewriter::visitAggregate(Visit visit, TIntermAggregate *node)
return true;
}
TIntermNode *ElseBlockRewriter::rewriteSelection(TIntermSelection *selection)
TIntermNode *ElseBlockRewriter::rewriteIfElse(TIntermIfElse *ifElse)
{
ASSERT(selection != nullptr);
ASSERT(ifElse != nullptr);
nextTemporaryIndex();
TIntermTyped *typedCondition = selection->getCondition()->getAsTyped();
TIntermTyped *typedCondition = ifElse->getCondition()->getAsTyped();
TIntermAggregate *storeCondition = createTempInitDeclaration(typedCondition);
TIntermSelection *falseBlock = nullptr;
TIntermIfElse *falseBlock = nullptr;
TType boolType(EbtBool, EbpUndefined, EvqTemporary);
if (selection->getFalseBlock())
if (ifElse->getFalseBlock())
{
TIntermAggregate *negatedElse = nullptr;
// crbug.com/346463
......@@ -107,16 +107,16 @@ TIntermNode *ElseBlockRewriter::rewriteSelection(TIntermSelection *selection)
TIntermSymbol *conditionSymbolElse = createTempSymbol(boolType);
TIntermUnary *negatedCondition = new TIntermUnary(EOpLogicalNot, conditionSymbolElse);
falseBlock = new TIntermSelection(negatedCondition,
selection->getFalseBlock(), negatedElse);
falseBlock = new TIntermIfElse(negatedCondition, ifElse->getFalseBlock(), negatedElse);
}
TIntermSymbol *conditionSymbolSel = createTempSymbol(boolType);
TIntermSelection *newSelection = new TIntermSelection(conditionSymbolSel, selection->getTrueBlock(), falseBlock);
TIntermIfElse *newIfElse =
new TIntermIfElse(conditionSymbolSel, ifElse->getTrueBlock(), falseBlock);
TIntermAggregate *block = new TIntermAggregate(EOpSequence);
block->getSequence()->push_back(storeCondition);
block->getSequence()->push_back(newSelection);
block->getSequence()->push_back(newIfElse);
return block;
}
......
......@@ -80,7 +80,7 @@ bool UnfoldShortCircuitTraverser::visitBinary(Visit visit, TIntermBinary *node)
assignRightBlock->getSequence()->push_back(createTempAssignment(node->getRight()));
TIntermUnary *notTempSymbol = new TIntermUnary(EOpLogicalNot, createTempSymbol(boolType));
TIntermSelection *ifNode = new TIntermSelection(notTempSymbol, assignRightBlock, nullptr);
TIntermIfElse *ifNode = new TIntermIfElse(notTempSymbol, assignRightBlock, nullptr);
insertions.push_back(ifNode);
insertStatementsInParentBlock(insertions);
......@@ -103,8 +103,8 @@ bool UnfoldShortCircuitTraverser::visitBinary(Visit visit, TIntermBinary *node)
ASSERT(node->getRight()->getType() == boolType);
assignRightBlock->getSequence()->push_back(createTempAssignment(node->getRight()));
TIntermSelection *ifNode =
new TIntermSelection(createTempSymbol(boolType), assignRightBlock, nullptr);
TIntermIfElse *ifNode =
new TIntermIfElse(createTempSymbol(boolType), assignRightBlock, nullptr);
insertions.push_back(ifNode);
insertStatementsInParentBlock(insertions);
......@@ -147,8 +147,8 @@ bool UnfoldShortCircuitTraverser::visitTernary(Visit visit, TIntermTernary *node
TIntermBinary *falseAssignment = createTempAssignment(node->getFalseExpression());
falseBlock->getSequence()->push_back(falseAssignment);
TIntermSelection *ifNode =
new TIntermSelection(node->getCondition()->getAsTyped(), trueBlock, falseBlock);
TIntermIfElse *ifNode =
new TIntermIfElse(node->getCondition()->getAsTyped(), trueBlock, falseBlock);
insertions.push_back(ifNode);
insertStatementsInParentBlock(insertions);
......
......@@ -71,7 +71,7 @@ bool ValidateSwitch::visitTernary(Visit, TIntermTernary *)
return true;
}
bool ValidateSwitch::visitSelection(Visit visit, TIntermSelection *)
bool ValidateSwitch::visitIfElse(Visit visit, TIntermIfElse *)
{
if (visit == PreVisit)
++mControlFlowDepth;
......
......@@ -24,7 +24,7 @@ class ValidateSwitch : public TIntermTraverser
bool visitBinary(Visit, TIntermBinary *) override;
bool visitUnary(Visit, TIntermUnary *) override;
bool visitTernary(Visit, TIntermTernary *) override;
bool visitSelection(Visit visit, TIntermSelection *) override;
bool visitIfElse(Visit visit, TIntermIfElse *) override;
bool visitSwitch(Visit, TIntermSwitch *) override;
bool visitCase(Visit, TIntermCase *node) override;
bool visitAggregate(Visit, TIntermAggregate *) override;
......
......@@ -1334,7 +1334,7 @@ expression_statement
selection_statement
: IF LEFT_PAREN expression RIGHT_PAREN selection_rest_statement {
context->checkIsScalarBool(@1, $3);
$$ = context->intermediate.addSelection($3, $5, @1);
$$ = context->intermediate.addIfElse($3, $5, @1);
}
;
......
......@@ -4400,7 +4400,7 @@ yyreduce:
{
context->checkIsScalarBool((yylsp[-4]), (yyvsp[-2].interm.intermTypedNode));
(yyval.interm.intermNode) = context->intermediate.addSelection((yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.nodePair), (yylsp[-4]));
(yyval.interm.intermNode) = context->intermediate.addIfElse((yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.nodePair), (yylsp[-4]));
}
break;
......
......@@ -45,7 +45,7 @@ class TOutputTraverser : public TIntermTraverser
bool visitBinary(Visit visit, TIntermBinary *) override;
bool visitUnary(Visit visit, TIntermUnary *) override;
bool visitTernary(Visit visit, TIntermTernary *node) override;
bool visitSelection(Visit visit, TIntermSelection *) override;
bool visitIfElse(Visit visit, TIntermIfElse *node) override;
bool visitAggregate(Visit visit, TIntermAggregate *) override;
bool visitLoop(Visit visit, TIntermLoop *) override;
bool visitBranch(Visit visit, TIntermBranch *) override;
......@@ -492,7 +492,7 @@ bool TOutputTraverser::visitTernary(Visit visit, TIntermTernary *node)
return false;
}
bool TOutputTraverser::visitSelection(Visit visit, TIntermSelection *node)
bool TOutputTraverser::visitIfElse(Visit visit, TIntermIfElse *node)
{
TInfoSinkBase &out = sink;
......
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