Add Make factory method to VariableReference.
There aren't any optimization opportunities here, but it was the only
expression/statement type left without a Make or Convert factory.
Change-Id: I4c413a3b2619261f9e974528fa45211383e56fa7
Bug: skia:11342
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/402017
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
diff --git a/src/sksl/SkSLInliner.cpp b/src/sksl/SkSLInliner.cpp
index 0d265c1..ae92cc6 100644
--- a/src/sksl/SkSLInliner.cpp
+++ b/src/sksl/SkSLInliner.cpp
@@ -550,7 +550,7 @@
variable.type().clone(symbolTableForStatement),
isBuiltinCode,
variable.storage());
- (*varMap)[&variable] = std::make_unique<VariableReference>(offset, clonedVar.get());
+ (*varMap)[&variable] = VariableReference::Make(offset, clonedVar.get());
auto result = VarDeclaration::Make(*fContext,
clonedVar.get(),
decl.baseType().clone(symbolTableForStatement),
@@ -646,7 +646,7 @@
symbolTable.get(), Modifiers{},
caller->isBuiltin(), &noInitialValue);
inlineStatements.push_back(std::move(var.fVarDecl));
- resultExpr = std::make_unique<VariableReference>(/*offset=*/-1, var.fVarSymbol);
+ resultExpr = VariableReference::Make(/*offset=*/-1, var.fVarSymbol);
}
// Create variables in the extra statements to hold the arguments, and assign the arguments to
@@ -670,7 +670,7 @@
symbolTable.get(), param->modifiers(),
caller->isBuiltin(), &arguments[i]);
inlineStatements.push_back(std::move(var.fVarDecl));
- varMap[param] = std::make_unique<VariableReference>(/*offset=*/-1, var.fVarSymbol);
+ varMap[param] = VariableReference::Make(/*offset=*/-1, var.fVarSymbol);
}
for (const std::unique_ptr<Statement>& stmt : body.children()) {