writer/msl: Add TINT_UNIMPLEMENTED() for module-scope vars

Module scope variables of the private and workgroup storage class are
not currently implemeted.

Change-Id: Ibb73faec5b5bcb11199e07ba4d7aa4df9c875450
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/48221
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: James Price <jrprice@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
This commit is contained in:
Ben Clayton 2021-04-19 14:12:29 +00:00 committed by Commit Bot service account
parent 4649377d05
commit b696607338
1 changed files with 16 additions and 5 deletions

View File

@ -96,12 +96,23 @@ bool GeneratorImpl::Generate() {
}
for (auto* var : program_->AST().GlobalVariables()) {
if (!var->is_const()) {
continue;
}
if (var->is_const()) {
if (!EmitProgramConstVariable(var)) {
return false;
}
} else {
auto* sem = program_->Sem().Get(var);
switch (sem->StorageClass()) {
case ast::StorageClass::kPrivate:
case ast::StorageClass::kWorkgroup:
TINT_UNIMPLEMENTED(diagnostics_)
<< "crbug.com/tint/726: module-scope private and workgroup "
"variables not yet implemented";
break;
default:
break; // Handled by another code path
}
}
}
// Make sure all entry point data is emitted before the entry point functions