Condense namespaces in tint/ast.

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

Change-Id: I77a84fb03f921b4db7135572005a08563f2fb60b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86038
Reviewed-by: Ben Clayton <bclayton@google.com>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
This commit is contained in:
dan sinclair 2022-04-07 18:39:35 +00:00 committed by Dawn LUCI CQ
parent 9f49ac5493
commit 34323ac069
233 changed files with 469 additions and 942 deletions

View File

@ -14,8 +14,7 @@
#include "src/tint/ast/access.h" #include "src/tint/ast/access.h"
namespace tint { namespace tint::ast {
namespace ast {
std::ostream& operator<<(std::ostream& out, Access access) { std::ostream& operator<<(std::ostream& out, Access access) {
switch (access) { switch (access) {
@ -39,5 +38,4 @@ std::ostream& operator<<(std::ostream& out, Access access) {
return out; return out;
} }
} // namespace ast } // namespace tint::ast
} // namespace tint

View File

@ -18,8 +18,7 @@
#include <ostream> #include <ostream>
#include <string> #include <string>
namespace tint { namespace tint::ast {
namespace ast {
/// The access control settings /// The access control settings
enum Access { enum Access {
@ -40,7 +39,6 @@ enum Access {
/// @return the std::ostream so calls can be chained /// @return the std::ostream so calls can be chained
std::ostream& operator<<(std::ostream& out, Access access); std::ostream& operator<<(std::ostream& out, Access access);
} // namespace ast } // namespace tint::ast
} // namespace tint
#endif // SRC_TINT_AST_ACCESS_H_ #endif // SRC_TINT_AST_ACCESS_H_

View File

@ -18,8 +18,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::ast::Alias); TINT_INSTANTIATE_TYPEINFO(tint::ast::Alias);
namespace tint { namespace tint::ast {
namespace ast {
Alias::Alias(ProgramID pid, Alias::Alias(ProgramID pid,
const Source& src, const Source& src,
@ -41,5 +40,4 @@ const Alias* Alias::Clone(CloneContext* ctx) const {
return ctx->dst->create<Alias>(src, sym, ty); return ctx->dst->create<Alias>(src, sym, ty);
} }
} // namespace ast } // namespace tint::ast
} // namespace tint

View File

@ -19,8 +19,7 @@
#include "src/tint/ast/type_decl.h" #include "src/tint/ast/type_decl.h"
namespace tint { namespace tint::ast {
namespace ast {
/// A type alias type. Holds a name and pointer to another type. /// A type alias type. Holds a name and pointer to another type.
class Alias final : public Castable<Alias, TypeDecl> { class Alias final : public Castable<Alias, TypeDecl> {
@ -48,7 +47,6 @@ class Alias final : public Castable<Alias, TypeDecl> {
const Type* const type; const Type* const type;
}; };
} // namespace ast } // namespace tint::ast
} // namespace tint
#endif // SRC_TINT_AST_ALIAS_H_ #endif // SRC_TINT_AST_ALIAS_H_

View File

@ -27,8 +27,7 @@
#include "src/tint/ast/u32.h" #include "src/tint/ast/u32.h"
#include "src/tint/ast/vector.h" #include "src/tint/ast/vector.h"
namespace tint { namespace tint::ast {
namespace ast {
namespace { namespace {
using AstAliasTest = TestHelper; using AstAliasTest = TestHelper;
@ -41,5 +40,4 @@ TEST_F(AstAliasTest, Create) {
} }
} // namespace } // namespace
} // namespace ast } // namespace tint::ast
} // namespace tint

View File

@ -20,8 +20,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::ast::Array); TINT_INSTANTIATE_TYPEINFO(tint::ast::Array);
namespace tint { namespace tint::ast {
namespace ast {
namespace { namespace {
// Returns the string representation of an array size expression. // Returns the string representation of an array size expression.
@ -74,5 +73,4 @@ const Array* Array::Clone(CloneContext* ctx) const {
return ctx->dst->create<Array>(src, ty, cnt, attrs); return ctx->dst->create<Array>(src, ty, cnt, attrs);
} }
} // namespace ast } // namespace tint::ast
} // namespace tint

View File

@ -20,8 +20,7 @@
#include "src/tint/ast/attribute.h" #include "src/tint/ast/attribute.h"
#include "src/tint/ast/type.h" #include "src/tint/ast/type.h"
namespace tint { namespace tint::ast {
namespace ast {
// Forward declarations. // Forward declarations.
class Expression; class Expression;
@ -69,7 +68,6 @@ class Array final : public Castable<Array, Type> {
const AttributeList attributes; const AttributeList attributes;
}; };
} // namespace ast } // namespace tint::ast
} // namespace tint
#endif // SRC_TINT_AST_ARRAY_H_ #endif // SRC_TINT_AST_ARRAY_H_

View File

@ -16,8 +16,7 @@
#include "src/tint/ast/test_helper.h" #include "src/tint/ast/test_helper.h"
namespace tint { namespace tint::ast {
namespace ast {
namespace { namespace {
using AstArrayTest = TestHelper; using AstArrayTest = TestHelper;
@ -67,5 +66,4 @@ TEST_F(AstArrayTest, FriendlyName_WithStride) {
} }
} // namespace } // namespace
} // namespace ast } // namespace tint::ast
} // namespace tint

View File

@ -18,8 +18,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::ast::AssignmentStatement); TINT_INSTANTIATE_TYPEINFO(tint::ast::AssignmentStatement);
namespace tint { namespace tint::ast {
namespace ast {
AssignmentStatement::AssignmentStatement(ProgramID pid, AssignmentStatement::AssignmentStatement(ProgramID pid,
const Source& src, const Source& src,
@ -44,5 +43,4 @@ const AssignmentStatement* AssignmentStatement::Clone(CloneContext* ctx) const {
return ctx->dst->create<AssignmentStatement>(src, l, r); return ctx->dst->create<AssignmentStatement>(src, l, r);
} }
} // namespace ast } // namespace tint::ast
} // namespace tint

View File

@ -18,8 +18,7 @@
#include "src/tint/ast/expression.h" #include "src/tint/ast/expression.h"
#include "src/tint/ast/statement.h" #include "src/tint/ast/statement.h"
namespace tint { namespace tint::ast {
namespace ast {
/// An assignment statement /// An assignment statement
class AssignmentStatement final class AssignmentStatement final
@ -51,7 +50,6 @@ class AssignmentStatement final
const Expression* const rhs; const Expression* const rhs;
}; };
} // namespace ast } // namespace tint::ast
} // namespace tint
#endif // SRC_TINT_AST_ASSIGNMENT_STATEMENT_H_ #endif // SRC_TINT_AST_ASSIGNMENT_STATEMENT_H_

View File

@ -17,8 +17,7 @@
#include "gtest/gtest-spi.h" #include "gtest/gtest-spi.h"
#include "src/tint/ast/test_helper.h" #include "src/tint/ast/test_helper.h"
namespace tint { namespace tint::ast {
namespace ast {
namespace { namespace {
using AssignmentStatementTest = TestHelper; using AssignmentStatementTest = TestHelper;
@ -90,5 +89,4 @@ TEST_F(AssignmentStatementTest, Assert_DifferentProgramID_RHS) {
} }
} // namespace } // namespace
} // namespace ast } // namespace tint::ast
} // namespace tint

View File

@ -28,8 +28,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::ast::Type); TINT_INSTANTIATE_TYPEINFO(tint::ast::Type);
namespace tint { namespace tint::ast {
namespace ast {
Type::Type(ProgramID pid, const Source& src) : Base(pid, src) {} Type::Type(ProgramID pid, const Source& src) : Base(pid, src) {}
@ -37,5 +36,4 @@ Type::Type(Type&&) = default;
Type::~Type() = default; Type::~Type() = default;
} // namespace ast } // namespace tint::ast
} // namespace tint

View File

@ -18,8 +18,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::ast::Atomic); TINT_INSTANTIATE_TYPEINFO(tint::ast::Atomic);
namespace tint { namespace tint::ast {
namespace ast {
Atomic::Atomic(ProgramID pid, const Source& src, const Type* const subtype) Atomic::Atomic(ProgramID pid, const Source& src, const Type* const subtype)
: Base(pid, src), type(subtype) {} : Base(pid, src), type(subtype) {}
@ -41,5 +40,4 @@ const Atomic* Atomic::Clone(CloneContext* ctx) const {
return ctx->dst->create<Atomic>(src, ty); return ctx->dst->create<Atomic>(src, ty);
} }
} // namespace ast } // namespace tint::ast
} // namespace tint

View File

@ -19,8 +19,7 @@
#include "src/tint/ast/type.h" #include "src/tint/ast/type.h"
namespace tint { namespace tint::ast {
namespace ast {
/// An atomic type. /// An atomic type.
class Atomic final : public Castable<Atomic, Type> { class Atomic final : public Castable<Atomic, Type> {
@ -48,7 +47,6 @@ class Atomic final : public Castable<Atomic, Type> {
const Type* const type; const Type* const type;
}; };
} // namespace ast } // namespace tint::ast
} // namespace tint
#endif // SRC_TINT_AST_ATOMIC_H_ #endif // SRC_TINT_AST_ATOMIC_H_

View File

@ -17,8 +17,7 @@
#include "src/tint/ast/i32.h" #include "src/tint/ast/i32.h"
#include "src/tint/ast/test_helper.h" #include "src/tint/ast/test_helper.h"
namespace tint { namespace tint::ast {
namespace ast {
namespace { namespace {
using AstAtomicTest = TestHelper; using AstAtomicTest = TestHelper;
@ -36,5 +35,4 @@ TEST_F(AstAtomicTest, FriendlyName) {
} }
} // namespace } // namespace
} // namespace ast } // namespace tint::ast
} // namespace tint

View File

@ -16,10 +16,8 @@
TINT_INSTANTIATE_TYPEINFO(tint::ast::Attribute); TINT_INSTANTIATE_TYPEINFO(tint::ast::Attribute);
namespace tint { namespace tint::ast {
namespace ast {
Attribute::~Attribute() = default; Attribute::~Attribute() = default;
} // namespace ast } // namespace tint::ast
} // namespace tint

View File

@ -20,8 +20,7 @@
#include "src/tint/ast/node.h" #include "src/tint/ast/node.h"
namespace tint { namespace tint::ast {
namespace ast {
/// The base class for all attributes /// The base class for all attributes
class Attribute : public Castable<Attribute, Node> { class Attribute : public Castable<Attribute, Node> {
@ -65,7 +64,6 @@ const T* GetAttribute(const AttributeList& attributes) {
return nullptr; return nullptr;
} }
} // namespace ast } // namespace tint::ast
} // namespace tint
#endif // SRC_TINT_AST_ATTRIBUTE_H_ #endif // SRC_TINT_AST_ATTRIBUTE_H_

View File

@ -18,8 +18,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::ast::BinaryExpression); TINT_INSTANTIATE_TYPEINFO(tint::ast::BinaryExpression);
namespace tint { namespace tint::ast {
namespace ast {
BinaryExpression::BinaryExpression(ProgramID pid, BinaryExpression::BinaryExpression(ProgramID pid,
const Source& src, const Source& src,
@ -46,5 +45,4 @@ const BinaryExpression* BinaryExpression::Clone(CloneContext* ctx) const {
return ctx->dst->create<BinaryExpression>(src, op, l, r); return ctx->dst->create<BinaryExpression>(src, op, l, r);
} }
} // namespace ast } // namespace tint::ast
} // namespace tint

View File

@ -17,8 +17,7 @@
#include "src/tint/ast/expression.h" #include "src/tint/ast/expression.h"
namespace tint { namespace tint::ast {
namespace ast {
/// The operator type /// The operator type
enum class BinaryOp { enum class BinaryOp {
@ -258,7 +257,6 @@ inline std::ostream& operator<<(std::ostream& out, BinaryOp op) {
return out; return out;
} }
} // namespace ast } // namespace tint::ast
} // namespace tint
#endif // SRC_TINT_AST_BINARY_EXPRESSION_H_ #endif // SRC_TINT_AST_BINARY_EXPRESSION_H_

View File

@ -15,8 +15,7 @@
#include "gtest/gtest-spi.h" #include "gtest/gtest-spi.h"
#include "src/tint/ast/test_helper.h" #include "src/tint/ast/test_helper.h"
namespace tint { namespace tint::ast {
namespace ast {
namespace { namespace {
using BinaryExpressionTest = TestHelper; using BinaryExpressionTest = TestHelper;
@ -91,5 +90,4 @@ TEST_F(BinaryExpressionTest, Assert_DifferentProgramID_RHS) {
} }
} // namespace } // namespace
} // namespace ast } // namespace tint::ast
} // namespace tint

View File

@ -20,8 +20,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::ast::BindingAttribute); TINT_INSTANTIATE_TYPEINFO(tint::ast::BindingAttribute);
namespace tint { namespace tint::ast {
namespace ast {
BindingAttribute::BindingAttribute(ProgramID pid, BindingAttribute::BindingAttribute(ProgramID pid,
const Source& src, const Source& src,
@ -40,5 +39,4 @@ const BindingAttribute* BindingAttribute::Clone(CloneContext* ctx) const {
return ctx->dst->create<BindingAttribute>(src, value); return ctx->dst->create<BindingAttribute>(src, value);
} }
} // namespace ast } // namespace tint::ast
} // namespace tint

View File

@ -19,8 +19,7 @@
#include "src/tint/ast/attribute.h" #include "src/tint/ast/attribute.h"
namespace tint { namespace tint::ast {
namespace ast {
/// A binding attribute /// A binding attribute
class BindingAttribute final : public Castable<BindingAttribute, Attribute> { class BindingAttribute final : public Castable<BindingAttribute, Attribute> {
@ -45,7 +44,6 @@ class BindingAttribute final : public Castable<BindingAttribute, Attribute> {
const uint32_t value; const uint32_t value;
}; };
} // namespace ast } // namespace tint::ast
} // namespace tint
#endif // SRC_TINT_AST_BINDING_ATTRIBUTE_H_ #endif // SRC_TINT_AST_BINDING_ATTRIBUTE_H_

View File

@ -14,8 +14,7 @@
#include "src/tint/ast/test_helper.h" #include "src/tint/ast/test_helper.h"
namespace tint { namespace tint::ast {
namespace ast {
namespace { namespace {
using BindingAttributeTest = TestHelper; using BindingAttributeTest = TestHelper;
@ -26,5 +25,4 @@ TEST_F(BindingAttributeTest, Creation) {
} }
} // namespace } // namespace
} // namespace ast } // namespace tint::ast
} // namespace tint

View File

@ -18,8 +18,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::ast::BitcastExpression); TINT_INSTANTIATE_TYPEINFO(tint::ast::BitcastExpression);
namespace tint { namespace tint::ast {
namespace ast {
BitcastExpression::BitcastExpression(ProgramID pid, BitcastExpression::BitcastExpression(ProgramID pid,
const Source& src, const Source& src,
@ -42,5 +41,4 @@ const BitcastExpression* BitcastExpression::Clone(CloneContext* ctx) const {
return ctx->dst->create<BitcastExpression>(src, t, e); return ctx->dst->create<BitcastExpression>(src, t, e);
} }
} // namespace ast } // namespace tint::ast
} // namespace tint

View File

@ -17,8 +17,7 @@
#include "src/tint/ast/expression.h" #include "src/tint/ast/expression.h"
namespace tint { namespace tint::ast {
namespace ast {
// Forward declaration // Forward declaration
class Type; class Type;
@ -51,7 +50,6 @@ class BitcastExpression final : public Castable<BitcastExpression, Expression> {
const Expression* const expr; const Expression* const expr;
}; };
} // namespace ast } // namespace tint::ast
} // namespace tint
#endif // SRC_TINT_AST_BITCAST_EXPRESSION_H_ #endif // SRC_TINT_AST_BITCAST_EXPRESSION_H_

View File

@ -17,8 +17,7 @@
#include "gtest/gtest-spi.h" #include "gtest/gtest-spi.h"
#include "src/tint/ast/test_helper.h" #include "src/tint/ast/test_helper.h"
namespace tint { namespace tint::ast {
namespace ast {
namespace { namespace {
using BitcastExpressionTest = TestHelper; using BitcastExpressionTest = TestHelper;
@ -77,5 +76,4 @@ TEST_F(BitcastExpressionTest, Assert_DifferentProgramID_Expr) {
} }
} // namespace } // namespace
} // namespace ast } // namespace tint::ast
} // namespace tint

View File

@ -18,8 +18,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::ast::BlockStatement); TINT_INSTANTIATE_TYPEINFO(tint::ast::BlockStatement);
namespace tint { namespace tint::ast {
namespace ast {
BlockStatement::BlockStatement(ProgramID pid, BlockStatement::BlockStatement(ProgramID pid,
const Source& src, const Source& src,
@ -42,5 +41,4 @@ const BlockStatement* BlockStatement::Clone(CloneContext* ctx) const {
return ctx->dst->create<BlockStatement>(src, stmts); return ctx->dst->create<BlockStatement>(src, stmts);
} }
} // namespace ast } // namespace tint::ast
} // namespace tint

View File

@ -19,8 +19,7 @@
#include "src/tint/ast/statement.h" #include "src/tint/ast/statement.h"
namespace tint { namespace tint::ast {
namespace ast {
/// A block statement /// A block statement
class BlockStatement final : public Castable<BlockStatement, Statement> { class BlockStatement final : public Castable<BlockStatement, Statement> {
@ -54,7 +53,6 @@ class BlockStatement final : public Castable<BlockStatement, Statement> {
const StatementList statements; const StatementList statements;
}; };
} // namespace ast } // namespace tint::ast
} // namespace tint
#endif // SRC_TINT_AST_BLOCK_STATEMENT_H_ #endif // SRC_TINT_AST_BLOCK_STATEMENT_H_

View File

@ -17,8 +17,7 @@
#include "src/tint/ast/if_statement.h" #include "src/tint/ast/if_statement.h"
#include "src/tint/ast/test_helper.h" #include "src/tint/ast/test_helper.h"
namespace tint { namespace tint::ast {
namespace ast {
namespace { namespace {
using BlockStatementTest = TestHelper; using BlockStatementTest = TestHelper;
@ -67,5 +66,4 @@ TEST_F(BlockStatementTest, Assert_DifferentProgramID_Statement) {
} }
} // namespace } // namespace
} // namespace ast } // namespace tint::ast
} // namespace tint

View File

@ -18,8 +18,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::ast::Bool); TINT_INSTANTIATE_TYPEINFO(tint::ast::Bool);
namespace tint { namespace tint::ast {
namespace ast {
Bool::Bool(ProgramID pid, const Source& src) : Base(pid, src) {} Bool::Bool(ProgramID pid, const Source& src) : Base(pid, src) {}
@ -36,5 +35,4 @@ const Bool* Bool::Clone(CloneContext* ctx) const {
return ctx->dst->create<Bool>(src); return ctx->dst->create<Bool>(src);
} }
} // namespace ast } // namespace tint::ast
} // namespace tint

View File

@ -25,8 +25,7 @@
#undef Bool #undef Bool
#endif #endif
namespace tint { namespace tint::ast {
namespace ast {
/// A boolean type /// A boolean type
class Bool final : public Castable<Bool, Type> { class Bool final : public Castable<Bool, Type> {
@ -50,7 +49,6 @@ class Bool final : public Castable<Bool, Type> {
const Bool* Clone(CloneContext* ctx) const override; const Bool* Clone(CloneContext* ctx) const override;
}; };
} // namespace ast } // namespace tint::ast
} // namespace tint
#endif // SRC_TINT_AST_BOOL_H_ #endif // SRC_TINT_AST_BOOL_H_

View File

@ -18,8 +18,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::ast::BoolLiteralExpression); TINT_INSTANTIATE_TYPEINFO(tint::ast::BoolLiteralExpression);
namespace tint { namespace tint::ast {
namespace ast {
BoolLiteralExpression::BoolLiteralExpression(ProgramID pid, BoolLiteralExpression::BoolLiteralExpression(ProgramID pid,
const Source& src, const Source& src,
@ -35,5 +34,4 @@ const BoolLiteralExpression* BoolLiteralExpression::Clone(
return ctx->dst->create<BoolLiteralExpression>(src, value); return ctx->dst->create<BoolLiteralExpression>(src, value);
} }
} // namespace ast } // namespace tint::ast
} // namespace tint

View File

@ -19,8 +19,7 @@
#include "src/tint/ast/literal_expression.h" #include "src/tint/ast/literal_expression.h"
namespace tint { namespace tint::ast {
namespace ast {
/// A boolean literal /// A boolean literal
class BoolLiteralExpression final class BoolLiteralExpression final
@ -43,7 +42,6 @@ class BoolLiteralExpression final
const bool value; const bool value;
}; };
} // namespace ast } // namespace tint::ast
} // namespace tint
#endif // SRC_TINT_AST_BOOL_LITERAL_EXPRESSION_H_ #endif // SRC_TINT_AST_BOOL_LITERAL_EXPRESSION_H_

View File

@ -14,8 +14,7 @@
#include "src/tint/ast/test_helper.h" #include "src/tint/ast/test_helper.h"
namespace tint { namespace tint::ast {
namespace ast {
namespace { namespace {
using BoolLiteralExpressionTest = TestHelper; using BoolLiteralExpressionTest = TestHelper;
@ -33,5 +32,4 @@ TEST_F(BoolLiteralExpressionTest, False) {
} }
} // namespace } // namespace
} // namespace ast } // namespace tint::ast
} // namespace tint

View File

@ -16,8 +16,7 @@
#include "src/tint/ast/test_helper.h" #include "src/tint/ast/test_helper.h"
namespace tint { namespace tint::ast {
namespace ast {
namespace { namespace {
using AstBoolTest = TestHelper; using AstBoolTest = TestHelper;
@ -28,5 +27,4 @@ TEST_F(AstBoolTest, FriendlyName) {
} }
} // namespace } // namespace
} // namespace ast } // namespace tint::ast
} // namespace tint

View File

@ -18,8 +18,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::ast::BreakStatement); TINT_INSTANTIATE_TYPEINFO(tint::ast::BreakStatement);
namespace tint { namespace tint::ast {
namespace ast {
BreakStatement::BreakStatement(ProgramID pid, const Source& src) BreakStatement::BreakStatement(ProgramID pid, const Source& src)
: Base(pid, src) {} : Base(pid, src) {}
@ -34,5 +33,4 @@ const BreakStatement* BreakStatement::Clone(CloneContext* ctx) const {
return ctx->dst->create<BreakStatement>(src); return ctx->dst->create<BreakStatement>(src);
} }
} // namespace ast } // namespace tint::ast
} // namespace tint

View File

@ -17,8 +17,7 @@
#include "src/tint/ast/statement.h" #include "src/tint/ast/statement.h"
namespace tint { namespace tint::ast {
namespace ast {
/// An break statement /// An break statement
class BreakStatement final : public Castable<BreakStatement, Statement> { class BreakStatement final : public Castable<BreakStatement, Statement> {
@ -38,7 +37,6 @@ class BreakStatement final : public Castable<BreakStatement, Statement> {
const BreakStatement* Clone(CloneContext* ctx) const override; const BreakStatement* Clone(CloneContext* ctx) const override;
}; };
} // namespace ast } // namespace tint::ast
} // namespace tint
#endif // SRC_TINT_AST_BREAK_STATEMENT_H_ #endif // SRC_TINT_AST_BREAK_STATEMENT_H_

View File

@ -16,8 +16,7 @@
#include "src/tint/ast/test_helper.h" #include "src/tint/ast/test_helper.h"
namespace tint { namespace tint::ast {
namespace ast {
namespace { namespace {
using BreakStatementTest = TestHelper; using BreakStatementTest = TestHelper;
@ -35,5 +34,4 @@ TEST_F(BreakStatementTest, IsBreak) {
} }
} // namespace } // namespace
} // namespace ast } // namespace tint::ast
} // namespace tint

View File

@ -14,8 +14,7 @@
#include "src/tint/ast/builtin.h" #include "src/tint/ast/builtin.h"
namespace tint { namespace tint::ast {
namespace ast {
std::ostream& operator<<(std::ostream& out, Builtin builtin) { std::ostream& operator<<(std::ostream& out, Builtin builtin) {
switch (builtin) { switch (builtin) {
@ -78,5 +77,4 @@ std::ostream& operator<<(std::ostream& out, Builtin builtin) {
return out; return out;
} }
} // namespace ast } // namespace tint::ast
} // namespace tint

View File

@ -17,8 +17,7 @@
#include <ostream> #include <ostream>
namespace tint { namespace tint::ast {
namespace ast {
/// The builtin identifiers /// The builtin identifiers
enum class Builtin { enum class Builtin {
@ -46,7 +45,6 @@ enum class Builtin {
/// @return the std::ostream so calls can be chained /// @return the std::ostream so calls can be chained
std::ostream& operator<<(std::ostream& out, Builtin builtin); std::ostream& operator<<(std::ostream& out, Builtin builtin);
} // namespace ast } // namespace tint::ast
} // namespace tint
#endif // SRC_TINT_AST_BUILTIN_H_ #endif // SRC_TINT_AST_BUILTIN_H_

View File

@ -20,8 +20,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::ast::BuiltinAttribute); TINT_INSTANTIATE_TYPEINFO(tint::ast::BuiltinAttribute);
namespace tint { namespace tint::ast {
namespace ast {
BuiltinAttribute::BuiltinAttribute(ProgramID pid, const Source& src, Builtin b) BuiltinAttribute::BuiltinAttribute(ProgramID pid, const Source& src, Builtin b)
: Base(pid, src), builtin(b) {} : Base(pid, src), builtin(b) {}
@ -38,5 +37,4 @@ const BuiltinAttribute* BuiltinAttribute::Clone(CloneContext* ctx) const {
return ctx->dst->create<BuiltinAttribute>(src, builtin); return ctx->dst->create<BuiltinAttribute>(src, builtin);
} }
} // namespace ast } // namespace tint::ast
} // namespace tint

View File

@ -20,8 +20,7 @@
#include "src/tint/ast/attribute.h" #include "src/tint/ast/attribute.h"
#include "src/tint/ast/builtin.h" #include "src/tint/ast/builtin.h"
namespace tint { namespace tint::ast {
namespace ast {
/// A builtin attribute /// A builtin attribute
class BuiltinAttribute final : public Castable<BuiltinAttribute, Attribute> { class BuiltinAttribute final : public Castable<BuiltinAttribute, Attribute> {
@ -46,7 +45,6 @@ class BuiltinAttribute final : public Castable<BuiltinAttribute, Attribute> {
const Builtin builtin; const Builtin builtin;
}; };
} // namespace ast } // namespace tint::ast
} // namespace tint
#endif // SRC_TINT_AST_BUILTIN_ATTRIBUTE_H_ #endif // SRC_TINT_AST_BUILTIN_ATTRIBUTE_H_

View File

@ -14,8 +14,7 @@
#include "src/tint/ast/test_helper.h" #include "src/tint/ast/test_helper.h"
namespace tint { namespace tint::ast {
namespace ast {
namespace { namespace {
using BuiltinAttributeTest = TestHelper; using BuiltinAttributeTest = TestHelper;
@ -26,5 +25,4 @@ TEST_F(BuiltinAttributeTest, Creation) {
} }
} // namespace } // namespace
} // namespace ast } // namespace tint::ast
} // namespace tint

View File

@ -18,10 +18,7 @@
#include "src/tint/sem/multisampled_texture_type.h" #include "src/tint/sem/multisampled_texture_type.h"
#include "src/tint/sem/sampled_texture_type.h" #include "src/tint/sem/sampled_texture_type.h"
namespace tint { namespace tint::ast::builtin::test {
namespace ast {
namespace builtin {
namespace test {
using u32 = ProgramBuilder::u32; using u32 = ProgramBuilder::u32;
using i32 = ProgramBuilder::i32; using i32 = ProgramBuilder::i32;
@ -2280,7 +2277,4 @@ bool ReturnsVoid(ValidTextureOverload texture_overload) {
} }
} }
} // namespace test } // namespace tint::ast::builtin::test
} // namespace builtin
} // namespace ast
} // namespace tint

View File

@ -21,10 +21,7 @@
#include "src/tint/program_builder.h" #include "src/tint/program_builder.h"
#include "src/tint/sem/storage_texture_type.h" #include "src/tint/sem/storage_texture_type.h"
namespace tint { namespace tint::ast::builtin::test {
namespace ast {
namespace builtin {
namespace test {
enum class TextureKind { enum class TextureKind {
kRegular, kRegular,
@ -261,9 +258,6 @@ struct TextureOverloadCase {
std::ostream& operator<<(std::ostream& out, const TextureOverloadCase& data); std::ostream& operator<<(std::ostream& out, const TextureOverloadCase& data);
} // namespace test } // namespace tint::ast::builtin::test
} // namespace builtin
} // namespace ast
} // namespace tint
#endif // SRC_TINT_AST_BUILTIN_TEXTURE_HELPER_TEST_H_ #endif // SRC_TINT_AST_BUILTIN_TEXTURE_HELPER_TEST_H_

View File

@ -18,8 +18,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::ast::CallExpression); TINT_INSTANTIATE_TYPEINFO(tint::ast::CallExpression);
namespace tint { namespace tint::ast {
namespace ast {
namespace { namespace {
CallExpression::Target ToTarget(const IdentifierExpression* name) { CallExpression::Target ToTarget(const IdentifierExpression* name) {
@ -74,5 +73,4 @@ const CallExpression* CallExpression::Clone(CloneContext* ctx) const {
p); p);
} }
} // namespace ast } // namespace tint::ast
} // namespace tint

View File

@ -17,8 +17,7 @@
#include "src/tint/ast/expression.h" #include "src/tint/ast/expression.h"
namespace tint { namespace tint::ast {
namespace ast {
// Forward declarations. // Forward declarations.
class Type; class Type;
@ -78,7 +77,6 @@ class CallExpression final : public Castable<CallExpression, Expression> {
const ExpressionList args; const ExpressionList args;
}; };
} // namespace ast } // namespace tint::ast
} // namespace tint
#endif // SRC_TINT_AST_CALL_EXPRESSION_H_ #endif // SRC_TINT_AST_CALL_EXPRESSION_H_

View File

@ -15,8 +15,7 @@
#include "gtest/gtest-spi.h" #include "gtest/gtest-spi.h"
#include "src/tint/ast/test_helper.h" #include "src/tint/ast/test_helper.h"
namespace tint { namespace tint::ast {
namespace ast {
namespace { namespace {
using CallExpressionTest = TestHelper; using CallExpressionTest = TestHelper;
@ -145,5 +144,4 @@ TEST_F(CallExpressionTest, Assert_DifferentProgramID_Param) {
} }
} // namespace } // namespace
} // namespace ast } // namespace tint::ast
} // namespace tint

View File

@ -18,8 +18,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::ast::CallStatement); TINT_INSTANTIATE_TYPEINFO(tint::ast::CallStatement);
namespace tint { namespace tint::ast {
namespace ast {
CallStatement::CallStatement(ProgramID pid, CallStatement::CallStatement(ProgramID pid,
const Source& src, const Source& src,
@ -40,5 +39,4 @@ const CallStatement* CallStatement::Clone(CloneContext* ctx) const {
return ctx->dst->create<CallStatement>(src, call); return ctx->dst->create<CallStatement>(src, call);
} }
} // namespace ast } // namespace tint::ast
} // namespace tint

View File

@ -18,8 +18,7 @@
#include "src/tint/ast/call_expression.h" #include "src/tint/ast/call_expression.h"
#include "src/tint/ast/statement.h" #include "src/tint/ast/statement.h"
namespace tint { namespace tint::ast {
namespace ast {
/// A call expression /// A call expression
class CallStatement final : public Castable<CallStatement, Statement> { class CallStatement final : public Castable<CallStatement, Statement> {
@ -43,7 +42,6 @@ class CallStatement final : public Castable<CallStatement, Statement> {
const CallExpression* const expr; const CallExpression* const expr;
}; };
} // namespace ast } // namespace tint::ast
} // namespace tint
#endif // SRC_TINT_AST_CALL_STATEMENT_H_ #endif // SRC_TINT_AST_CALL_STATEMENT_H_

View File

@ -17,8 +17,7 @@
#include "gtest/gtest-spi.h" #include "gtest/gtest-spi.h"
#include "src/tint/ast/test_helper.h" #include "src/tint/ast/test_helper.h"
namespace tint { namespace tint::ast {
namespace ast {
namespace { namespace {
using CallStatementTest = TestHelper; using CallStatementTest = TestHelper;
@ -56,5 +55,4 @@ TEST_F(CallStatementTest, Assert_DifferentProgramID_Call) {
} }
} // namespace } // namespace
} // namespace ast } // namespace tint::ast
} // namespace tint

View File

@ -18,8 +18,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::ast::CaseStatement); TINT_INSTANTIATE_TYPEINFO(tint::ast::CaseStatement);
namespace tint { namespace tint::ast {
namespace ast {
CaseStatement::CaseStatement(ProgramID pid, CaseStatement::CaseStatement(ProgramID pid,
const Source& src, const Source& src,
@ -46,5 +45,4 @@ const CaseStatement* CaseStatement::Clone(CloneContext* ctx) const {
return ctx->dst->create<CaseStatement>(src, sel, b); return ctx->dst->create<CaseStatement>(src, sel, b);
} }
} // namespace ast } // namespace tint::ast
} // namespace tint

View File

@ -20,8 +20,7 @@
#include "src/tint/ast/block_statement.h" #include "src/tint/ast/block_statement.h"
#include "src/tint/ast/int_literal_expression.h" #include "src/tint/ast/int_literal_expression.h"
namespace tint { namespace tint::ast {
namespace ast {
/// A list of case literals /// A list of case literals
using CaseSelectorList = std::vector<const IntLiteralExpression*>; using CaseSelectorList = std::vector<const IntLiteralExpression*>;
@ -61,7 +60,6 @@ class CaseStatement final : public Castable<CaseStatement, Statement> {
/// A list of case statements /// A list of case statements
using CaseStatementList = std::vector<const CaseStatement*>; using CaseStatementList = std::vector<const CaseStatement*>;
} // namespace ast } // namespace tint::ast
} // namespace tint
#endif // SRC_TINT_AST_CASE_STATEMENT_H_ #endif // SRC_TINT_AST_CASE_STATEMENT_H_

View File

@ -19,8 +19,7 @@
#include "src/tint/ast/if_statement.h" #include "src/tint/ast/if_statement.h"
#include "src/tint/ast/test_helper.h" #include "src/tint/ast/test_helper.h"
namespace tint { namespace tint::ast {
namespace ast {
namespace { namespace {
using CaseStatementTest = TestHelper; using CaseStatementTest = TestHelper;
@ -133,5 +132,4 @@ TEST_F(CaseStatementTest, Assert_DifferentProgramID_Selector) {
} }
} // namespace } // namespace
} // namespace ast } // namespace tint::ast
} // namespace tint

View File

@ -18,8 +18,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::ast::CompoundAssignmentStatement); TINT_INSTANTIATE_TYPEINFO(tint::ast::CompoundAssignmentStatement);
namespace tint { namespace tint::ast {
namespace ast {
CompoundAssignmentStatement::CompoundAssignmentStatement(ProgramID pid, CompoundAssignmentStatement::CompoundAssignmentStatement(ProgramID pid,
const Source& src, const Source& src,
@ -47,5 +46,4 @@ const CompoundAssignmentStatement* CompoundAssignmentStatement::Clone(
return ctx->dst->create<CompoundAssignmentStatement>(src, l, r, op); return ctx->dst->create<CompoundAssignmentStatement>(src, l, r, op);
} }
} // namespace ast } // namespace tint::ast
} // namespace tint

View File

@ -19,8 +19,7 @@
#include "src/tint/ast/expression.h" #include "src/tint/ast/expression.h"
#include "src/tint/ast/statement.h" #include "src/tint/ast/statement.h"
namespace tint { namespace tint::ast {
namespace ast {
/// A compound assignment statement /// A compound assignment statement
class CompoundAssignmentStatement final class CompoundAssignmentStatement final
@ -57,7 +56,6 @@ class CompoundAssignmentStatement final
const BinaryOp op; const BinaryOp op;
}; };
} // namespace ast } // namespace tint::ast
} // namespace tint
#endif // SRC_TINT_AST_COMPOUND_ASSIGNMENT_STATEMENT_H_ #endif // SRC_TINT_AST_COMPOUND_ASSIGNMENT_STATEMENT_H_

View File

@ -17,8 +17,7 @@
#include "gtest/gtest-spi.h" #include "gtest/gtest-spi.h"
#include "src/tint/ast/test_helper.h" #include "src/tint/ast/test_helper.h"
namespace tint { namespace tint::ast {
namespace ast {
namespace { namespace {
using CompoundAssignmentStatementTest = TestHelper; using CompoundAssignmentStatementTest = TestHelper;
@ -98,5 +97,4 @@ TEST_F(CompoundAssignmentStatementTest, Assert_DifferentProgramID_RHS) {
} }
} // namespace } // namespace
} // namespace ast } // namespace tint::ast
} // namespace tint

View File

@ -18,8 +18,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::ast::ContinueStatement); TINT_INSTANTIATE_TYPEINFO(tint::ast::ContinueStatement);
namespace tint { namespace tint::ast {
namespace ast {
ContinueStatement::ContinueStatement(ProgramID pid, const Source& src) ContinueStatement::ContinueStatement(ProgramID pid, const Source& src)
: Base(pid, src) {} : Base(pid, src) {}
@ -34,5 +33,4 @@ const ContinueStatement* ContinueStatement::Clone(CloneContext* ctx) const {
return ctx->dst->create<ContinueStatement>(src); return ctx->dst->create<ContinueStatement>(src);
} }
} // namespace ast } // namespace tint::ast
} // namespace tint

View File

@ -17,8 +17,7 @@
#include "src/tint/ast/statement.h" #include "src/tint/ast/statement.h"
namespace tint { namespace tint::ast {
namespace ast {
/// An continue statement /// An continue statement
class ContinueStatement final : public Castable<ContinueStatement, Statement> { class ContinueStatement final : public Castable<ContinueStatement, Statement> {
@ -38,7 +37,6 @@ class ContinueStatement final : public Castable<ContinueStatement, Statement> {
const ContinueStatement* Clone(CloneContext* ctx) const override; const ContinueStatement* Clone(CloneContext* ctx) const override;
}; };
} // namespace ast } // namespace tint::ast
} // namespace tint
#endif // SRC_TINT_AST_CONTINUE_STATEMENT_H_ #endif // SRC_TINT_AST_CONTINUE_STATEMENT_H_

View File

@ -16,8 +16,7 @@
#include "src/tint/ast/test_helper.h" #include "src/tint/ast/test_helper.h"
namespace tint { namespace tint::ast {
namespace ast {
namespace { namespace {
using ContinueStatementTest = TestHelper; using ContinueStatementTest = TestHelper;
@ -35,5 +34,4 @@ TEST_F(ContinueStatementTest, IsContinue) {
} }
} // namespace } // namespace
} // namespace ast } // namespace tint::ast
} // namespace tint

View File

@ -18,8 +18,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::ast::DepthMultisampledTexture); TINT_INSTANTIATE_TYPEINFO(tint::ast::DepthMultisampledTexture);
namespace tint { namespace tint::ast {
namespace ast {
namespace { namespace {
bool IsValidDepthDimension(TextureDimension dim) { bool IsValidDepthDimension(TextureDimension dim) {
@ -52,5 +51,4 @@ const DepthMultisampledTexture* DepthMultisampledTexture::Clone(
return ctx->dst->create<DepthMultisampledTexture>(src, dim); return ctx->dst->create<DepthMultisampledTexture>(src, dim);
} }
} // namespace ast } // namespace tint::ast
} // namespace tint

View File

@ -19,8 +19,7 @@
#include "src/tint/ast/texture.h" #include "src/tint/ast/texture.h"
namespace tint { namespace tint::ast {
namespace ast {
/// A multisampled depth texture type. /// A multisampled depth texture type.
class DepthMultisampledTexture final class DepthMultisampledTexture final
@ -48,7 +47,6 @@ class DepthMultisampledTexture final
const DepthMultisampledTexture* Clone(CloneContext* ctx) const override; const DepthMultisampledTexture* Clone(CloneContext* ctx) const override;
}; };
} // namespace ast } // namespace tint::ast
} // namespace tint
#endif // SRC_TINT_AST_DEPTH_MULTISAMPLED_TEXTURE_H_ #endif // SRC_TINT_AST_DEPTH_MULTISAMPLED_TEXTURE_H_

View File

@ -16,8 +16,7 @@
#include "src/tint/ast/test_helper.h" #include "src/tint/ast/test_helper.h"
namespace tint { namespace tint::ast {
namespace ast {
namespace { namespace {
using AstDepthMultisampledTextureTest = TestHelper; using AstDepthMultisampledTextureTest = TestHelper;
@ -33,5 +32,4 @@ TEST_F(AstDepthMultisampledTextureTest, FriendlyName) {
} }
} // namespace } // namespace
} // namespace ast } // namespace tint::ast
} // namespace tint

View File

@ -18,8 +18,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::ast::DepthTexture); TINT_INSTANTIATE_TYPEINFO(tint::ast::DepthTexture);
namespace tint { namespace tint::ast {
namespace ast {
namespace { namespace {
bool IsValidDepthDimension(TextureDimension dim) { bool IsValidDepthDimension(TextureDimension dim) {
@ -49,5 +48,4 @@ const DepthTexture* DepthTexture::Clone(CloneContext* ctx) const {
return ctx->dst->create<DepthTexture>(src, dim); return ctx->dst->create<DepthTexture>(src, dim);
} }
} // namespace ast } // namespace tint::ast
} // namespace tint

View File

@ -19,8 +19,7 @@
#include "src/tint/ast/texture.h" #include "src/tint/ast/texture.h"
namespace tint { namespace tint::ast {
namespace ast {
/// A depth texture type. /// A depth texture type.
class DepthTexture final : public Castable<DepthTexture, Texture> { class DepthTexture final : public Castable<DepthTexture, Texture> {
@ -45,7 +44,6 @@ class DepthTexture final : public Castable<DepthTexture, Texture> {
const DepthTexture* Clone(CloneContext* ctx) const override; const DepthTexture* Clone(CloneContext* ctx) const override;
}; };
} // namespace ast } // namespace tint::ast
} // namespace tint
#endif // SRC_TINT_AST_DEPTH_TEXTURE_H_ #endif // SRC_TINT_AST_DEPTH_TEXTURE_H_

View File

@ -16,8 +16,7 @@
#include "src/tint/ast/test_helper.h" #include "src/tint/ast/test_helper.h"
namespace tint { namespace tint::ast {
namespace ast {
namespace { namespace {
using AstDepthTextureTest = TestHelper; using AstDepthTextureTest = TestHelper;
@ -40,5 +39,4 @@ TEST_F(AstDepthTextureTest, FriendlyName) {
} }
} // namespace } // namespace
} // namespace ast } // namespace tint::ast
} // namespace tint

View File

@ -18,8 +18,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::ast::DisableValidationAttribute); TINT_INSTANTIATE_TYPEINFO(tint::ast::DisableValidationAttribute);
namespace tint { namespace tint::ast {
namespace ast {
DisableValidationAttribute::DisableValidationAttribute(ProgramID pid, DisableValidationAttribute::DisableValidationAttribute(ProgramID pid,
DisabledValidation val) DisabledValidation val)
@ -53,5 +52,4 @@ const DisableValidationAttribute* DisableValidationAttribute::Clone(
validation); validation);
} }
} // namespace ast } // namespace tint::ast
} // namespace tint

View File

@ -19,8 +19,7 @@
#include "src/tint/ast/internal_attribute.h" #include "src/tint/ast/internal_attribute.h"
namespace tint { namespace tint::ast {
namespace ast {
/// Enumerator of validation features that can be disabled with a /// Enumerator of validation features that can be disabled with a
/// DisableValidationAttribute attribute. /// DisableValidationAttribute attribute.
@ -77,7 +76,6 @@ class DisableValidationAttribute final
const DisabledValidation validation; const DisabledValidation validation;
}; };
} // namespace ast } // namespace tint::ast
} // namespace tint
#endif // SRC_TINT_AST_DISABLE_VALIDATION_ATTRIBUTE_H_ #endif // SRC_TINT_AST_DISABLE_VALIDATION_ATTRIBUTE_H_

View File

@ -18,8 +18,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::ast::DiscardStatement); TINT_INSTANTIATE_TYPEINFO(tint::ast::DiscardStatement);
namespace tint { namespace tint::ast {
namespace ast {
DiscardStatement::DiscardStatement(ProgramID pid, const Source& src) DiscardStatement::DiscardStatement(ProgramID pid, const Source& src)
: Base(pid, src) {} : Base(pid, src) {}
@ -34,5 +33,4 @@ const DiscardStatement* DiscardStatement::Clone(CloneContext* ctx) const {
return ctx->dst->create<DiscardStatement>(src); return ctx->dst->create<DiscardStatement>(src);
} }
} // namespace ast } // namespace tint::ast
} // namespace tint

View File

@ -17,8 +17,7 @@
#include "src/tint/ast/statement.h" #include "src/tint/ast/statement.h"
namespace tint { namespace tint::ast {
namespace ast {
/// A discard statement /// A discard statement
class DiscardStatement final : public Castable<DiscardStatement, Statement> { class DiscardStatement final : public Castable<DiscardStatement, Statement> {
@ -38,7 +37,6 @@ class DiscardStatement final : public Castable<DiscardStatement, Statement> {
const DiscardStatement* Clone(CloneContext* ctx) const override; const DiscardStatement* Clone(CloneContext* ctx) const override;
}; };
} // namespace ast } // namespace tint::ast
} // namespace tint
#endif // SRC_TINT_AST_DISCARD_STATEMENT_H_ #endif // SRC_TINT_AST_DISCARD_STATEMENT_H_

View File

@ -16,8 +16,7 @@
#include "src/tint/ast/test_helper.h" #include "src/tint/ast/test_helper.h"
namespace tint { namespace tint::ast {
namespace ast {
namespace { namespace {
using DiscardStatementTest = TestHelper; using DiscardStatementTest = TestHelper;
@ -45,5 +44,4 @@ TEST_F(DiscardStatementTest, IsDiscard) {
} }
} // namespace } // namespace
} // namespace ast } // namespace tint::ast
} // namespace tint

View File

@ -18,8 +18,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::ast::ElseStatement); TINT_INSTANTIATE_TYPEINFO(tint::ast::ElseStatement);
namespace tint { namespace tint::ast {
namespace ast {
ElseStatement::ElseStatement(ProgramID pid, ElseStatement::ElseStatement(ProgramID pid,
const Source& src, const Source& src,
@ -43,5 +42,4 @@ const ElseStatement* ElseStatement::Clone(CloneContext* ctx) const {
return ctx->dst->create<ElseStatement>(src, cond, b); return ctx->dst->create<ElseStatement>(src, cond, b);
} }
} // namespace ast } // namespace tint::ast
} // namespace tint

View File

@ -20,8 +20,7 @@
#include "src/tint/ast/block_statement.h" #include "src/tint/ast/block_statement.h"
#include "src/tint/ast/expression.h" #include "src/tint/ast/expression.h"
namespace tint { namespace tint::ast {
namespace ast {
/// An else statement /// An else statement
class ElseStatement final : public Castable<ElseStatement, Statement> { class ElseStatement final : public Castable<ElseStatement, Statement> {
@ -55,7 +54,6 @@ class ElseStatement final : public Castable<ElseStatement, Statement> {
/// A list of else statements /// A list of else statements
using ElseStatementList = std::vector<const ElseStatement*>; using ElseStatementList = std::vector<const ElseStatement*>;
} // namespace ast } // namespace tint::ast
} // namespace tint
#endif // SRC_TINT_AST_ELSE_STATEMENT_H_ #endif // SRC_TINT_AST_ELSE_STATEMENT_H_

View File

@ -17,8 +17,7 @@
#include "src/tint/ast/if_statement.h" #include "src/tint/ast/if_statement.h"
#include "src/tint/ast/test_helper.h" #include "src/tint/ast/test_helper.h"
namespace tint { namespace tint::ast {
namespace ast {
namespace { namespace {
using ElseStatementTest = TestHelper; using ElseStatementTest = TestHelper;
@ -90,5 +89,4 @@ TEST_F(ElseStatementTest, Assert_DifferentProgramID_Body) {
} }
} // namespace } // namespace
} // namespace ast } // namespace tint::ast
} // namespace tint

View File

@ -19,8 +19,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::ast::Expression); TINT_INSTANTIATE_TYPEINFO(tint::ast::Expression);
namespace tint { namespace tint::ast {
namespace ast {
Expression::Expression(ProgramID pid, const Source& src) : Base(pid, src) {} Expression::Expression(ProgramID pid, const Source& src) : Base(pid, src) {}
@ -28,5 +27,4 @@ Expression::Expression(Expression&&) = default;
Expression::~Expression() = default; Expression::~Expression() = default;
} // namespace ast } // namespace tint::ast
} // namespace tint

View File

@ -21,8 +21,7 @@
#include "src/tint/ast/node.h" #include "src/tint/ast/node.h"
#include "src/tint/sem/type.h" #include "src/tint/sem/type.h"
namespace tint { namespace tint::ast {
namespace ast {
/// Base expression class /// Base expression class
class Expression : public Castable<Expression, Node> { class Expression : public Castable<Expression, Node> {
@ -41,7 +40,6 @@ class Expression : public Castable<Expression, Node> {
/// A list of expressions /// A list of expressions
using ExpressionList = std::vector<const Expression*>; using ExpressionList = std::vector<const Expression*>;
} // namespace ast } // namespace tint::ast
} // namespace tint
#endif // SRC_TINT_AST_EXPRESSION_H_ #endif // SRC_TINT_AST_EXPRESSION_H_

View File

@ -18,8 +18,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::ast::ExternalTexture); TINT_INSTANTIATE_TYPEINFO(tint::ast::ExternalTexture);
namespace tint { namespace tint::ast {
namespace ast {
// ExternalTexture::ExternalTexture() : Base(ast::TextureDimension::k2d) {} // ExternalTexture::ExternalTexture() : Base(ast::TextureDimension::k2d) {}
ExternalTexture::ExternalTexture(ProgramID pid, const Source& src) ExternalTexture::ExternalTexture(ProgramID pid, const Source& src)
@ -37,5 +36,4 @@ const ExternalTexture* ExternalTexture::Clone(CloneContext* ctx) const {
return ctx->dst->create<ExternalTexture>(); return ctx->dst->create<ExternalTexture>();
} }
} // namespace ast } // namespace tint::ast
} // namespace tint

View File

@ -19,8 +19,7 @@
#include "src/tint/ast/texture.h" #include "src/tint/ast/texture.h"
namespace tint { namespace tint::ast {
namespace ast {
/// An external texture type /// An external texture type
class ExternalTexture final : public Castable<ExternalTexture, Texture> { class ExternalTexture final : public Castable<ExternalTexture, Texture> {
@ -45,7 +44,6 @@ class ExternalTexture final : public Castable<ExternalTexture, Texture> {
const ExternalTexture* Clone(CloneContext* ctx) const override; const ExternalTexture* Clone(CloneContext* ctx) const override;
}; };
} // namespace ast } // namespace tint::ast
} // namespace tint
#endif // SRC_TINT_AST_EXTERNAL_TEXTURE_H_ #endif // SRC_TINT_AST_EXTERNAL_TEXTURE_H_

View File

@ -16,8 +16,7 @@
#include "src/tint/ast/test_helper.h" #include "src/tint/ast/test_helper.h"
namespace tint { namespace tint::ast {
namespace ast {
namespace { namespace {
using AstExternalTextureTest = TestHelper; using AstExternalTextureTest = TestHelper;
@ -42,5 +41,4 @@ TEST_F(AstExternalTextureTest, FriendlyName) {
} }
} // namespace } // namespace
} // namespace ast } // namespace tint::ast
} // namespace tint

View File

@ -18,8 +18,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::ast::F32); TINT_INSTANTIATE_TYPEINFO(tint::ast::F32);
namespace tint { namespace tint::ast {
namespace ast {
F32::F32(ProgramID pid, const Source& src) : Base(pid, src) {} F32::F32(ProgramID pid, const Source& src) : Base(pid, src) {}
@ -36,5 +35,4 @@ const F32* F32::Clone(CloneContext* ctx) const {
return ctx->dst->create<F32>(src); return ctx->dst->create<F32>(src);
} }
} // namespace ast } // namespace tint::ast
} // namespace tint

View File

@ -19,8 +19,7 @@
#include "src/tint/ast/type.h" #include "src/tint/ast/type.h"
namespace tint { namespace tint::ast {
namespace ast {
/// A float 32 type /// A float 32 type
class F32 final : public Castable<F32, Type> { class F32 final : public Castable<F32, Type> {
@ -44,7 +43,6 @@ class F32 final : public Castable<F32, Type> {
const F32* Clone(CloneContext* ctx) const override; const F32* Clone(CloneContext* ctx) const override;
}; };
} // namespace ast } // namespace tint::ast
} // namespace tint
#endif // SRC_TINT_AST_F32_H_ #endif // SRC_TINT_AST_F32_H_

View File

@ -16,8 +16,7 @@
#include "src/tint/ast/test_helper.h" #include "src/tint/ast/test_helper.h"
namespace tint { namespace tint::ast {
namespace ast {
namespace { namespace {
using AstF32Test = TestHelper; using AstF32Test = TestHelper;
@ -28,5 +27,4 @@ TEST_F(AstF32Test, FriendlyName) {
} }
} // namespace } // namespace
} // namespace ast } // namespace tint::ast
} // namespace tint

View File

@ -18,8 +18,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::ast::FallthroughStatement); TINT_INSTANTIATE_TYPEINFO(tint::ast::FallthroughStatement);
namespace tint { namespace tint::ast {
namespace ast {
FallthroughStatement::FallthroughStatement(ProgramID pid, const Source& src) FallthroughStatement::FallthroughStatement(ProgramID pid, const Source& src)
: Base(pid, src) {} : Base(pid, src) {}
@ -35,5 +34,4 @@ const FallthroughStatement* FallthroughStatement::Clone(
return ctx->dst->create<FallthroughStatement>(src); return ctx->dst->create<FallthroughStatement>(src);
} }
} // namespace ast } // namespace tint::ast
} // namespace tint

View File

@ -17,8 +17,7 @@
#include "src/tint/ast/statement.h" #include "src/tint/ast/statement.h"
namespace tint { namespace tint::ast {
namespace ast {
/// An fallthrough statement /// An fallthrough statement
class FallthroughStatement final class FallthroughStatement final
@ -39,7 +38,6 @@ class FallthroughStatement final
const FallthroughStatement* Clone(CloneContext* ctx) const override; const FallthroughStatement* Clone(CloneContext* ctx) const override;
}; };
} // namespace ast } // namespace tint::ast
} // namespace tint
#endif // SRC_TINT_AST_FALLTHROUGH_STATEMENT_H_ #endif // SRC_TINT_AST_FALLTHROUGH_STATEMENT_H_

View File

@ -16,8 +16,7 @@
#include "src/tint/ast/test_helper.h" #include "src/tint/ast/test_helper.h"
namespace tint { namespace tint::ast {
namespace ast {
namespace { namespace {
using FallthroughStatementTest = TestHelper; using FallthroughStatementTest = TestHelper;
@ -43,5 +42,4 @@ TEST_F(FallthroughStatementTest, IsFallthrough) {
} }
} // namespace } // namespace
} // namespace ast } // namespace tint::ast
} // namespace tint

View File

@ -20,8 +20,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::ast::FloatLiteralExpression); TINT_INSTANTIATE_TYPEINFO(tint::ast::FloatLiteralExpression);
namespace tint { namespace tint::ast {
namespace ast {
FloatLiteralExpression::FloatLiteralExpression(ProgramID pid, FloatLiteralExpression::FloatLiteralExpression(ProgramID pid,
const Source& src, const Source& src,
@ -37,5 +36,4 @@ const FloatLiteralExpression* FloatLiteralExpression::Clone(
return ctx->dst->create<FloatLiteralExpression>(src, value); return ctx->dst->create<FloatLiteralExpression>(src, value);
} }
} // namespace ast } // namespace tint::ast
} // namespace tint

View File

@ -19,8 +19,7 @@
#include "src/tint/ast/literal_expression.h" #include "src/tint/ast/literal_expression.h"
namespace tint { namespace tint::ast {
namespace ast {
/// A float literal /// A float literal
class FloatLiteralExpression final class FloatLiteralExpression final
@ -43,7 +42,6 @@ class FloatLiteralExpression final
const float value; const float value;
}; };
} // namespace ast } // namespace tint::ast
} // namespace tint
#endif // SRC_TINT_AST_FLOAT_LITERAL_EXPRESSION_H_ #endif // SRC_TINT_AST_FLOAT_LITERAL_EXPRESSION_H_

View File

@ -14,8 +14,7 @@
#include "src/tint/ast/test_helper.h" #include "src/tint/ast/test_helper.h"
namespace tint { namespace tint::ast {
namespace ast {
namespace { namespace {
using FloatLiteralExpressionTest = TestHelper; using FloatLiteralExpressionTest = TestHelper;
@ -27,5 +26,4 @@ TEST_F(FloatLiteralExpressionTest, Value) {
} }
} // namespace } // namespace
} // namespace ast } // namespace tint::ast
} // namespace tint

View File

@ -18,8 +18,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::ast::ForLoopStatement); TINT_INSTANTIATE_TYPEINFO(tint::ast::ForLoopStatement);
namespace tint { namespace tint::ast {
namespace ast {
ForLoopStatement::ForLoopStatement(ProgramID pid, ForLoopStatement::ForLoopStatement(ProgramID pid,
const Source& src, const Source& src,
@ -55,5 +54,4 @@ const ForLoopStatement* ForLoopStatement::Clone(CloneContext* ctx) const {
return ctx->dst->create<ForLoopStatement>(src, init, cond, cont, b); return ctx->dst->create<ForLoopStatement>(src, init, cond, cont, b);
} }
} // namespace ast } // namespace tint::ast
} // namespace tint

View File

@ -17,8 +17,7 @@
#include "src/tint/ast/block_statement.h" #include "src/tint/ast/block_statement.h"
namespace tint { namespace tint::ast {
namespace ast {
class Expression; class Expression;
@ -61,7 +60,6 @@ class ForLoopStatement final : public Castable<ForLoopStatement, Statement> {
const BlockStatement* const body; const BlockStatement* const body;
}; };
} // namespace ast } // namespace tint::ast
} // namespace tint
#endif // SRC_TINT_AST_FOR_LOOP_STATEMENT_H_ #endif // SRC_TINT_AST_FOR_LOOP_STATEMENT_H_

View File

@ -16,8 +16,7 @@
#include "src/tint/ast/binary_expression.h" #include "src/tint/ast/binary_expression.h"
#include "src/tint/ast/test_helper.h" #include "src/tint/ast/test_helper.h"
namespace tint { namespace tint::ast {
namespace ast {
namespace { namespace {
using ForLoopStatementTest = TestHelper; using ForLoopStatementTest = TestHelper;
@ -100,5 +99,4 @@ TEST_F(ForLoopStatementTest, Assert_DifferentProgramID_Body) {
} }
} // namespace } // namespace
} // namespace ast } // namespace tint::ast
} // namespace tint

View File

@ -20,8 +20,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::ast::Function); TINT_INSTANTIATE_TYPEINFO(tint::ast::Function);
namespace tint { namespace tint::ast {
namespace ast {
Function::Function(ProgramID pid, Function::Function(ProgramID pid,
const Source& src, const Source& src,
@ -104,5 +103,4 @@ bool FunctionList::HasStage(ast::PipelineStage stage) const {
return false; return false;
} }
} // namespace ast } // namespace tint::ast
} // namespace tint

View File

@ -29,8 +29,7 @@
#include "src/tint/ast/pipeline_stage.h" #include "src/tint/ast/pipeline_stage.h"
#include "src/tint/ast/variable.h" #include "src/tint/ast/variable.h"
namespace tint { namespace tint::ast {
namespace ast {
/// A Function statement. /// A Function statement.
class Function final : public Castable<Function, Node> { class Function final : public Castable<Function, Node> {
@ -112,7 +111,6 @@ class FunctionList : public std::vector<const Function*> {
bool HasStage(PipelineStage stage) const; bool HasStage(PipelineStage stage) const;
}; };
} // namespace ast } // namespace tint::ast
} // namespace tint
#endif // SRC_TINT_AST_FUNCTION_H_ #endif // SRC_TINT_AST_FUNCTION_H_

View File

@ -18,8 +18,7 @@
#include "src/tint/ast/test_helper.h" #include "src/tint/ast/test_helper.h"
#include "src/tint/ast/workgroup_attribute.h" #include "src/tint/ast/workgroup_attribute.h"
namespace tint { namespace tint::ast {
namespace ast {
namespace { namespace {
using FunctionTest = TestHelper; using FunctionTest = TestHelper;
@ -192,5 +191,4 @@ TEST_F(FunctionListTest, HasStage) {
} }
} // namespace } // namespace
} // namespace ast } // namespace tint::ast
} // namespace tint

View File

@ -20,8 +20,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::ast::GroupAttribute); TINT_INSTANTIATE_TYPEINFO(tint::ast::GroupAttribute);
namespace tint { namespace tint::ast {
namespace ast {
GroupAttribute::GroupAttribute(ProgramID pid, const Source& src, uint32_t val) GroupAttribute::GroupAttribute(ProgramID pid, const Source& src, uint32_t val)
: Base(pid, src), value(val) {} : Base(pid, src), value(val) {}
@ -38,5 +37,4 @@ const GroupAttribute* GroupAttribute::Clone(CloneContext* ctx) const {
return ctx->dst->create<GroupAttribute>(src, value); return ctx->dst->create<GroupAttribute>(src, value);
} }
} // namespace ast } // namespace tint::ast
} // namespace tint

View File

@ -19,8 +19,7 @@
#include "src/tint/ast/attribute.h" #include "src/tint/ast/attribute.h"
namespace tint { namespace tint::ast {
namespace ast {
/// A group attribute /// A group attribute
class GroupAttribute final : public Castable<GroupAttribute, Attribute> { class GroupAttribute final : public Castable<GroupAttribute, Attribute> {
@ -45,7 +44,6 @@ class GroupAttribute final : public Castable<GroupAttribute, Attribute> {
const uint32_t value; const uint32_t value;
}; };
} // namespace ast } // namespace tint::ast
} // namespace tint
#endif // SRC_TINT_AST_GROUP_ATTRIBUTE_H_ #endif // SRC_TINT_AST_GROUP_ATTRIBUTE_H_

View File

@ -14,8 +14,7 @@
#include "src/tint/ast/test_helper.h" #include "src/tint/ast/test_helper.h"
namespace tint { namespace tint::ast {
namespace ast {
namespace { namespace {
using GroupAttributeTest = TestHelper; using GroupAttributeTest = TestHelper;
@ -26,5 +25,4 @@ TEST_F(GroupAttributeTest, Creation) {
} }
} // namespace } // namespace
} // namespace ast } // namespace tint::ast
} // namespace tint

View File

@ -18,8 +18,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::ast::I32); TINT_INSTANTIATE_TYPEINFO(tint::ast::I32);
namespace tint { namespace tint::ast {
namespace ast {
I32::I32(ProgramID pid, const Source& src) : Base(pid, src) {} I32::I32(ProgramID pid, const Source& src) : Base(pid, src) {}
@ -36,5 +35,4 @@ const I32* I32::Clone(CloneContext* ctx) const {
return ctx->dst->create<I32>(src); return ctx->dst->create<I32>(src);
} }
} // namespace ast } // namespace tint::ast
} // namespace tint

View File

@ -19,8 +19,7 @@
#include "src/tint/ast/type.h" #include "src/tint/ast/type.h"
namespace tint { namespace tint::ast {
namespace ast {
/// A signed int 32 type. /// A signed int 32 type.
class I32 final : public Castable<I32, Type> { class I32 final : public Castable<I32, Type> {
@ -44,7 +43,6 @@ class I32 final : public Castable<I32, Type> {
const I32* Clone(CloneContext* ctx) const override; const I32* Clone(CloneContext* ctx) const override;
}; };
} // namespace ast } // namespace tint::ast
} // namespace tint
#endif // SRC_TINT_AST_I32_H_ #endif // SRC_TINT_AST_I32_H_

View File

@ -16,8 +16,7 @@
#include "src/tint/ast/test_helper.h" #include "src/tint/ast/test_helper.h"
namespace tint { namespace tint::ast {
namespace ast {
namespace { namespace {
using AstI32Test = TestHelper; using AstI32Test = TestHelper;
@ -28,5 +27,4 @@ TEST_F(AstI32Test, FriendlyName) {
} }
} // namespace } // namespace
} // namespace ast } // namespace tint::ast
} // namespace tint

Some files were not shown because too many files have changed in this diff Show More