Remove IRGenerator::coerce.
This was replaced by Type::coerceExpression. This CL removes the last
two call sites to reference the old `coerce` method.
Change-Id: I636501a6eb6991463e1975ac38169dee058cdf6f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/451738
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
diff --git a/src/sksl/SkSLIRGenerator.cpp b/src/sksl/SkSLIRGenerator.cpp
index 41383e1..56153fb 100644
--- a/src/sksl/SkSLIRGenerator.cpp
+++ b/src/sksl/SkSLIRGenerator.cpp
@@ -936,11 +936,6 @@
return this->convertIdentifier(identifier.fOffset, identifier.getStringView());
}
-std::unique_ptr<Expression> IRGenerator::coerce(std::unique_ptr<Expression> expr,
- const Type& type) {
- return type.coerceExpression(std::move(expr), fContext);
-}
-
std::unique_ptr<Expression> IRGenerator::convertBinaryExpression(const ASTNode& expression) {
SkASSERT(expression.fKind == ASTNode::Kind::kBinary);
auto iter = expression.begin();
@@ -1085,7 +1080,7 @@
const Type* types[PARAMETER_MAX];
f.getCallParameterTypes(types);
for (int i = 0; i < count; ++i) {
- arguments[i] = this->coerce(std::move(arguments[i]), *types[i]);
+ arguments[i] = types[i]->coerceExpression(std::move(arguments[i]), fContext);
if (!arguments[i]) {
return nullptr;
}
diff --git a/src/sksl/SkSLIRGenerator.h b/src/sksl/SkSLIRGenerator.h
index 53fa542..35458ae 100644
--- a/src/sksl/SkSLIRGenerator.h
+++ b/src/sksl/SkSLIRGenerator.h
@@ -190,7 +190,6 @@
const FunctionDeclaration* findBestFunctionForCall(
const std::vector<const FunctionDeclaration*>& functions,
const ExpressionArray& arguments) const;
- std::unique_ptr<Expression> coerce(std::unique_ptr<Expression> expr, const Type& type);
CoercionCost coercionCost(const Expression& expr, const Type& type);
int convertArraySize(const Type& type, int offset, const ASTNode& s);
bool containsConstantZero(Expression& expr);
diff --git a/src/sksl/dsl/priv/DSLWriter.cpp b/src/sksl/dsl/priv/DSLWriter.cpp
index 20de211..39cc29a 100644
--- a/src/sksl/dsl/priv/DSLWriter.cpp
+++ b/src/sksl/dsl/priv/DSLWriter.cpp
@@ -164,7 +164,7 @@
}
DSLPossibleExpression DSLWriter::Coerce(std::unique_ptr<Expression> expr, const SkSL::Type& type) {
- return IRGenerator().coerce(std::move(expr), type);
+ return type.coerceExpression(std::move(expr), Context());
}
DSLPossibleExpression DSLWriter::Construct(const SkSL::Type& type, SkSpan<DSLExpression> rawArgs) {