mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-06-05 22:23:29 +00:00
tint/resolver: Remove logic for module-scope let
This has been replaced with module-scope const. Change-Id: I03d5e076cf150d2931c9cfb1c6025e98200d91a1 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/95947 Reviewed-by: Antonio Maiorano <amaiorano@google.com> Kokoro: Kokoro <noreply+kokoro@google.com> Commit-Queue: Ben Clayton <bclayton@google.com>
This commit is contained in:
parent
e52cc0419e
commit
32bdf41ed3
@ -585,14 +585,6 @@ bool Validator::GlobalVariable(
|
|||||||
|
|
||||||
return Var(global);
|
return Var(global);
|
||||||
},
|
},
|
||||||
[&](const ast::Let*) {
|
|
||||||
if (!decl->attributes.empty()) {
|
|
||||||
AddError("attribute is not valid for module-scope 'let' declaration",
|
|
||||||
decl->attributes[0]->source);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return Let(global);
|
|
||||||
},
|
|
||||||
[&](const ast::Override*) {
|
[&](const ast::Override*) {
|
||||||
for (auto* attr : decl->attributes) {
|
for (auto* attr : decl->attributes) {
|
||||||
if (auto* id_attr = attr->As<ast::IdAttribute>()) {
|
if (auto* id_attr = attr->As<ast::IdAttribute>()) {
|
||||||
@ -777,15 +769,6 @@ bool Validator::Let(const sem::Variable* v) const {
|
|||||||
auto* decl = v->Declaration();
|
auto* decl = v->Declaration();
|
||||||
auto* storage_ty = v->Type()->UnwrapRef();
|
auto* storage_ty = v->Type()->UnwrapRef();
|
||||||
|
|
||||||
if (v->Is<sem::GlobalVariable>()) {
|
|
||||||
auto name = symbols_.NameFor(decl->symbol);
|
|
||||||
if (sem::ParseBuiltinType(name) != sem::BuiltinType::kNone) {
|
|
||||||
AddError("'" + name + "' is a builtin and cannot be redeclared as a 'let'",
|
|
||||||
decl->source);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!(storage_ty->IsConstructible() || storage_ty->Is<sem::Pointer>())) {
|
if (!(storage_ty->IsConstructible() || storage_ty->Is<sem::Pointer>())) {
|
||||||
AddError(sem_.TypeNameOf(storage_ty) + " cannot be used as the type of a 'let'",
|
AddError(sem_.TypeNameOf(storage_ty) + " cannot be used as the type of a 'let'",
|
||||||
decl->source);
|
decl->source);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user