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"
namespace tint {
namespace diag {
namespace tint::diag {
Diagnostic::Diagnostic() = default;
Diagnostic::Diagnostic(const Diagnostic&) = default;
@ -44,5 +43,4 @@ std::string List::str() const {
return Formatter{style}.format(*this);
}
} // namespace diag
} // namespace tint
} // namespace tint::diag

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -18,8 +18,7 @@
#include "src/tint/diagnostic/printer.h"
namespace tint {
namespace diag {
namespace tint::diag {
namespace {
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);
}
} // namespace diag
} // namespace tint
} // namespace tint::diag

View File

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

View File

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

View File

@ -19,8 +19,7 @@
#define WIN32_LEAN_AND_MEAN 1
#include <Windows.h>
namespace tint {
namespace diag {
namespace tint::diag {
namespace {
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);
}
} // namespace diag
} // namespace tint
} // namespace tint::diag