mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-21 02:39:11 +00:00
tint/ast: Make DiagnosticControl a plain struct
Introduce DiagnosticDirective, which contains a DiagnosticControl struct (as does DiagnosticAttribute). Bug: tint:1809 Change-Id: I204001266ee472d2ee2827614a306acad53f12ba Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/118060 Reviewed-by: Ben Clayton <bclayton@google.com> Commit-Queue: James Price <jrprice@google.com> Kokoro: Kokoro <noreply+kokoro@google.com>
This commit is contained in:
committed by
Dawn LUCI CQ
parent
ededebbcf3
commit
98dc5a86cc
@@ -1311,8 +1311,11 @@ Transform::ApplyResult Renamer::Apply(const Program* src,
|
||||
});
|
||||
}
|
||||
},
|
||||
[&](const ast::DiagnosticControl* diagnostic) {
|
||||
preserved_identifiers.Add(diagnostic->rule_name);
|
||||
[&](const ast::DiagnosticAttribute* diagnostic) {
|
||||
preserved_identifiers.Add(diagnostic->control.rule_name);
|
||||
},
|
||||
[&](const ast::DiagnosticDirective* diagnostic) {
|
||||
preserved_identifiers.Add(diagnostic->control.rule_name);
|
||||
},
|
||||
[&](const ast::TypeName* type_name) {
|
||||
if (is_type_short_name(type_name->name->symbol)) {
|
||||
|
||||
@@ -114,7 +114,9 @@ Transform::ApplyResult SingleEntryPoint::Apply(const Program* src,
|
||||
}
|
||||
},
|
||||
[&](const ast::Enable* ext) { b.AST().AddEnable(ctx.Clone(ext)); },
|
||||
[&](const ast::DiagnosticControl* dc) { b.AST().AddDiagnosticControl(ctx.Clone(dc)); },
|
||||
[&](const ast::DiagnosticDirective* d) {
|
||||
b.AST().AddDiagnosticDirective(ctx.Clone(d));
|
||||
},
|
||||
[&](Default) {
|
||||
TINT_UNREACHABLE(Transform, b.Diagnostics())
|
||||
<< "unhandled global declaration: " << decl->TypeInfo().name;
|
||||
|
||||
Reference in New Issue
Block a user