From b696607338753081b2f8a200ebc8bb1fc317dd38 Mon Sep 17 00:00:00 2001 From: Ben Clayton Date: Mon, 19 Apr 2021 14:12:29 +0000 Subject: [PATCH] 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 Reviewed-by: James Price Commit-Queue: Ben Clayton --- src/writer/msl/generator_impl.cc | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/src/writer/msl/generator_impl.cc b/src/writer/msl/generator_impl.cc index 74e05e434d..b50c263c87 100644 --- a/src/writer/msl/generator_impl.cc +++ b/src/writer/msl/generator_impl.cc @@ -96,11 +96,22 @@ bool GeneratorImpl::Generate() { } for (auto* var : program_->AST().GlobalVariables()) { - if (!var->is_const()) { - continue; - } - if (!EmitProgramConstVariable(var)) { - return false; + 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 + } } }