blob: bfcd07769d93fb5e460b03336a064a9a218b681c [file] [log] [blame]
/*
* Copyright 2018 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "src/sksl/ir/SkSLVariableReference.h"
#include "src/sksl/ir/SkSLVariable.h"
namespace SkSL {
VariableReference::VariableReference(Position pos, const Variable* variable, RefKind refKind)
: INHERITED(pos, kExpressionKind, &variable->type())
, fVariable(variable)
, fRefKind(refKind) {
SkASSERT(this->variable());
}
std::string VariableReference::description() const {
return std::string(this->variable()->name());
}
void VariableReference::setRefKind(RefKind refKind) {
fRefKind = refKind;
}
void VariableReference::setVariable(const Variable* variable) {
fVariable = variable;
}
} // namespace SkSL