Refactor binary node creation
1. Simplify code by using asserts instead of adding internal errors to
log.
2. Add a TIntermBinary constructor that takes left and right operand
nodes as parameters.
3. Remove TIntermediate functions with trivial functionality.
BUG=angleproject:952
TEST=angle_unittests
Change-Id: I2e0e52160c9377d8efcf15f14fd59f01cb41bd83
Reviewed-on: https://chromium-review.googlesource.com/372720
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/compiler/translator/RemovePow.cpp b/src/compiler/translator/RemovePow.cpp
index d55e124..48fc1f9 100644
--- a/src/compiler/translator/RemovePow.cpp
+++ b/src/compiler/translator/RemovePow.cpp
@@ -52,8 +52,6 @@
{
if (IsProblematicPow(node))
{
- TInfoSink nullSink;
-
TIntermTyped *x = node->getSequence()->at(0)->getAsTyped();
TIntermTyped *y = node->getSequence()->at(1)->getAsTyped();
@@ -62,11 +60,9 @@
log->setLine(node->getLine());
log->setType(x->getType());
- TIntermBinary *mul = new TIntermBinary(EOpMul);
- mul->setLeft(y);
- mul->setRight(log);
+ TIntermBinary *mul = new TIntermBinary(EOpMul, y, log);
mul->setLine(node->getLine());
- bool valid = mul->promote(nullSink);
+ bool valid = mul->promote();
UNUSED_ASSERTION_VARIABLE(valid);
ASSERT(valid);