Condense namespaces in tint/diagnostic.

This PR condenses the namespaces in the tint/diagnostic folder.

Change-Id: Id1b2afca99a8f6aeccb505682aa0f0b4b0b4bb05
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86037
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
This commit is contained in:
dan sinclair 2022-04-07 17:22:26 +00:00 committed by Dawn LUCI CQ
parent fe4bfd45fe
commit 7bc9ba13bd
12 changed files with 24 additions and 48 deletions

View File

@ -18,8 +18,7 @@
#include "src/tint/diagnostic/formatter.h" #include "src/tint/diagnostic/formatter.h"
namespace tint { namespace tint::diag {
namespace diag {
Diagnostic::Diagnostic() = default; Diagnostic::Diagnostic() = default;
Diagnostic::Diagnostic(const Diagnostic&) = default; Diagnostic::Diagnostic(const Diagnostic&) = default;
@ -44,5 +43,4 @@ std::string List::str() const {
return Formatter{style}.format(*this); return Formatter{style}.format(*this);
} }
} // namespace diag } // namespace tint::diag
} // namespace tint

View File

@ -22,8 +22,7 @@
#include "src/tint/source.h" #include "src/tint/source.h"
namespace tint { namespace tint::diag {
namespace diag {
/// Severity is an enumerator of diagnostic severities. /// Severity is an enumerator of diagnostic severities.
enum class Severity { Note, Warning, Error, InternalCompilerError, Fatal }; enum class Severity { Note, Warning, Error, InternalCompilerError, Fatal };
@ -246,7 +245,6 @@ class List {
size_t error_count_ = 0; size_t error_count_ = 0;
}; };
} // namespace diag } // namespace tint::diag
} // namespace tint
#endif // SRC_TINT_DIAGNOSTIC_DIAGNOSTIC_H_ #endif // SRC_TINT_DIAGNOSTIC_DIAGNOSTIC_H_

View File

@ -17,8 +17,7 @@
#include "gtest/gtest.h" #include "gtest/gtest.h"
#include "src/tint/diagnostic/diagnostic.h" #include "src/tint/diagnostic/diagnostic.h"
namespace tint { namespace tint::diag {
namespace diag {
namespace { namespace {
TEST(DiagListTest, OwnedFilesShared) { TEST(DiagListTest, OwnedFilesShared) {
@ -38,5 +37,4 @@ TEST(DiagListTest, OwnedFilesShared) {
} }
} // namespace } // namespace
} // namespace diag } // namespace tint::diag
} // namespace tint

View File

@ -21,8 +21,7 @@
#include "src/tint/diagnostic/diagnostic.h" #include "src/tint/diagnostic/diagnostic.h"
#include "src/tint/diagnostic/printer.h" #include "src/tint/diagnostic/printer.h"
namespace tint { namespace tint::diag {
namespace diag {
namespace { namespace {
const char* to_str(Severity severity) { const char* to_str(Severity severity) {
@ -267,5 +266,4 @@ std::string Formatter::format(const List& list) const {
Formatter::~Formatter() = default; Formatter::~Formatter() = default;
} // namespace diag } // namespace tint::diag
} // namespace tint

View File

@ -17,8 +17,7 @@
#include <string> #include <string>
namespace tint { namespace tint::diag {
namespace diag {
class Diagnostic; class Diagnostic;
class List; class List;
@ -66,7 +65,6 @@ class Formatter {
const Style style_; const Style style_;
}; };
} // namespace diag } // namespace tint::diag
} // namespace tint
#endif // SRC_TINT_DIAGNOSTIC_FORMATTER_H_ #endif // SRC_TINT_DIAGNOSTIC_FORMATTER_H_

View File

@ -19,8 +19,7 @@
#include "gtest/gtest.h" #include "gtest/gtest.h"
#include "src/tint/diagnostic/diagnostic.h" #include "src/tint/diagnostic/diagnostic.h"
namespace tint { namespace tint::diag {
namespace diag {
namespace { namespace {
Diagnostic Diag(Severity severity, Diagnostic Diag(Severity severity,
@ -306,5 +305,4 @@ TEST_F(DiagFormatterTest, RangeOOB) {
} }
} // namespace } // namespace
} // namespace diag } // namespace tint::diag
} // namespace tint

View File

@ -14,8 +14,7 @@
#include "src/tint/diagnostic/printer.h" #include "src/tint/diagnostic/printer.h"
namespace tint { namespace tint::diag {
namespace diag {
Printer::~Printer() = default; Printer::~Printer() = default;
@ -30,5 +29,4 @@ void StringPrinter::write(const std::string& str, const Style&) {
stream << str; stream << str;
} }
} // namespace diag } // namespace tint::diag
} // namespace tint

View File

@ -19,8 +19,7 @@
#include <sstream> #include <sstream>
#include <string> #include <string>
namespace tint { namespace tint::diag {
namespace diag {
class List; class List;
@ -77,7 +76,6 @@ class StringPrinter : public Printer {
std::stringstream stream; std::stringstream stream;
}; };
} // namespace diag } // namespace tint::diag
} // namespace tint
#endif // SRC_TINT_DIAGNOSTIC_PRINTER_H_ #endif // SRC_TINT_DIAGNOSTIC_PRINTER_H_

View File

@ -18,8 +18,7 @@
#include "src/tint/diagnostic/printer.h" #include "src/tint/diagnostic/printer.h"
namespace tint { namespace tint::diag {
namespace diag {
namespace { namespace {
bool supports_colors(FILE* f) { bool supports_colors(FILE* f) {
@ -96,5 +95,4 @@ std::unique_ptr<Printer> Printer::create(FILE* out, bool use_colors) {
return std::make_unique<PrinterLinux>(out, use_colors); return std::make_unique<PrinterLinux>(out, use_colors);
} }
} // namespace diag } // namespace tint::diag
} // namespace tint

View File

@ -16,8 +16,7 @@
#include "src/tint/diagnostic/printer.h" #include "src/tint/diagnostic/printer.h"
namespace tint { namespace tint::diag {
namespace diag {
namespace { namespace {
class PrinterOther : public Printer { class PrinterOther : public Printer {
@ -38,5 +37,4 @@ std::unique_ptr<Printer> Printer::create(FILE* out, bool) {
return std::make_unique<PrinterOther>(out); return std::make_unique<PrinterOther>(out);
} }
} // namespace diag } // namespace tint::diag
} // namespace tint

View File

@ -16,8 +16,7 @@
#include "gtest/gtest.h" #include "gtest/gtest.h"
namespace tint { namespace tint::diag {
namespace diag {
namespace { namespace {
// Actually verifying that the expected colors are printed is exceptionally // Actually verifying that the expected colors are printed is exceptionally
@ -94,5 +93,4 @@ TEST_F(PrinterTest, BoldWithoutColors) {
#endif // ENABLE_PRINTER_TESTS #endif // ENABLE_PRINTER_TESTS
} // namespace } // namespace
} // namespace diag } // namespace tint::diag
} // namespace tint

View File

@ -19,8 +19,7 @@
#define WIN32_LEAN_AND_MEAN 1 #define WIN32_LEAN_AND_MEAN 1
#include <Windows.h> #include <Windows.h>
namespace tint { namespace tint::diag {
namespace diag {
namespace { namespace {
struct ConsoleInfo { struct ConsoleInfo {
@ -109,5 +108,4 @@ std::unique_ptr<Printer> Printer::create(FILE* out, bool use_colors) {
return std::make_unique<PrinterWindows>(out, use_colors); return std::make_unique<PrinterWindows>(out, use_colors);
} }
} // namespace diag } // namespace tint::diag
} // namespace tint