tint/transform: Move State to anonymous namespace

Copy/pasting this transform as a starting point for new transforms
causes the `State` classes to clash, and weird things happen. This
prevents that from happening.

Change-Id: Ia1c6b2b96e4d6375309aed535d7a87372b839792
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93880
Reviewed-by: Ben Clayton <bclayton@google.com>
Auto-Submit: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
This commit is contained in:
James Price 2022-06-16 08:28:22 +00:00 committed by Dawn LUCI CQ
parent 4a63612cd2
commit 33563dc7d7
1 changed files with 4 additions and 0 deletions

View File

@ -44,6 +44,8 @@ bool ExpandCompoundAssignment::ShouldRun(const Program* program, const DataMap&)
return false;
}
namespace {
/// Internal class used to collect statement expansions during the transform.
class State {
private:
@ -163,6 +165,8 @@ class State {
}
};
} // namespace
void ExpandCompoundAssignment::Run(CloneContext& ctx, const DataMap&, DataMap&) const {
State state(ctx);
for (auto* node : ctx.src->ASTNodes().Objects()) {