Simplify queueReplacement AST transform helper
queueReplacement is always called to replace the node that's currently
being visited in the traverser. The currently visited node can be
fetched automatically from the traversal path so it can be removed
from parameters of queueReplacement.
BUG=angleproject:2100
TEST=angle_unittests
Change-Id: I62ab6d1cd9c0d2b4c260af9f7c85bc156fb3f349
Reviewed-on: https://chromium-review.googlesource.com/562336
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/SimplifyLoopConditions.cpp b/src/compiler/translator/SimplifyLoopConditions.cpp
index d8a077f..58112b2 100644
--- a/src/compiler/translator/SimplifyLoopConditions.cpp
+++ b/src/compiler/translator/SimplifyLoopConditions.cpp
@@ -264,7 +264,7 @@
ELoopWhile, nullptr, createTempSymbol(conditionInitializer->getType()), nullptr,
whileLoopBody);
loopScope->getSequence()->push_back(whileLoop);
- queueReplacement(node, loopScope, OriginalNode::IS_DROPPED);
+ queueReplacement(loopScope, OriginalNode::IS_DROPPED);
// After this the old body node will be traversed and loops inside it may be
// transformed. This is fine, since the old body node will still be in the AST after the