Condense namespaces in tint/writer.

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

Change-Id: I66b28d6e70b99834dc6a25fee4c71e3036e0864a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86026
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
This commit is contained in:
dan sinclair 2022-04-07 14:43:05 +00:00 committed by Dawn LUCI CQ
parent c05f045df4
commit 67e79fe506
15 changed files with 33 additions and 64 deletions

View File

@ -23,9 +23,7 @@
#include "src/tint/sem/type_conversion.h"
#include "src/tint/utils/transform.h"
namespace tint {
namespace writer {
namespace tint::writer {
namespace {
struct VectorConstructorInfo {
@ -172,5 +170,4 @@ const sem::Call* AppendVector(ProgramBuilder* b,
return constructor_sem;
}
} // namespace writer
} // namespace tint
} // namespace tint::writer

View File

@ -17,14 +17,13 @@
#include "src/tint/program_builder.h"
namespace tint {
namespace ast {
// Forward Declarations
namespace tint::ast {
class CallExpression;
class Expression;
} // namespace ast
} // namespace tint::ast
namespace writer {
namespace tint::writer {
/// A helper function used to append a vector with an additional scalar.
/// If the scalar's type does not match the target vector element type,
@ -40,7 +39,6 @@ const sem::Call* AppendVector(ProgramBuilder* builder,
const ast::Expression* vector,
const ast::Expression* scalar);
} // namespace writer
} // namespace tint
} // namespace tint::writer
#endif // SRC_TINT_WRITER_APPEND_VECTOR_H_

View File

@ -19,8 +19,7 @@
#include "gtest/gtest.h"
namespace tint {
namespace writer {
namespace tint::writer {
namespace {
class AppendVectorTest : public ::testing::Test, public ProgramBuilder {};
@ -484,5 +483,4 @@ TEST_F(AppendVectorTest, ZeroVec3i32_i32) {
}
} // namespace
} // namespace writer
} // namespace tint
} // namespace tint::writer

View File

@ -14,8 +14,7 @@
#include "src/tint/writer/array_length_from_uniform_options.h"
namespace tint {
namespace writer {
namespace tint::writer {
ArrayLengthFromUniformOptions::ArrayLengthFromUniformOptions() = default;
ArrayLengthFromUniformOptions::~ArrayLengthFromUniformOptions() = default;
@ -26,5 +25,4 @@ ArrayLengthFromUniformOptions& ArrayLengthFromUniformOptions::operator=(
ArrayLengthFromUniformOptions::ArrayLengthFromUniformOptions(
ArrayLengthFromUniformOptions&&) = default;
} // namespace writer
} // namespace tint
} // namespace tint::writer

View File

@ -19,8 +19,7 @@
#include "src/tint/sem/binding_point.h"
namespace tint {
namespace writer {
namespace tint::writer {
/// Options used to specify a mapping of binding points to indices into a UBO
/// from which to load buffer sizes.
@ -49,7 +48,6 @@ struct ArrayLengthFromUniformOptions {
// struct members.
};
} // namespace writer
} // namespace tint
} // namespace tint::writer
#endif // SRC_TINT_WRITER_ARRAY_LENGTH_FROM_UNIFORM_OPTIONS_H_

View File

@ -23,8 +23,7 @@
#include "src/tint/debug.h"
namespace tint {
namespace writer {
namespace tint::writer {
std::string FloatToString(float f) {
// Try printing the float in fixed point, with a smallish limit on the
@ -154,5 +153,4 @@ std::string FloatToBitPreservingString(float f) {
return ss.str();
}
} // namespace writer
} // namespace tint
} // namespace tint::writer

View File

@ -17,8 +17,7 @@
#include <string>
namespace tint {
namespace writer {
namespace tint::writer {
/// Converts the float `f` to a string using fixed-point notation (not
/// scientific). The float will be printed with the full precision required to
@ -33,7 +32,6 @@ std::string FloatToString(float f);
/// @return the float f formatted to a string
std::string FloatToBitPreservingString(float f);
} // namespace writer
} // namespace tint
} // namespace tint::writer
#endif // SRC_TINT_WRITER_FLOAT_TO_STRING_H_

View File

@ -20,8 +20,7 @@
#include "gtest/gtest.h"
namespace tint {
namespace writer {
namespace tint::writer {
namespace {
// Makes an IEEE 754 binary32 floating point number with
@ -222,5 +221,4 @@ TEST(FloatToBitPreservingStringTest, DISABLED_NaN_NonMsb) {
}
} // namespace
} // namespace writer
} // namespace tint
} // namespace tint::writer

View File

@ -14,10 +14,8 @@
#include "src/tint/writer/text.h"
namespace tint {
namespace writer {
namespace tint::writer {
Text::~Text() = default;
} // namespace writer
} // namespace tint
} // namespace tint::writer

View File

@ -19,8 +19,7 @@
#include "src/tint/writer/writer.h"
namespace tint {
namespace writer {
namespace tint::writer {
/// Class to generate text source
class Text : public Writer {
@ -31,7 +30,6 @@ class Text : public Writer {
virtual std::string result() const = 0;
};
} // namespace writer
} // namespace tint
} // namespace tint::writer
#endif // SRC_TINT_WRITER_TEXT_H_

View File

@ -19,8 +19,7 @@
#include "src/tint/utils/map.h"
namespace tint {
namespace writer {
namespace tint::writer {
TextGenerator::TextGenerator(const Program* program)
: program_(program), builder_(ProgramBuilder::Wrap(program)) {}
@ -151,5 +150,4 @@ TextGenerator::ScopedIndent::~ScopedIndent() {
buffer_->DecrementIndent();
}
} // namespace writer
} // namespace tint
} // namespace tint::writer

View File

@ -24,8 +24,7 @@
#include "src/tint/diagnostic/diagnostic.h"
#include "src/tint/program_builder.h"
namespace tint {
namespace writer {
namespace tint::writer {
/// Helper methods for generators which are creating text output
class TextGenerator {
@ -236,7 +235,6 @@ class TextGenerator {
std::unordered_map<const sem::Struct*, std::string> builtin_struct_names_;
};
} // namespace writer
} // namespace tint
} // namespace tint::writer
#endif // SRC_TINT_WRITER_TEXT_GENERATOR_H_

View File

@ -16,8 +16,7 @@
#include "gtest/gtest.h"
namespace tint {
namespace writer {
namespace tint::writer {
namespace {
TEST(TextGeneratorTest, UniqueIdentifier) {
@ -44,5 +43,4 @@ TEST(TextGeneratorTest, UniqueIdentifier_ConflictWithExisting) {
}
} // namespace
} // namespace writer
} // namespace tint
} // namespace tint::writer

View File

@ -14,10 +14,8 @@
#include "src/tint/writer/writer.h"
namespace tint {
namespace writer {
namespace tint::writer {
Writer::~Writer() = default;
} // namespace writer
} // namespace tint
} // namespace tint::writer

View File

@ -17,8 +17,7 @@
#include <string>
namespace tint {
namespace writer {
namespace tint::writer {
/// Base class for the output writers
class Writer {
@ -41,7 +40,6 @@ class Writer {
std::string error_;
};
} // namespace writer
} // namespace tint
} // namespace tint::writer
#endif // SRC_TINT_WRITER_WRITER_H_