1/*
2 * Copyright 2017 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#include "src/sksl/SkSLIRGenerator.h"
9#include "src/sksl/ir/SkSLSetting.h"
10#include "src/sksl/ir/SkSLVariableReference.h"
11
12namespace SkSL {
13
14std::unique_ptr<Expression> Setting::constantPropagate(const IRGenerator& irGenerator,
15 const DefinitionMap& definitions) {
16 if (irGenerator.fSettings->fReplaceSettings) {
17 return VariableReference::copy_constant(irGenerator, fValue.get());
18 }
19 return nullptr;
20}
21
22} // namespace
23