aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sksl/ir/SkSLExpression.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/sksl/ir/SkSLExpression.h')
-rw-r--r--src/sksl/ir/SkSLExpression.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/sksl/ir/SkSLExpression.h b/src/sksl/ir/SkSLExpression.h
index f87d810fc0..5db9ddf96f 100644
--- a/src/sksl/ir/SkSLExpression.h
+++ b/src/sksl/ir/SkSLExpression.h
@@ -53,6 +53,13 @@ struct Expression : public IRNode {
}
/**
+ * Returns true if evaluating the expression potentially has side effects. Expressions may never
+ * return false if they actually have side effects, but it is legal (though suboptimal) to
+ * return true if there are not actually any side effects.
+ */
+ virtual bool hasSideEffects() const = 0;
+
+ /**
* Given a map of known constant variable values, substitute them in for references to those
* variables occurring in this expression and its subexpressions. Similar simplifications, such
* as folding a constant binary expression down to a single value, may also be performed.