From 33563dc7d7b3cbec159e004f96b59fd479084635 Mon Sep 17 00:00:00 2001 From: James Price Date: Thu, 16 Jun 2022 08:28:22 +0000 Subject: [PATCH] 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 Auto-Submit: James Price Kokoro: Kokoro Commit-Queue: Ben Clayton --- src/tint/transform/expand_compound_assignment.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/tint/transform/expand_compound_assignment.cc b/src/tint/transform/expand_compound_assignment.cc index 2f775ca119..d15d790dab 100644 --- a/src/tint/transform/expand_compound_assignment.cc +++ b/src/tint/transform/expand_compound_assignment.cc @@ -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()) {