aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sksl/ir/SkSLFunctionCall.h
diff options
context:
space:
mode:
authorGravatar Ethan Nicholas <ethannicholas@google.com>2017-04-20 19:31:52 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-04-20 23:57:21 +0000
commitcb67096b61f699b047fe8635984db1ac708a7b99 (patch)
tree3a8bda0962ad77d0d9ccb1d89c15f70578a7fe78 /src/sksl/ir/SkSLFunctionCall.h
parente79b473714866682dea85b66c005c5bb2ff6a397 (diff)
Improved skslc optimizer, particularly around vectors.
BUG=skia: Change-Id: Idb364d9198f2ff84aad1eb68e236fb45ec1c86b7 Reviewed-on: https://skia-review.googlesource.com/8000 Commit-Queue: Ethan Nicholas <ethannicholas@google.com> Reviewed-by: Ben Wagner <benjaminwagner@google.com>
Diffstat (limited to 'src/sksl/ir/SkSLFunctionCall.h')
-rw-r--r--src/sksl/ir/SkSLFunctionCall.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/sksl/ir/SkSLFunctionCall.h b/src/sksl/ir/SkSLFunctionCall.h
index 1a5c6fd693..44f8c7ed5a 100644
--- a/src/sksl/ir/SkSLFunctionCall.h
+++ b/src/sksl/ir/SkSLFunctionCall.h
@@ -23,6 +23,15 @@ struct FunctionCall : public Expression {
, fFunction(std::move(function))
, fArguments(std::move(arguments)) {}
+ bool hasSideEffects() const override {
+ for (const auto& arg : fArguments) {
+ if (arg->hasSideEffects()) {
+ return true;
+ }
+ }
+ return fFunction.fModifiers.fFlags & Modifiers::kHasSideEffects_Flag;
+ }
+
String description() const override {
String result = fFunction.fName + "(";
String separator;