resolver: Fix build. Enum member was renamed.
Change-Id: Iecbdd554ad60160df04be4bf3581387cb5639e6c Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/57420 Auto-Submit: Ben Clayton <bclayton@google.com> Reviewed-by: James Price <jrprice@google.com> Commit-Queue: Ben Clayton <bclayton@google.com> Kokoro: Ben Clayton <bclayton@google.com>
This commit is contained in:
parent
70a3fa1ee9
commit
08b0ab9b92
|
@ -1197,9 +1197,10 @@ bool Resolver::ValidateFunction(const ast::Function* func,
|
|||
(IsValidationEnabled(
|
||||
info->declaration->decorations(),
|
||||
ast::DisabledValidation::kEntryPointParameter) &&
|
||||
IsValidationEnabled(info->declaration->decorations(),
|
||||
IsValidationEnabled(
|
||||
info->declaration->decorations(),
|
||||
ast::DisabledValidation::
|
||||
kIgnoreAtomicFunctionParameter))) {
|
||||
kIgnoreConstructibleFunctionParameter))) {
|
||||
AddError("decoration is not valid for entry point return types",
|
||||
deco->source());
|
||||
return false;
|
||||
|
@ -1231,9 +1232,12 @@ bool Resolver::ValidateEntryPoint(const ast::Function* func,
|
|||
};
|
||||
|
||||
// Inner lambda that is applied to a type and all of its members.
|
||||
auto validate_entry_point_decorations_inner =
|
||||
[&](const ast::DecorationList& decos, sem::Type* ty, Source source,
|
||||
ParamOrRetType param_or_ret, bool is_struct_member) {
|
||||
auto validate_entry_point_decorations_inner = [&](const ast::DecorationList&
|
||||
decos,
|
||||
sem::Type* ty,
|
||||
Source source,
|
||||
ParamOrRetType param_or_ret,
|
||||
bool is_struct_member) {
|
||||
// Scan decorations for pipeline IO attributes.
|
||||
// Check for overlap with attributes that have been seen previously.
|
||||
ast::Decoration* pipeline_io_attribute = nullptr;
|
||||
|
@ -1241,16 +1245,14 @@ bool Resolver::ValidateEntryPoint(const ast::Function* func,
|
|||
if (auto* builtin = deco->As<ast::BuiltinDecoration>()) {
|
||||
if (pipeline_io_attribute) {
|
||||
AddError("multiple entry point IO attributes", deco->source());
|
||||
AddNote(
|
||||
"previously consumed " + deco_to_str(pipeline_io_attribute),
|
||||
AddNote("previously consumed " + deco_to_str(pipeline_io_attribute),
|
||||
pipeline_io_attribute->source());
|
||||
return false;
|
||||
}
|
||||
pipeline_io_attribute = deco;
|
||||
|
||||
if (builtins.count(builtin->value())) {
|
||||
AddError(
|
||||
deco_to_str(builtin) +
|
||||
AddError(deco_to_str(builtin) +
|
||||
" attribute appears multiple times as pipeline " +
|
||||
(param_or_ret == ParamOrRetType::kParameter ? "input"
|
||||
: "output"),
|
||||
|
@ -1259,25 +1261,23 @@ bool Resolver::ValidateEntryPoint(const ast::Function* func,
|
|||
}
|
||||
builtins.emplace(builtin->value());
|
||||
|
||||
if (!ValidateBuiltinDecoration(builtin, ty,
|
||||
/* is_input */ param_or_ret ==
|
||||
ParamOrRetType::kParameter)) {
|
||||
if (!ValidateBuiltinDecoration(
|
||||
builtin, ty,
|
||||
/* is_input */ param_or_ret == ParamOrRetType::kParameter)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
} else if (auto* location = deco->As<ast::LocationDecoration>()) {
|
||||
if (pipeline_io_attribute) {
|
||||
AddError("multiple entry point IO attributes", deco->source());
|
||||
AddNote(
|
||||
"previously consumed " + deco_to_str(pipeline_io_attribute),
|
||||
AddNote("previously consumed " + deco_to_str(pipeline_io_attribute),
|
||||
pipeline_io_attribute->source());
|
||||
return false;
|
||||
}
|
||||
pipeline_io_attribute = deco;
|
||||
|
||||
if (locations.count(location->value())) {
|
||||
AddError(
|
||||
deco_to_str(location) +
|
||||
AddError(deco_to_str(location) +
|
||||
" attribute appears multiple times as pipeline " +
|
||||
(param_or_ret == ParamOrRetType::kParameter ? "input"
|
||||
: "output"),
|
||||
|
@ -1291,8 +1291,7 @@ bool Resolver::ValidateEntryPoint(const ast::Function* func,
|
|||
// Check that we saw a pipeline IO attribute iff we need one.
|
||||
if (ty->Is<sem::Struct>()) {
|
||||
if (pipeline_io_attribute) {
|
||||
AddError(
|
||||
"entry point IO attributes must not be used on structure " +
|
||||
AddError("entry point IO attributes must not be used on structure " +
|
||||
std::string(param_or_ret == ParamOrRetType::kParameter
|
||||
? "parameters"
|
||||
: "return types"),
|
||||
|
@ -1304,8 +1303,8 @@ bool Resolver::ValidateEntryPoint(const ast::Function* func,
|
|||
if (!pipeline_io_attribute) {
|
||||
std::string err = "missing entry point IO attribute";
|
||||
if (!is_struct_member) {
|
||||
err += (param_or_ret == ParamOrRetType::kParameter
|
||||
? " on parameter"
|
||||
err +=
|
||||
(param_or_ret == ParamOrRetType::kParameter ? " on parameter"
|
||||
: " on return type");
|
||||
}
|
||||
AddError(err, source);
|
||||
|
|
Loading…
Reference in New Issue