aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sksl/ir/SkSLVariableReference.h
diff options
context:
space:
mode:
authorGravatar Ethan Nicholas <ethannicholas@google.com>2017-02-06 18:53:07 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-02-06 19:25:13 +0000
commite1d9cb82bf9004eb05831f34bb3e9e708ae0617f (patch)
tree51bab2d2dbd178e95d4906e06fd294254a33106e /src/sksl/ir/SkSLVariableReference.h
parenta84898dbb8d8f7cb8c3e9bdfb4c31d85dff1922f (diff)
Revert "Added dead variable / code elimination to skslc."
This reverts commit 113628d76176a1ab3e6719c59efff23cd10ab213. Reason for revert: Looks to have caused https://bugs.chromium.org/p/chromium/issues/detail?id=688939 Original change's description: > Added dead variable / code elimination to skslc. > > BUG=skia: > > Change-Id: Ib037730803a8f222f099de0e001fe06ad452a22c > Reviewed-on: https://skia-review.googlesource.com/7584 > Commit-Queue: Ethan Nicholas <ethannicholas@google.com> > Reviewed-by: Ben Wagner <benjaminwagner@google.com> > TBR=egdaniel@google.com,benjaminwagner@google.com,ethannicholas@google.com,reviews@skia.org # Not skipping CQ checks because original CL landed > 1 day ago. BUG=skia: Change-Id: I85599e4ca2bc6bfd782edc163f67b64195d6ae65 Reviewed-on: https://skia-review.googlesource.com/8077 Commit-Queue: Ethan Nicholas <ethannicholas@google.com> Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Diffstat (limited to 'src/sksl/ir/SkSLVariableReference.h')
-rw-r--r--src/sksl/ir/SkSLVariableReference.h22
1 files changed, 6 insertions, 16 deletions
diff --git a/src/sksl/ir/SkSLVariableReference.h b/src/sksl/ir/SkSLVariableReference.h
index 75b7f3dcd4..fecb04e2e5 100644
--- a/src/sksl/ir/SkSLVariableReference.h
+++ b/src/sksl/ir/SkSLVariableReference.h
@@ -38,7 +38,7 @@ struct VariableReference : public Expression {
}
}
- ~VariableReference() override {
+ virtual ~VariableReference() override {
if (fRefKind != kWrite_RefKind) {
fVariable.fReadCount--;
}
@@ -64,19 +64,13 @@ struct VariableReference : public Expression {
fRefKind = refKind;
}
- bool hasSideEffects() const override {
- return false;
- }
-
SkString description() const override {
return fVariable.fName;
}
- std::unique_ptr<Expression> constantPropagate(const IRGenerator& irGenerator,
- const DefinitionMap& definitions) override {
- if (fRefKind != kRead_RefKind) {
- return nullptr;
- }
+ virtual std::unique_ptr<Expression> constantPropagate(
+ const IRGenerator& irGenerator,
+ const DefinitionMap& definitions) override {
auto exprIter = definitions.find(&fVariable);
if (exprIter != definitions.end() && exprIter->second) {
const Expression* expr = exprIter->second->get();
@@ -91,11 +85,6 @@ struct VariableReference : public Expression {
irGenerator.fContext,
Position(),
((FloatLiteral*) expr)->fValue));
- case Expression::kBoolLiteral_Kind:
- return std::unique_ptr<Expression>(new BoolLiteral(
- irGenerator.fContext,
- Position(),
- ((BoolLiteral*) expr)->fValue));
default:
break;
}
@@ -104,9 +93,10 @@ struct VariableReference : public Expression {
}
const Variable& fVariable;
- RefKind fRefKind;
private:
+ RefKind fRefKind;
+
typedef Expression INHERITED;
};