Moved SkSL type into IRNode, now accessed via a method
This change doesn't accomplish anything by itself, but is a necessary
prerequisite for followup changes to node handling. Eventually all data
is going to be stored within IRNode itself, and the subclasses will not
add any fields; this is just the first step in that process.
Change-Id: If2bea4c62bd8f680e9d9f39248bb9679332b245b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/315867
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: Ethan Nicholas <ethannicholas@google.com>
diff --git a/src/sksl/ir/SkSLVariableReference.cpp b/src/sksl/ir/SkSLVariableReference.cpp
index 7bbff25..d1544ac 100644
--- a/src/sksl/ir/SkSLVariableReference.cpp
+++ b/src/sksl/ir/SkSLVariableReference.cpp
@@ -15,7 +15,7 @@
namespace SkSL {
VariableReference::VariableReference(int offset, const Variable& variable, RefKind refKind)
-: INHERITED(offset, kExpressionKind, variable.fType)
+: INHERITED(offset, kExpressionKind, &variable.type())
, fVariable(variable)
, fRefKind(refKind) {
if (refKind != kRead_RefKind) {
@@ -74,7 +74,7 @@
for (const auto& arg : c->fArguments) {
args.push_back(copy_constant(irGenerator, arg.get()));
}
- return std::unique_ptr<Expression>(new Constructor(-1, c->fType,
+ return std::unique_ptr<Expression>(new Constructor(-1, &c->type(),
std::move(args)));
}
case Expression::Kind::kSetting: {
@@ -95,7 +95,7 @@
}
if ((fVariable.fModifiers.fFlags & Modifiers::kConst_Flag) && fVariable.fInitialValue &&
fVariable.fInitialValue->isCompileTimeConstant() &&
- fType.typeKind() != Type::TypeKind::kArray) {
+ this->type().typeKind() != Type::TypeKind::kArray) {
return copy_constant(irGenerator, fVariable.fInitialValue);
}
auto exprIter = definitions.find(&fVariable);