Revert "Revert "moved BinaryExpression's data into IRNode""
This reverts commit b61c3a9a01c44840eaa35b28cae0a4b358727f3c.
Change-Id: I42d93bdc6455c8ef941a6cbe1339df2ba916bb3c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318697
Auto-Submit: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
diff --git a/src/sksl/SkSLInliner.cpp b/src/sksl/SkSLInliner.cpp
index f17b9fe..f197481 100644
--- a/src/sksl/SkSLInliner.cpp
+++ b/src/sksl/SkSLInliner.cpp
@@ -314,9 +314,9 @@
case Expression::Kind::kBinary: {
const BinaryExpression& b = expression.as<BinaryExpression>();
return std::make_unique<BinaryExpression>(offset,
- expr(b.fLeft),
- b.fOperator,
- expr(b.fRight),
+ expr(b.leftPointer()),
+ b.getOperator(),
+ expr(b.rightPointer()),
&b.type());
}
case Expression::Kind::kBoolLiteral:
@@ -948,7 +948,7 @@
case Expression::Kind::kBinary: {
BinaryExpression& binaryExpr = (*expr)->as<BinaryExpression>();
- this->visitExpression(&binaryExpr.fLeft);
+ this->visitExpression(&binaryExpr.leftPointer());
// Logical-and and logical-or binary expressions do not inline the right side,
// because that would invalidate short-circuiting. That is, when evaluating
@@ -958,10 +958,11 @@
// It is illegal for side-effects from x() or y() to occur. The simplest way to
// enforce that rule is to avoid inlining the right side entirely. However, it
// is safe for other types of binary expression to inline both sides.
- bool shortCircuitable = (binaryExpr.fOperator == Token::Kind::TK_LOGICALAND ||
- binaryExpr.fOperator == Token::Kind::TK_LOGICALOR);
+ Token::Kind op = binaryExpr.getOperator();
+ bool shortCircuitable = (op == Token::Kind::TK_LOGICALAND ||
+ op == Token::Kind::TK_LOGICALOR);
if (!shortCircuitable) {
- this->visitExpression(&binaryExpr.fRight);
+ this->visitExpression(&binaryExpr.rightPointer());
}
break;
}