Reland "Revert "moved BinaryExpression's data into IRNode""
This reverts commit 1d3e0e0054b243b7a62029c29090e7e76a19a805.
Reason for revert: possibly causing https://task-scheduler.skia.org/task/F1DoniJAddPuEkH9ETTE
Original change's description:
> Revert "Revert "moved BinaryExpression's data into IRNode""
>
> This reverts commit b61c3a9a01c44840eaa35b28cae0a4b358727f3c.
>
> Change-Id: I4689e1f4977fab3233ff492cee06fbc301b5c689
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317386
> Reviewed-by: John Stiles <johnstiles@google.com>
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
TBR=brianosman@google.com,ethannicholas@google.com,johnstiles@google.com
# Not skipping CQ checks because this is a reland.
Change-Id: Id0f3f211f09fbf31b626c648ed141fc6154a450c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317395
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
diff --git a/src/sksl/SkSLInliner.cpp b/src/sksl/SkSLInliner.cpp
index 4761329..5ede14d 100644
--- a/src/sksl/SkSLInliner.cpp
+++ b/src/sksl/SkSLInliner.cpp
@@ -308,9 +308,9 @@
case Expression::Kind::kBinary: {
const BinaryExpression& b = expression.as<BinaryExpression>();
return std::make_unique<BinaryExpression>(offset,
- expr(b.leftPointer()),
- b.getOperator(),
- expr(b.rightPointer()),
+ expr(b.fLeft),
+ b.fOperator,
+ expr(b.fRight),
&b.type());
}
case Expression::Kind::kBoolLiteral:
@@ -938,7 +938,7 @@
case Expression::Kind::kBinary: {
BinaryExpression& binaryExpr = (*expr)->as<BinaryExpression>();
- this->visitExpression(&binaryExpr.leftPointer());
+ this->visitExpression(&binaryExpr.fLeft);
// Logical-and and logical-or binary expressions do not inline the right side,
// because that would invalidate short-circuiting. That is, when evaluating
@@ -948,11 +948,10 @@
// 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.
- Token::Kind op = binaryExpr.getOperator();
- bool shortCircuitable = (op == Token::Kind::TK_LOGICALAND ||
- op == Token::Kind::TK_LOGICALOR);
+ bool shortCircuitable = (binaryExpr.fOperator == Token::Kind::TK_LOGICALAND ||
+ binaryExpr.fOperator == Token::Kind::TK_LOGICALOR);
if (!shortCircuitable) {
- this->visitExpression(&binaryExpr.rightPointer());
+ this->visitExpression(&binaryExpr.fRight);
}
break;
}