From 8155b9dada070a01b8a2f97b6e07782beaa7a1fc Mon Sep 17 00:00:00 2001 From: dan sinclair Date: Thu, 7 Apr 2022 19:10:25 +0000 Subject: [PATCH] Condense namespaces in tint/. This PR condenses the namespaces in the tint/ folder. Change-Id: Ia8d712f8c356b2714ebfa36443a4d78750293ce6 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86039 Reviewed-by: Ben Clayton Auto-Submit: Dan Sinclair Commit-Queue: Dan Sinclair --- src/tint/clone_context.h | 12 +++++++----- src/tint/program.h | 11 +++++------ src/tint/program_builder.h | 6 ++---- src/tint/traits_test.cc | 6 ++---- 4 files changed, 16 insertions(+), 19 deletions(-) diff --git a/src/tint/clone_context.h b/src/tint/clone_context.h index 8c02c8313c..0c52f3b8c6 100644 --- a/src/tint/clone_context.h +++ b/src/tint/clone_context.h @@ -28,16 +28,18 @@ #include "src/tint/symbol.h" #include "src/tint/traits.h" +// Forward declarations +namespace tint::ast { +class FunctionList; +class Node; +} // namespace tint::ast + namespace tint { -// Forward declarations +// Forward Declarations class CloneContext; class Program; class ProgramBuilder; -namespace ast { -class FunctionList; -class Node; -} // namespace ast ProgramID ProgramIDOf(const Program*); ProgramID ProgramIDOf(const ProgramBuilder*); diff --git a/src/tint/program.h b/src/tint/program.h index 23e0945b99..cb3c98808e 100644 --- a/src/tint/program.h +++ b/src/tint/program.h @@ -24,17 +24,16 @@ #include "src/tint/sem/type_manager.h" #include "src/tint/symbol_table.h" +// Forward Declarations +namespace tint::ast { +class Module; +} // namespace tint::ast + namespace tint { // Forward declarations class CloneContext; -namespace ast { - -class Module; - -} // namespace ast - /// Program holds the AST, Type information and SymbolTable for a tint program. class Program { public: diff --git a/src/tint/program_builder.h b/src/tint/program_builder.h index 8365ad9e7c..13e7a05d2e 100644 --- a/src/tint/program_builder.h +++ b/src/tint/program_builder.h @@ -99,11 +99,9 @@ #endif // Forward declarations -namespace tint { -namespace ast { +namespace tint::ast { class VariableDeclStatement; -} // namespace ast -} // namespace tint +} // namespace tint::ast namespace tint { class CloneContext; diff --git a/src/tint/traits_test.cc b/src/tint/traits_test.cc index afe3475ed0..6af0bd478c 100644 --- a/src/tint/traits_test.cc +++ b/src/tint/traits_test.cc @@ -16,8 +16,7 @@ #include "gtest/gtest.h" -namespace tint { -namespace traits { +namespace tint::traits { namespace { struct S {}; @@ -231,5 +230,4 @@ TEST(SliceTuple, MixedTupleSliceHighPart) { static_assert(std::is_same_v, float>); } -} // namespace traits -} // namespace tint +} // namespace tint::traits