std::unique_ptr<Expression> ConstructorArrayCast::Make(const Context& context,
Position pos, const Type& type,
std::unique_ptr<Expression> arg) { // Only arrays of the same size are allowed.
SkASSERT(type.isArray());
SkASSERT(type.isAllowedInES2(context));
SkASSERT(arg->type().isArray());
SkASSERT(type.columns() == arg->type().columns());
// If this is a no-op cast, return the expression as-is. if (type.matches(arg->type())) {
arg->fPosition = pos; return arg;
}
// Look up the value of constant variables. This allows constant-expressions like `myArray` to // be replaced with the compile-time constant `int[2](0, 1)`.
arg = ConstantFolder::MakeConstantValueForVariable(pos, std::move(arg));
// We can cast a vector of compile-time constants at compile-time. if (Analysis::IsCompileTimeConstant(*arg)) { return cast_constant_array(context, pos, type, std::move(arg));
} return std::make_unique<ConstructorArrayCast>(pos, type, std::move(arg));
}
} // namespace SkSL
Messung V0.5
¤ Dauer der Verarbeitung: 0.36 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.