Condense namespaces in tint/sem.

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

Change-Id: Iff802ca78d4cb7fd21134a640dfe5d04e85148b4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86030
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
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 16:04:35 +00:00 committed by Dawn LUCI CQ
parent 67e79fe506
commit c990b3c867
115 changed files with 281 additions and 499 deletions

View File

@ -21,8 +21,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::sem::Array); TINT_INSTANTIATE_TYPEINFO(tint::sem::Array);
namespace tint { namespace tint::sem {
namespace sem {
Array::Array(const Type* element, Array::Array(const Type* element,
uint32_t count, uint32_t count,
@ -81,5 +80,4 @@ uint32_t Array::Size() const {
return size_; return size_;
} }
} // namespace sem } // namespace tint::sem
} // namespace tint

View File

@ -22,14 +22,11 @@
#include "src/tint/sem/type.h" #include "src/tint/sem/type.h"
// Forward declarations // Forward declarations
namespace tint { namespace tint::ast {
namespace ast {
class Array; class Array;
} // namespace ast } // namespace tint::ast
} // namespace tint
namespace tint { namespace tint::sem {
namespace sem {
/// Array holds the semantic information for Array nodes. /// Array holds the semantic information for Array nodes.
class Array final : public Castable<Array, Type> { class Array final : public Castable<Array, Type> {
@ -111,7 +108,6 @@ class Array final : public Castable<Array, Type> {
const bool constructible_; const bool constructible_;
}; };
} // namespace sem } // namespace tint::sem
} // namespace tint
#endif // SRC_TINT_SEM_ARRAY_H_ #endif // SRC_TINT_SEM_ARRAY_H_

View File

@ -20,8 +20,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::sem::Atomic); TINT_INSTANTIATE_TYPEINFO(tint::sem::Atomic);
namespace tint { namespace tint::sem {
namespace sem {
Atomic::Atomic(const sem::Type* subtype) : subtype_(subtype) { Atomic::Atomic(const sem::Type* subtype) : subtype_(subtype) {
TINT_ASSERT(AST, !subtype->Is<Reference>()); TINT_ASSERT(AST, !subtype->Is<Reference>());
@ -60,5 +59,4 @@ Atomic::Atomic(Atomic&&) = default;
Atomic::~Atomic() = default; Atomic::~Atomic() = default;
} // namespace sem } // namespace tint::sem
} // namespace tint

View File

@ -19,8 +19,7 @@
#include "src/tint/sem/type.h" #include "src/tint/sem/type.h"
namespace tint { namespace tint::sem {
namespace sem {
/// A atomic type. /// A atomic type.
class Atomic final : public Castable<Atomic, Type> { class Atomic final : public Castable<Atomic, Type> {
@ -62,7 +61,6 @@ class Atomic final : public Castable<Atomic, Type> {
sem::Type const* const subtype_; sem::Type const* const subtype_;
}; };
} // namespace sem } // namespace tint::sem
} // namespace tint
#endif // SRC_TINT_SEM_ATOMIC_TYPE_H_ #endif // SRC_TINT_SEM_ATOMIC_TYPE_H_

View File

@ -16,8 +16,7 @@
#include "src/tint/sem/test_helper.h" #include "src/tint/sem/test_helper.h"
namespace tint { namespace tint::sem {
namespace sem {
namespace { namespace {
using AtomicTest = TestHelper; using AtomicTest = TestHelper;
@ -54,5 +53,4 @@ TEST_F(AtomicTest, FriendlyName) {
} }
} // namespace } // namespace
} // namespace sem } // namespace tint::sem
} // namespace tint

View File

@ -14,8 +14,7 @@
#include "src/tint/sem/behavior.h" #include "src/tint/sem/behavior.h"
namespace tint { namespace tint::sem {
namespace sem {
std::ostream& operator<<(std::ostream& out, Behavior behavior) { std::ostream& operator<<(std::ostream& out, Behavior behavior) {
switch (behavior) { switch (behavior) {
@ -35,5 +34,4 @@ std::ostream& operator<<(std::ostream& out, Behavior behavior) {
return out << "<unknown>"; return out << "<unknown>";
} }
} // namespace sem } // namespace tint::sem
} // namespace tint

View File

@ -17,8 +17,7 @@
#include "src/tint/utils/enum_set.h" #include "src/tint/utils/enum_set.h"
namespace tint { namespace tint::sem {
namespace sem {
/// Behavior enumerates the possible behaviors of an expression or statement. /// Behavior enumerates the possible behaviors of an expression or statement.
/// @see https://www.w3.org/TR/WGSL/#behaviors /// @see https://www.w3.org/TR/WGSL/#behaviors
@ -40,7 +39,6 @@ using Behaviors = utils::EnumSet<Behavior>;
/// @returns out so calls can be chained /// @returns out so calls can be chained
std::ostream& operator<<(std::ostream& out, Behavior behavior); std::ostream& operator<<(std::ostream& out, Behavior behavior);
} // namespace sem } // namespace tint::sem
} // namespace tint
#endif // SRC_TINT_SEM_BEHAVIOR_H_ #endif // SRC_TINT_SEM_BEHAVIOR_H_

View File

@ -21,8 +21,7 @@
#include "src/tint/utils/hash.h" #include "src/tint/utils/hash.h"
namespace tint { namespace tint::sem {
namespace sem {
/// BindingPoint holds a group and binding index. /// BindingPoint holds a group and binding index.
struct BindingPoint { struct BindingPoint {
@ -46,8 +45,7 @@ struct BindingPoint {
} }
}; };
} // namespace sem } // namespace tint::sem
} // namespace tint
namespace std { namespace std {

View File

@ -22,8 +22,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::sem::BlockStatement);
TINT_INSTANTIATE_TYPEINFO(tint::sem::FunctionBlockStatement); TINT_INSTANTIATE_TYPEINFO(tint::sem::FunctionBlockStatement);
TINT_INSTANTIATE_TYPEINFO(tint::sem::LoopBlockStatement); TINT_INSTANTIATE_TYPEINFO(tint::sem::LoopBlockStatement);
namespace tint { namespace tint::sem {
namespace sem {
BlockStatement::BlockStatement(const ast::BlockStatement* declaration, BlockStatement::BlockStatement(const ast::BlockStatement* declaration,
const CompoundStatement* parent, const CompoundStatement* parent,
@ -63,5 +62,4 @@ void LoopBlockStatement::SetFirstContinue(
num_decls_at_first_continue_ = num_decls; num_decls_at_first_continue_ = num_decls;
} }
} // namespace sem } // namespace tint::sem
} // namespace tint

View File

@ -21,17 +21,14 @@
#include "src/tint/sem/statement.h" #include "src/tint/sem/statement.h"
// Forward declarations // Forward declarations
namespace tint { namespace tint::ast {
namespace ast {
class BlockStatement; class BlockStatement;
class ContinueStatement; class ContinueStatement;
class Function; class Function;
class Variable; class Variable;
} // namespace ast } // namespace tint::ast
} // namespace tint
namespace tint { namespace tint::sem {
namespace sem {
/// Holds semantic information about a block, such as parent block and variables /// Holds semantic information about a block, such as parent block and variables
/// declared in the block. /// declared in the block.
@ -117,7 +114,6 @@ class LoopBlockStatement final
size_t num_decls_at_first_continue_ = 0; size_t num_decls_at_first_continue_ = 0;
}; };
} // namespace sem } // namespace tint::sem
} // namespace tint
#endif // SRC_TINT_SEM_BLOCK_STATEMENT_H_ #endif // SRC_TINT_SEM_BLOCK_STATEMENT_H_

View File

@ -18,8 +18,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::sem::Bool); TINT_INSTANTIATE_TYPEINFO(tint::sem::Bool);
namespace tint { namespace tint::sem {
namespace sem {
Bool::Bool() = default; Bool::Bool() = default;
@ -51,5 +50,4 @@ uint32_t Bool::Align() const {
return 4; return 4;
} }
} // namespace sem } // namespace tint::sem
} // namespace tint

View File

@ -25,8 +25,7 @@
#undef Bool #undef Bool
#endif #endif
namespace tint { namespace tint::sem {
namespace sem {
/// A boolean type /// A boolean type
class Bool final : public Castable<Bool, Type> { class Bool final : public Castable<Bool, Type> {
@ -64,7 +63,6 @@ class Bool final : public Castable<Bool, Type> {
uint32_t Align() const override; uint32_t Align() const override;
}; };
} // namespace sem } // namespace tint::sem
} // namespace tint
#endif // SRC_TINT_SEM_BOOL_TYPE_H_ #endif // SRC_TINT_SEM_BOOL_TYPE_H_

View File

@ -15,8 +15,7 @@
#include "src/tint/sem/test_helper.h" #include "src/tint/sem/test_helper.h"
#include "src/tint/sem/texture_type.h" #include "src/tint/sem/texture_type.h"
namespace tint { namespace tint::sem {
namespace sem {
namespace { namespace {
using BoolTest = TestHelper; using BoolTest = TestHelper;
@ -46,5 +45,4 @@ TEST_F(BoolTest, FriendlyName) {
} }
} // namespace } // namespace
} // namespace sem } // namespace tint::sem
} // namespace tint

View File

@ -23,8 +23,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::sem::Builtin); TINT_INSTANTIATE_TYPEINFO(tint::sem::Builtin);
namespace tint { namespace tint::sem {
namespace sem {
const char* Builtin::str() const { const char* Builtin::str() const {
return sem::str(type_); return sem::str(type_);
@ -161,7 +160,6 @@ bool Builtin::HasSideEffects() const {
return false; return false;
} }
} // namespace sem } // namespace tint::sem
} // namespace tint
//! @endcond //! @endcond

View File

@ -23,8 +23,7 @@
#include "src/tint/sem/pipeline_stage_set.h" #include "src/tint/sem/pipeline_stage_set.h"
#include "src/tint/utils/hash.h" #include "src/tint/utils/hash.h"
namespace tint { namespace tint::sem {
namespace sem {
/// Determines if the given `i` is a coarse derivative /// Determines if the given `i` is a coarse derivative
/// @param i the builtin type /// @param i the builtin type
@ -147,8 +146,7 @@ static constexpr double kRadToDeg = 57.295779513082322865;
/// Constant value used by the radians() builtin /// Constant value used by the radians() builtin
static constexpr double kDegToRad = 0.017453292519943295474; static constexpr double kDegToRad = 0.017453292519943295474;
} // namespace sem } // namespace tint::sem
} // namespace tint
namespace std { namespace std {

View File

@ -16,8 +16,7 @@
#include "gtest/gtest.h" #include "gtest/gtest.h"
namespace tint { namespace tint::sem {
namespace sem {
namespace { namespace {
struct BuiltinData { struct BuiltinData {
@ -124,5 +123,4 @@ TEST_F(BuiltinTypeTest, ParseNoMatch) {
} }
} // namespace } // namespace
} // namespace sem } // namespace tint::sem
} // namespace tint

View File

@ -26,8 +26,7 @@
#include <sstream> #include <sstream>
namespace tint { namespace tint::sem {
namespace sem {
BuiltinType ParseBuiltinType(const std::string& name) { BuiltinType ParseBuiltinType(const std::string& name) {
if (name == "abs") { if (name == "abs") {
@ -571,5 +570,4 @@ std::ostream& operator<<(std::ostream& out, BuiltinType i) {
return out; return out;
} }
} // namespace sem } // namespace tint::sem
} // namespace tint

View File

@ -12,8 +12,7 @@ See:
#include <sstream> #include <sstream>
namespace tint { namespace tint::sem {
namespace sem {
BuiltinType ParseBuiltinType(const std::string& name) { BuiltinType ParseBuiltinType(const std::string& name) {
{{- range .Sem.Functions }} {{- range .Sem.Functions }}
@ -41,5 +40,4 @@ std::ostream& operator<<(std::ostream& out, BuiltinType i) {
return out; return out;
} }
} // namespace sem } // namespace tint::sem
} // namespace tint

View File

@ -28,8 +28,7 @@
#include <sstream> #include <sstream>
#include <string> #include <string>
namespace tint { namespace tint::sem {
namespace sem {
/// Enumerator of all builtin functions /// Enumerator of all builtin functions
enum class BuiltinType { enum class BuiltinType {
@ -155,7 +154,6 @@ const char* str(BuiltinType i);
/// matches the name in the WGSL spec. /// matches the name in the WGSL spec.
std::ostream& operator<<(std::ostream& out, BuiltinType i); std::ostream& operator<<(std::ostream& out, BuiltinType i);
} // namespace sem } // namespace tint::sem
} // namespace tint
#endif // SRC_TINT_SEM_BUILTIN_TYPE_H_ #endif // SRC_TINT_SEM_BUILTIN_TYPE_H_

View File

@ -14,8 +14,7 @@ See:
#include <sstream> #include <sstream>
#include <string> #include <string>
namespace tint { namespace tint::sem {
namespace sem {
/// Enumerator of all builtin functions /// Enumerator of all builtin functions
enum class BuiltinType { enum class BuiltinType {
@ -39,7 +38,6 @@ const char* str(BuiltinType i);
/// matches the name in the WGSL spec. /// matches the name in the WGSL spec.
std::ostream& operator<<(std::ostream& out, BuiltinType i); std::ostream& operator<<(std::ostream& out, BuiltinType i);
} // namespace sem } // namespace tint::sem
} // namespace tint
#endif // SRC_TINT_SEM_BUILTIN_TYPE_H_ #endif // SRC_TINT_SEM_BUILTIN_TYPE_H_

View File

@ -19,8 +19,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::sem::Call); TINT_INSTANTIATE_TYPEINFO(tint::sem::Call);
namespace tint { namespace tint::sem {
namespace sem {
Call::Call(const ast::CallExpression* declaration, Call::Call(const ast::CallExpression* declaration,
const CallTarget* target, const CallTarget* target,
@ -38,5 +37,4 @@ Call::Call(const ast::CallExpression* declaration,
Call::~Call() = default; Call::~Call() = default;
} // namespace sem } // namespace tint::sem
} // namespace tint

View File

@ -20,8 +20,7 @@
#include "src/tint/sem/builtin.h" #include "src/tint/sem/builtin.h"
#include "src/tint/sem/expression.h" #include "src/tint/sem/expression.h"
namespace tint { namespace tint::sem {
namespace sem {
/// Call is the base class for semantic nodes that hold semantic information for /// Call is the base class for semantic nodes that hold semantic information for
/// ast::CallExpression nodes. /// ast::CallExpression nodes.
@ -62,7 +61,6 @@ class Call final : public Castable<Call, Expression> {
std::vector<const sem::Expression*> arguments_; std::vector<const sem::Expression*> arguments_;
}; };
} // namespace sem } // namespace tint::sem
} // namespace tint
#endif // SRC_TINT_SEM_CALL_H_ #endif // SRC_TINT_SEM_CALL_H_

View File

@ -19,8 +19,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::sem::CallTarget); TINT_INSTANTIATE_TYPEINFO(tint::sem::CallTarget);
namespace tint { namespace tint::sem {
namespace sem {
CallTarget::CallTarget(const sem::Type* return_type, CallTarget::CallTarget(const sem::Type* return_type,
const ParameterList& parameters) const ParameterList& parameters)
@ -61,8 +60,7 @@ bool CallTargetSignature::operator==(const CallTargetSignature& other) const {
return true; return true;
} }
} // namespace sem } // namespace tint::sem
} // namespace tint
namespace std { namespace std {

View File

@ -22,10 +22,12 @@
#include "src/tint/sem/variable.h" #include "src/tint/sem/variable.h"
#include "src/tint/utils/hash.h" #include "src/tint/utils/hash.h"
namespace tint {
namespace sem {
// Forward declarations // Forward declarations
namespace tint::sem {
class Type; class Type;
}
namespace tint::sem {
/// CallTargetSignature holds the return type and parameters for a call target /// CallTargetSignature holds the return type and parameters for a call target
struct CallTargetSignature { struct CallTargetSignature {
@ -84,8 +86,7 @@ class CallTarget : public Castable<CallTarget, Node> {
CallTargetSignature signature_; CallTargetSignature signature_;
}; };
} // namespace sem } // namespace tint::sem
} // namespace tint
namespace std { namespace std {

View File

@ -21,8 +21,7 @@
#include "src/tint/program_builder.h" #include "src/tint/program_builder.h"
#include "src/tint/sem/type.h" #include "src/tint/sem/type.h"
namespace tint { namespace tint::sem {
namespace sem {
namespace { namespace {
@ -80,5 +79,4 @@ bool Constant::AnyZero() const {
return false; return false;
} }
} // namespace sem } // namespace tint::sem
} // namespace tint

View File

@ -20,8 +20,7 @@
#include "src/tint/program_builder.h" #include "src/tint/program_builder.h"
#include "src/tint/sem/type.h" #include "src/tint/sem/type.h"
namespace tint { namespace tint::sem {
namespace sem {
/// A Constant is compile-time known expression value, expressed as a flattened /// A Constant is compile-time known expression value, expressed as a flattened
/// list of scalar values. Value may be of a scalar or vector type. /// list of scalar values. Value may be of a scalar or vector type.
@ -139,7 +138,6 @@ class Constant {
Scalars elems_; Scalars elems_;
}; };
} // namespace sem } // namespace tint::sem
} // namespace tint
#endif // SRC_TINT_SEM_CONSTANT_H_ #endif // SRC_TINT_SEM_CONSTANT_H_

View File

@ -19,8 +19,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::sem::DepthMultisampledTexture); TINT_INSTANTIATE_TYPEINFO(tint::sem::DepthMultisampledTexture);
namespace tint { namespace tint::sem {
namespace sem {
namespace { namespace {
bool IsValidDepthDimension(ast::TextureDimension dim) { bool IsValidDepthDimension(ast::TextureDimension dim) {
@ -57,5 +56,4 @@ std::string DepthMultisampledTexture::FriendlyName(const SymbolTable&) const {
return out.str(); return out.str();
} }
} // namespace sem } // namespace tint::sem
} // namespace tint

View File

@ -19,8 +19,7 @@
#include "src/tint/sem/texture_type.h" #include "src/tint/sem/texture_type.h"
namespace tint { namespace tint::sem {
namespace sem {
/// A multisampled depth texture type. /// A multisampled depth texture type.
class DepthMultisampledTexture final class DepthMultisampledTexture final
@ -46,7 +45,6 @@ class DepthMultisampledTexture final
std::string FriendlyName(const SymbolTable& symbols) const override; std::string FriendlyName(const SymbolTable& symbols) const override;
}; };
} // namespace sem } // namespace tint::sem
} // namespace tint
#endif // SRC_TINT_SEM_DEPTH_MULTISAMPLED_TEXTURE_TYPE_H_ #endif // SRC_TINT_SEM_DEPTH_MULTISAMPLED_TEXTURE_TYPE_H_

View File

@ -20,8 +20,7 @@
#include "src/tint/sem/sampled_texture_type.h" #include "src/tint/sem/sampled_texture_type.h"
#include "src/tint/sem/storage_texture_type.h" #include "src/tint/sem/storage_texture_type.h"
namespace tint { namespace tint::sem {
namespace sem {
namespace { namespace {
using DepthMultisampledTextureTest = TestHelper; using DepthMultisampledTextureTest = TestHelper;
@ -60,5 +59,4 @@ TEST_F(DepthMultisampledTextureTest, FriendlyName) {
} }
} // namespace } // namespace
} // namespace sem } // namespace tint::sem
} // namespace tint

View File

@ -19,8 +19,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::sem::DepthTexture); TINT_INSTANTIATE_TYPEINFO(tint::sem::DepthTexture);
namespace tint { namespace tint::sem {
namespace sem {
namespace { namespace {
bool IsValidDepthDimension(ast::TextureDimension dim) { bool IsValidDepthDimension(ast::TextureDimension dim) {
@ -57,5 +56,4 @@ std::string DepthTexture::FriendlyName(const SymbolTable&) const {
return out.str(); return out.str();
} }
} // namespace sem } // namespace tint::sem
} // namespace tint

View File

@ -19,8 +19,7 @@
#include "src/tint/sem/texture_type.h" #include "src/tint/sem/texture_type.h"
namespace tint { namespace tint::sem {
namespace sem {
/// 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> {
std::string FriendlyName(const SymbolTable& symbols) const override; std::string FriendlyName(const SymbolTable& symbols) const override;
}; };
} // namespace sem } // namespace tint::sem
} // namespace tint
#endif // SRC_TINT_SEM_DEPTH_TEXTURE_TYPE_H_ #endif // SRC_TINT_SEM_DEPTH_TEXTURE_TYPE_H_

View File

@ -20,8 +20,7 @@
#include "src/tint/sem/sampled_texture_type.h" #include "src/tint/sem/sampled_texture_type.h"
#include "src/tint/sem/storage_texture_type.h" #include "src/tint/sem/storage_texture_type.h"
namespace tint { namespace tint::sem {
namespace sem {
namespace { namespace {
using DepthTextureTest = TestHelper; using DepthTextureTest = TestHelper;
@ -74,5 +73,4 @@ TEST_F(DepthTextureTest, FriendlyName) {
} }
} // namespace } // namespace
} // namespace sem } // namespace tint::sem
} // namespace tint

View File

@ -18,8 +18,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::sem::Expression); TINT_INSTANTIATE_TYPEINFO(tint::sem::Expression);
namespace tint { namespace tint::sem {
namespace sem {
Expression::Expression(const ast::Expression* declaration, Expression::Expression(const ast::Expression* declaration,
const sem::Type* type, const sem::Type* type,
@ -36,5 +35,4 @@ Expression::Expression(const ast::Expression* declaration,
Expression::~Expression() = default; Expression::~Expression() = default;
} // namespace sem } // namespace tint::sem
} // namespace tint

View File

@ -20,12 +20,13 @@
#include "src/tint/sem/constant.h" #include "src/tint/sem/constant.h"
#include "src/tint/sem/node.h" #include "src/tint/sem/node.h"
namespace tint {
namespace sem {
// Forward declarations // Forward declarations
namespace tint::sem {
class Statement; class Statement;
class Type; class Type;
} // namespace tint::sem
namespace tint::sem {
/// Expression holds the semantic information for expression nodes. /// Expression holds the semantic information for expression nodes.
class Expression : public Castable<Expression, Node> { class Expression : public Castable<Expression, Node> {
public: public:
@ -77,7 +78,6 @@ class Expression : public Castable<Expression, Node> {
const bool has_side_effects_; const bool has_side_effects_;
}; };
} // namespace sem } // namespace tint::sem
} // namespace tint
#endif // SRC_TINT_SEM_EXPRESSION_H_ #endif // SRC_TINT_SEM_EXPRESSION_H_

View File

@ -18,8 +18,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::sem::ExternalTexture); TINT_INSTANTIATE_TYPEINFO(tint::sem::ExternalTexture);
namespace tint { namespace tint::sem {
namespace sem {
ExternalTexture::ExternalTexture() : Base(ast::TextureDimension::k2d) {} ExternalTexture::ExternalTexture() : Base(ast::TextureDimension::k2d) {}
@ -39,5 +38,4 @@ std::string ExternalTexture::FriendlyName(const SymbolTable&) const {
return "texture_external"; return "texture_external";
} }
} // namespace sem } // namespace tint::sem
} // namespace tint

View File

@ -19,8 +19,7 @@
#include "src/tint/sem/texture_type.h" #include "src/tint/sem/texture_type.h"
namespace tint { namespace tint::sem {
namespace sem {
/// 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> {
std::string FriendlyName(const SymbolTable& symbols) const override; std::string FriendlyName(const SymbolTable& symbols) const override;
}; };
} // namespace sem } // namespace tint::sem
} // namespace tint
#endif // SRC_TINT_SEM_EXTERNAL_TEXTURE_TYPE_H_ #endif // SRC_TINT_SEM_EXTERNAL_TEXTURE_TYPE_H_

View File

@ -20,8 +20,7 @@
#include "src/tint/sem/storage_texture_type.h" #include "src/tint/sem/storage_texture_type.h"
#include "src/tint/sem/test_helper.h" #include "src/tint/sem/test_helper.h"
namespace tint { namespace tint::sem {
namespace sem {
namespace { namespace {
using ExternalTextureTest = TestHelper; using ExternalTextureTest = TestHelper;
@ -68,5 +67,4 @@ TEST_F(ExternalTextureTest, FriendlyName) {
} }
} // namespace } // namespace
} // namespace sem } // namespace tint::sem
} // namespace tint

View File

@ -18,8 +18,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::sem::F32); TINT_INSTANTIATE_TYPEINFO(tint::sem::F32);
namespace tint { namespace tint::sem {
namespace sem {
F32::F32() = default; F32::F32() = default;
@ -51,5 +50,4 @@ uint32_t F32::Align() const {
return 4; return 4;
} }
} // namespace sem } // namespace tint::sem
} // namespace tint

View File

@ -19,8 +19,7 @@
#include "src/tint/sem/type.h" #include "src/tint/sem/type.h"
namespace tint { namespace tint::sem {
namespace sem {
/// A float 32 type /// A float 32 type
class F32 final : public Castable<F32, Type> { class F32 final : public Castable<F32, Type> {
@ -54,7 +53,6 @@ class F32 final : public Castable<F32, Type> {
uint32_t Align() const override; uint32_t Align() const override;
}; };
} // namespace sem } // namespace tint::sem
} // namespace tint
#endif // SRC_TINT_SEM_F32_TYPE_H_ #endif // SRC_TINT_SEM_F32_TYPE_H_

View File

@ -15,8 +15,7 @@
#include "src/tint/sem/test_helper.h" #include "src/tint/sem/test_helper.h"
#include "src/tint/sem/texture_type.h" #include "src/tint/sem/texture_type.h"
namespace tint { namespace tint::sem {
namespace sem {
namespace { namespace {
using F32Test = TestHelper; using F32Test = TestHelper;
@ -46,5 +45,4 @@ TEST_F(F32Test, FriendlyName) {
} }
} // namespace } // namespace
} // namespace sem } // namespace tint::sem
} // namespace tint

View File

@ -18,8 +18,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::sem::ForLoopStatement); TINT_INSTANTIATE_TYPEINFO(tint::sem::ForLoopStatement);
namespace tint { namespace tint::sem {
namespace sem {
ForLoopStatement::ForLoopStatement(const ast::ForLoopStatement* declaration, ForLoopStatement::ForLoopStatement(const ast::ForLoopStatement* declaration,
const CompoundStatement* parent, const CompoundStatement* parent,
@ -32,5 +31,4 @@ const ast::ForLoopStatement* ForLoopStatement::Declaration() const {
return static_cast<const ast::ForLoopStatement*>(Base::Declaration()); return static_cast<const ast::ForLoopStatement*>(Base::Declaration());
} }
} // namespace sem } // namespace tint::sem
} // namespace tint

View File

@ -17,17 +17,17 @@
#include "src/tint/sem/statement.h" #include "src/tint/sem/statement.h"
// Forward Declarations
namespace tint { namespace tint {
namespace ast { namespace ast {
class ForLoopStatement; class ForLoopStatement;
} // namespace ast }
namespace sem { namespace sem {
class Expression; class Expression;
} // namespace sem }
} // namespace tint } // namespace tint
namespace tint { namespace tint::sem {
namespace sem {
/// Holds semantic information about a for-loop statement /// Holds semantic information about a for-loop statement
class ForLoopStatement final class ForLoopStatement final
@ -58,7 +58,6 @@ class ForLoopStatement final
const Expression* condition_ = nullptr; const Expression* condition_ = nullptr;
}; };
} // namespace sem } // namespace tint::sem
} // namespace tint
#endif // SRC_TINT_SEM_FOR_LOOP_STATEMENT_H_ #endif // SRC_TINT_SEM_FOR_LOOP_STATEMENT_H_

View File

@ -25,8 +25,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::sem::Function); TINT_INSTANTIATE_TYPEINFO(tint::sem::Function);
namespace tint { namespace tint::sem {
namespace sem {
Function::Function(const ast::Function* declaration, Function::Function(const ast::Function* declaration,
Type* return_type, Type* return_type,
@ -38,7 +37,7 @@ Function::Function(const ast::Function* declaration,
for (auto* parameter : parameters) { for (auto* parameter : parameters) {
parameter->SetOwner(this); parameter->SetOwner(this);
} }
} // namespace sem }
Function::~Function() = default; Function::~Function() = default;
@ -193,5 +192,4 @@ Function::TransitivelyReferencedSampledTextureVariablesImpl(
return ret; return ret;
} }
} // namespace sem } // namespace tint::sem
} // namespace tint

View File

@ -23,20 +23,21 @@
#include "src/tint/sem/call.h" #include "src/tint/sem/call.h"
#include "src/tint/utils/unique_vector.h" #include "src/tint/utils/unique_vector.h"
namespace tint {
// Forward declarations // Forward declarations
namespace tint {
namespace ast { namespace ast {
class BuiltinAttribute; class BuiltinAttribute;
class Function; class Function;
class LocationAttribute; class LocationAttribute;
class ReturnStatement; class ReturnStatement;
} // namespace ast } // namespace ast
namespace sem { namespace sem {
class Builtin; class Builtin;
class Variable; class Variable;
} // namespace sem
} // namespace tint
namespace tint::sem {
/// WorkgroupDimension describes the size of a single dimension of an entry /// WorkgroupDimension describes the size of a single dimension of an entry
/// point's workgroup size. /// point's workgroup size.
@ -283,7 +284,6 @@ class Function final : public Castable<Function, CallTarget> {
sem::Behaviors behaviors_{sem::Behavior::kNext}; sem::Behaviors behaviors_{sem::Behavior::kNext};
}; };
} // namespace sem } // namespace tint::sem
} // namespace tint
#endif // SRC_TINT_SEM_FUNCTION_H_ #endif // SRC_TINT_SEM_FUNCTION_H_

View File

@ -18,8 +18,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::sem::I32); TINT_INSTANTIATE_TYPEINFO(tint::sem::I32);
namespace tint { namespace tint::sem {
namespace sem {
I32::I32() = default; I32::I32() = default;
@ -51,5 +50,4 @@ uint32_t I32::Align() const {
return 4; return 4;
} }
} // namespace sem } // namespace tint::sem
} // namespace tint

View File

@ -19,8 +19,7 @@
#include "src/tint/sem/type.h" #include "src/tint/sem/type.h"
namespace tint { namespace tint::sem {
namespace sem {
/// A signed int 32 type. /// A signed int 32 type.
class I32 final : public Castable<I32, Type> { class I32 final : public Castable<I32, Type> {
@ -54,7 +53,6 @@ class I32 final : public Castable<I32, Type> {
uint32_t Align() const override; uint32_t Align() const override;
}; };
} // namespace sem } // namespace tint::sem
} // namespace tint
#endif // SRC_TINT_SEM_I32_TYPE_H_ #endif // SRC_TINT_SEM_I32_TYPE_H_

View File

@ -15,8 +15,7 @@
#include "src/tint/sem/test_helper.h" #include "src/tint/sem/test_helper.h"
#include "src/tint/sem/texture_type.h" #include "src/tint/sem/texture_type.h"
namespace tint { namespace tint::sem {
namespace sem {
namespace { namespace {
using I32Test = TestHelper; using I32Test = TestHelper;
@ -46,5 +45,4 @@ TEST_F(I32Test, FriendlyName) {
} }
} // namespace } // namespace
} // namespace sem } // namespace tint::sem
} // namespace tint

View File

@ -19,8 +19,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::sem::IfStatement); TINT_INSTANTIATE_TYPEINFO(tint::sem::IfStatement);
TINT_INSTANTIATE_TYPEINFO(tint::sem::ElseStatement); TINT_INSTANTIATE_TYPEINFO(tint::sem::ElseStatement);
namespace tint { namespace tint::sem {
namespace sem {
IfStatement::IfStatement(const ast::IfStatement* declaration, IfStatement::IfStatement(const ast::IfStatement* declaration,
const CompoundStatement* parent, const CompoundStatement* parent,
@ -44,5 +43,4 @@ const ast::ElseStatement* ElseStatement::Declaration() const {
return static_cast<const ast::ElseStatement*>(Base::Declaration()); return static_cast<const ast::ElseStatement*>(Base::Declaration());
} }
} // namespace sem } // namespace tint::sem
} // namespace tint

View File

@ -25,11 +25,10 @@ class ElseStatement;
} // namespace ast } // namespace ast
namespace sem { namespace sem {
class Expression; class Expression;
} // namespace sem }
} // namespace tint } // namespace tint
namespace tint { namespace tint::sem {
namespace sem {
/// Holds semantic information about an if statement /// Holds semantic information about an if statement
class IfStatement final : public Castable<IfStatement, CompoundStatement> { class IfStatement final : public Castable<IfStatement, CompoundStatement> {
@ -92,7 +91,6 @@ class ElseStatement final : public Castable<ElseStatement, CompoundStatement> {
const Expression* condition_ = nullptr; const Expression* condition_ = nullptr;
}; };
} // namespace sem } // namespace tint::sem
} // namespace tint
#endif // SRC_TINT_SEM_IF_STATEMENT_H_ #endif // SRC_TINT_SEM_IF_STATEMENT_H_

View File

@ -14,8 +14,7 @@
#include "src/tint/sem/info.h" #include "src/tint/sem/info.h"
namespace tint { namespace tint::sem {
namespace sem {
Info::Info() = default; Info::Info() = default;
@ -25,5 +24,4 @@ Info::~Info() = default;
Info& Info::operator=(Info&&) = default; Info& Info::operator=(Info&&) = default;
} // namespace sem } // namespace tint::sem
} // namespace tint

View File

@ -22,10 +22,12 @@
#include "src/tint/sem/node.h" #include "src/tint/sem/node.h"
#include "src/tint/sem/type_mappings.h" #include "src/tint/sem/type_mappings.h"
namespace tint::sem {
// Forward declarations // Forward declarations
namespace tint::sem {
class Module; class Module;
}
namespace tint::sem {
/// Info holds all the resolved semantic information for a Program. /// Info holds all the resolved semantic information for a Program.
class Info { class Info {

View File

@ -19,8 +19,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::sem::LoopStatement); TINT_INSTANTIATE_TYPEINFO(tint::sem::LoopStatement);
TINT_INSTANTIATE_TYPEINFO(tint::sem::LoopContinuingBlockStatement); TINT_INSTANTIATE_TYPEINFO(tint::sem::LoopContinuingBlockStatement);
namespace tint { namespace tint::sem {
namespace sem {
LoopStatement::LoopStatement(const ast::LoopStatement* declaration, LoopStatement::LoopStatement(const ast::LoopStatement* declaration,
const CompoundStatement* parent, const CompoundStatement* parent,
@ -42,5 +41,4 @@ LoopContinuingBlockStatement::LoopContinuingBlockStatement(
} }
LoopContinuingBlockStatement::~LoopContinuingBlockStatement() = default; LoopContinuingBlockStatement::~LoopContinuingBlockStatement() = default;
} // namespace sem } // namespace tint::sem
} // namespace tint

View File

@ -18,14 +18,11 @@
#include "src/tint/sem/block_statement.h" #include "src/tint/sem/block_statement.h"
// Forward declarations // Forward declarations
namespace tint { namespace tint::ast {
namespace ast {
class LoopStatement; class LoopStatement;
} // namespace ast }
} // namespace tint
namespace tint { namespace tint::sem {
namespace sem {
/// Holds semantic information about a loop statement /// Holds semantic information about a loop statement
class LoopStatement final : public Castable<LoopStatement, CompoundStatement> { class LoopStatement final : public Castable<LoopStatement, CompoundStatement> {
@ -58,7 +55,6 @@ class LoopContinuingBlockStatement final
~LoopContinuingBlockStatement() override; ~LoopContinuingBlockStatement() override;
}; };
} // namespace sem } // namespace tint::sem
} // namespace tint
#endif // SRC_TINT_SEM_LOOP_STATEMENT_H_ #endif // SRC_TINT_SEM_LOOP_STATEMENT_H_

View File

@ -20,8 +20,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::sem::Matrix); TINT_INSTANTIATE_TYPEINFO(tint::sem::Matrix);
namespace tint { namespace tint::sem {
namespace sem {
Matrix::Matrix(const Vector* column_type, uint32_t columns) Matrix::Matrix(const Vector* column_type, uint32_t columns)
: subtype_(column_type->type()), : subtype_(column_type->type()),
@ -74,5 +73,4 @@ uint32_t Matrix::ColumnStride() const {
return column_type_->Align(); return column_type_->Align();
} }
} // namespace sem } // namespace tint::sem
} // namespace tint

View File

@ -19,11 +19,12 @@
#include "src/tint/sem/type.h" #include "src/tint/sem/type.h"
namespace tint {
namespace sem {
// Forward declaration // Forward declaration
namespace tint::sem {
class Vector; class Vector;
}
namespace tint::sem {
/// A matrix type /// A matrix type
class Matrix final : public Castable<Matrix, Type> { class Matrix final : public Castable<Matrix, Type> {
@ -79,7 +80,6 @@ class Matrix final : public Castable<Matrix, Type> {
const uint32_t columns_; const uint32_t columns_;
}; };
} // namespace sem } // namespace tint::sem
} // namespace tint
#endif // SRC_TINT_SEM_MATRIX_TYPE_H_ #endif // SRC_TINT_SEM_MATRIX_TYPE_H_

View File

@ -15,8 +15,7 @@
#include "src/tint/sem/test_helper.h" #include "src/tint/sem/test_helper.h"
#include "src/tint/sem/texture_type.h" #include "src/tint/sem/texture_type.h"
namespace tint { namespace tint::sem {
namespace sem {
namespace { namespace {
using MatrixTest = TestHelper; using MatrixTest = TestHelper;
@ -73,5 +72,4 @@ TEST_F(MatrixTest, FriendlyName) {
} }
} // namespace } // namespace
} // namespace sem } // namespace tint::sem
} // namespace tint

View File

@ -21,8 +21,7 @@ TINT_INSTANTIATE_TYPEINFO(tint::sem::MemberAccessorExpression);
TINT_INSTANTIATE_TYPEINFO(tint::sem::StructMemberAccess); TINT_INSTANTIATE_TYPEINFO(tint::sem::StructMemberAccess);
TINT_INSTANTIATE_TYPEINFO(tint::sem::Swizzle); TINT_INSTANTIATE_TYPEINFO(tint::sem::Swizzle);
namespace tint { namespace tint::sem {
namespace sem {
MemberAccessorExpression::MemberAccessorExpression( MemberAccessorExpression::MemberAccessorExpression(
const ast::MemberAccessorExpression* declaration, const ast::MemberAccessorExpression* declaration,
@ -53,5 +52,4 @@ Swizzle::Swizzle(const ast::MemberAccessorExpression* declaration,
Swizzle::~Swizzle() = default; Swizzle::~Swizzle() = default;
} // namespace sem } // namespace tint::sem
} // namespace tint

View File

@ -19,18 +19,18 @@
#include "src/tint/sem/expression.h" #include "src/tint/sem/expression.h"
namespace tint {
/// Forward declarations /// Forward declarations
namespace tint {
namespace ast { namespace ast {
class MemberAccessorExpression; class MemberAccessorExpression;
} // namespace ast } // namespace ast
namespace sem { namespace sem {
/// Forward declarations
class Struct; class Struct;
class StructMember; class StructMember;
} // namespace sem
} // namespace tint
namespace tint::sem {
/// MemberAccessorExpression holds the semantic information for a /// MemberAccessorExpression holds the semantic information for a
/// ast::MemberAccessorExpression node. /// ast::MemberAccessorExpression node.
@ -105,7 +105,6 @@ class Swizzle final : public Castable<Swizzle, MemberAccessorExpression> {
std::vector<uint32_t> const indices_; std::vector<uint32_t> const indices_;
}; };
} // namespace sem } // namespace tint::sem
} // namespace tint
#endif // SRC_TINT_SEM_MEMBER_ACCESSOR_EXPRESSION_H_ #endif // SRC_TINT_SEM_MEMBER_ACCESSOR_EXPRESSION_H_

View File

@ -19,8 +19,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::sem::MultisampledTexture); TINT_INSTANTIATE_TYPEINFO(tint::sem::MultisampledTexture);
namespace tint { namespace tint::sem {
namespace sem {
MultisampledTexture::MultisampledTexture(ast::TextureDimension dim, MultisampledTexture::MultisampledTexture(ast::TextureDimension dim,
const Type* type) const Type* type)
@ -52,5 +51,4 @@ std::string MultisampledTexture::FriendlyName(
return out.str(); return out.str();
} }
} // namespace sem } // namespace tint::sem
} // namespace tint

View File

@ -19,8 +19,7 @@
#include "src/tint/sem/texture_type.h" #include "src/tint/sem/texture_type.h"
namespace tint { namespace tint::sem {
namespace sem {
/// A multisampled texture type. /// A multisampled texture type.
class MultisampledTexture final class MultisampledTexture final
@ -53,7 +52,6 @@ class MultisampledTexture final
const Type* const type_; const Type* const type_;
}; };
} // namespace sem } // namespace tint::sem
} // namespace tint
#endif // SRC_TINT_SEM_MULTISAMPLED_TEXTURE_TYPE_H_ #endif // SRC_TINT_SEM_MULTISAMPLED_TEXTURE_TYPE_H_

View File

@ -20,8 +20,7 @@
#include "src/tint/sem/storage_texture_type.h" #include "src/tint/sem/storage_texture_type.h"
#include "src/tint/sem/test_helper.h" #include "src/tint/sem/test_helper.h"
namespace tint { namespace tint::sem {
namespace sem {
namespace { namespace {
using MultisampledTextureTest = TestHelper; using MultisampledTextureTest = TestHelper;
@ -99,5 +98,4 @@ TEST_F(MultisampledTextureTest, FriendlyName) {
} }
} // namespace } // namespace
} // namespace sem } // namespace tint::sem
} // namespace tint

View File

@ -16,8 +16,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::sem::Node); TINT_INSTANTIATE_TYPEINFO(tint::sem::Node);
namespace tint { namespace tint::sem {
namespace sem {
Node::Node() = default; Node::Node() = default;
@ -25,5 +24,4 @@ Node::Node(const Node&) = default;
Node::~Node() = default; Node::~Node() = default;
} // namespace sem } // namespace tint::sem
} // namespace tint

View File

@ -17,8 +17,7 @@
#include "src/tint/castable.h" #include "src/tint/castable.h"
namespace tint { namespace tint::sem {
namespace sem {
/// Node is the base class for all semantic nodes /// Node is the base class for all semantic nodes
class Node : public Castable<Node> { class Node : public Castable<Node> {
@ -33,7 +32,6 @@ class Node : public Castable<Node> {
~Node() override; ~Node() override;
}; };
} // namespace sem } // namespace tint::sem
} // namespace tint
#endif // SRC_TINT_SEM_NODE_H_ #endif // SRC_TINT_SEM_NODE_H_

View File

@ -24,8 +24,7 @@
#include "src/tint/sem/parameter_usage.h" #include "src/tint/sem/parameter_usage.h"
namespace tint { namespace tint::sem {
namespace sem {
const char* str(ParameterUsage usage) { const char* str(ParameterUsage usage) {
switch (usage) { switch (usage) {
@ -61,5 +60,4 @@ const char* str(ParameterUsage usage) {
return "<unknown>"; return "<unknown>";
} }
} // namespace sem } // namespace tint::sem
} // namespace tint

View File

@ -10,8 +10,7 @@ See:
#include "src/tint/sem/parameter_usage.h" #include "src/tint/sem/parameter_usage.h"
namespace tint { namespace tint::sem {
namespace sem {
const char* str(ParameterUsage usage) { const char* str(ParameterUsage usage) {
switch (usage) { switch (usage) {
@ -25,5 +24,4 @@ const char* str(ParameterUsage usage) {
return "<unknown>"; return "<unknown>";
} }
} // namespace sem } // namespace tint::sem
} // namespace tint

View File

@ -25,8 +25,7 @@
#ifndef SRC_TINT_SEM_PARAMETER_USAGE_H_ #ifndef SRC_TINT_SEM_PARAMETER_USAGE_H_
#define SRC_TINT_SEM_PARAMETER_USAGE_H_ #define SRC_TINT_SEM_PARAMETER_USAGE_H_
namespace tint { namespace tint::sem {
namespace sem {
/// ParameterUsage is extra metadata for identifying a parameter based on its /// ParameterUsage is extra metadata for identifying a parameter based on its
/// overload position /// overload position
@ -50,7 +49,6 @@ enum class ParameterUsage {
/// @returns a string representation of the given parameter usage. /// @returns a string representation of the given parameter usage.
const char* str(ParameterUsage usage); const char* str(ParameterUsage usage);
} // namespace sem } // namespace tint::sem
} // namespace tint
#endif // SRC_TINT_SEM_PARAMETER_USAGE_H_ #endif // SRC_TINT_SEM_PARAMETER_USAGE_H_

View File

@ -11,8 +11,7 @@ See:
#ifndef SRC_TINT_SEM_PARAMETER_USAGE_H_ #ifndef SRC_TINT_SEM_PARAMETER_USAGE_H_
#define SRC_TINT_SEM_PARAMETER_USAGE_H_ #define SRC_TINT_SEM_PARAMETER_USAGE_H_
namespace tint { namespace tint::sem {
namespace sem {
/// ParameterUsage is extra metadata for identifying a parameter based on its /// ParameterUsage is extra metadata for identifying a parameter based on its
/// overload position /// overload position
@ -26,7 +25,6 @@ enum class ParameterUsage {
/// @returns a string representation of the given parameter usage. /// @returns a string representation of the given parameter usage.
const char* str(ParameterUsage usage); const char* str(ParameterUsage usage);
} // namespace sem } // namespace tint::sem
} // namespace tint
#endif // SRC_TINT_SEM_PARAMETER_USAGE_H_ #endif // SRC_TINT_SEM_PARAMETER_USAGE_H_

View File

@ -18,12 +18,10 @@
#include "src/tint/ast/pipeline_stage.h" #include "src/tint/ast/pipeline_stage.h"
#include "src/tint/utils/enum_set.h" #include "src/tint/utils/enum_set.h"
namespace tint { namespace tint::sem {
namespace sem {
using PipelineStageSet = utils::EnumSet<ast::PipelineStage>; using PipelineStageSet = utils::EnumSet<ast::PipelineStage>;
} // namespace sem } // namespace tint::sem
} // namespace tint
#endif // SRC_TINT_SEM_PIPELINE_STAGE_SET_H_ #endif // SRC_TINT_SEM_PIPELINE_STAGE_SET_H_

View File

@ -20,8 +20,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::sem::Pointer); TINT_INSTANTIATE_TYPEINFO(tint::sem::Pointer);
namespace tint { namespace tint::sem {
namespace sem {
Pointer::Pointer(const Type* subtype, Pointer::Pointer(const Type* subtype,
ast::StorageClass storage_class, ast::StorageClass storage_class,
@ -59,5 +58,4 @@ Pointer::Pointer(Pointer&&) = default;
Pointer::~Pointer() = default; Pointer::~Pointer() = default;
} // namespace sem } // namespace tint::sem
} // namespace tint

View File

@ -21,8 +21,7 @@
#include "src/tint/ast/storage_class.h" #include "src/tint/ast/storage_class.h"
#include "src/tint/sem/type.h" #include "src/tint/sem/type.h"
namespace tint { namespace tint::sem {
namespace sem {
/// A pointer type. /// A pointer type.
class Pointer final : public Castable<Pointer, Type> { class Pointer final : public Castable<Pointer, Type> {
@ -66,7 +65,6 @@ class Pointer final : public Castable<Pointer, Type> {
ast::Access const access_; ast::Access const access_;
}; };
} // namespace sem } // namespace tint::sem
} // namespace tint
#endif // SRC_TINT_SEM_POINTER_TYPE_H_ #endif // SRC_TINT_SEM_POINTER_TYPE_H_

View File

@ -15,8 +15,7 @@
#include "src/tint/sem/test_helper.h" #include "src/tint/sem/test_helper.h"
#include "src/tint/sem/texture_type.h" #include "src/tint/sem/texture_type.h"
namespace tint { namespace tint::sem {
namespace sem {
namespace { namespace {
using PointerTest = TestHelper; using PointerTest = TestHelper;
@ -93,5 +92,4 @@ TEST_F(PointerTest, FriendlyNameWithStorageClass) {
} }
} // namespace } // namespace
} // namespace sem } // namespace tint::sem
} // namespace tint

View File

@ -19,8 +19,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::sem::Reference); TINT_INSTANTIATE_TYPEINFO(tint::sem::Reference);
namespace tint { namespace tint::sem {
namespace sem {
Reference::Reference(const Type* subtype, Reference::Reference(const Type* subtype,
ast::StorageClass storage_class, ast::StorageClass storage_class,
@ -58,5 +57,4 @@ Reference::Reference(Reference&&) = default;
Reference::~Reference() = default; Reference::~Reference() = default;
} // namespace sem } // namespace tint::sem
} // namespace tint

View File

@ -21,8 +21,7 @@
#include "src/tint/ast/storage_class.h" #include "src/tint/ast/storage_class.h"
#include "src/tint/sem/type.h" #include "src/tint/sem/type.h"
namespace tint { namespace tint::sem {
namespace sem {
/// A reference type. /// A reference type.
class Reference final : public Castable<Reference, Type> { class Reference final : public Castable<Reference, Type> {
@ -66,7 +65,6 @@ class Reference final : public Castable<Reference, Type> {
ast::Access const access_; ast::Access const access_;
}; };
} // namespace sem } // namespace tint::sem
} // namespace tint
#endif // SRC_TINT_SEM_REFERENCE_TYPE_H_ #endif // SRC_TINT_SEM_REFERENCE_TYPE_H_

View File

@ -15,8 +15,7 @@
#include "src/tint/sem/reference_type.h" #include "src/tint/sem/reference_type.h"
#include "src/tint/sem/test_helper.h" #include "src/tint/sem/test_helper.h"
namespace tint { namespace tint::sem {
namespace sem {
namespace { namespace {
using ReferenceTest = TestHelper; using ReferenceTest = TestHelper;
@ -93,5 +92,4 @@ TEST_F(ReferenceTest, FriendlyNameWithStorageClass) {
} }
} // namespace } // namespace
} // namespace sem } // namespace tint::sem
} // namespace tint

View File

@ -19,8 +19,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::sem::SampledTexture); TINT_INSTANTIATE_TYPEINFO(tint::sem::SampledTexture);
namespace tint { namespace tint::sem {
namespace sem {
SampledTexture::SampledTexture(ast::TextureDimension dim, const Type* type) SampledTexture::SampledTexture(ast::TextureDimension dim, const Type* type)
: Base(dim), type_(type) { : Base(dim), type_(type) {
@ -49,5 +48,4 @@ std::string SampledTexture::FriendlyName(const SymbolTable& symbols) const {
return out.str(); return out.str();
} }
} // namespace sem } // namespace tint::sem
} // namespace tint

View File

@ -19,8 +19,7 @@
#include "src/tint/sem/texture_type.h" #include "src/tint/sem/texture_type.h"
namespace tint { namespace tint::sem {
namespace sem {
/// A sampled texture type. /// A sampled texture type.
class SampledTexture final : public Castable<SampledTexture, Texture> { class SampledTexture final : public Castable<SampledTexture, Texture> {
@ -52,7 +51,6 @@ class SampledTexture final : public Castable<SampledTexture, Texture> {
const Type* const type_; const Type* const type_;
}; };
} // namespace sem } // namespace tint::sem
} // namespace tint
#endif // SRC_TINT_SEM_SAMPLED_TEXTURE_TYPE_H_ #endif // SRC_TINT_SEM_SAMPLED_TEXTURE_TYPE_H_

View File

@ -19,8 +19,7 @@
#include "src/tint/sem/storage_texture_type.h" #include "src/tint/sem/storage_texture_type.h"
#include "src/tint/sem/test_helper.h" #include "src/tint/sem/test_helper.h"
namespace tint { namespace tint::sem {
namespace sem {
namespace { namespace {
using SampledTextureTest = TestHelper; using SampledTextureTest = TestHelper;
@ -91,5 +90,4 @@ TEST_F(SampledTextureTest, FriendlyName) {
} }
} // namespace } // namespace
} // namespace sem } // namespace tint::sem
} // namespace tint

View File

@ -20,8 +20,7 @@
#include "src/tint/sem/binding_point.h" #include "src/tint/sem/binding_point.h"
namespace tint { namespace tint::sem {
namespace sem {
/// Mapping of a sampler to a texture it samples. /// Mapping of a sampler to a texture it samples.
struct SamplerTexturePair { struct SamplerTexturePair {
@ -46,8 +45,7 @@ struct SamplerTexturePair {
} }
}; };
} // namespace sem } // namespace tint::sem
} // namespace tint
namespace std { namespace std {

View File

@ -19,8 +19,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::sem::Sampler); TINT_INSTANTIATE_TYPEINFO(tint::sem::Sampler);
namespace tint { namespace tint::sem {
namespace sem {
Sampler::Sampler(ast::SamplerKind kind) : kind_(kind) {} Sampler::Sampler(ast::SamplerKind kind) : kind_(kind) {}
@ -43,5 +42,4 @@ std::string Sampler::FriendlyName(const SymbolTable&) const {
return kind_ == ast::SamplerKind::kSampler ? "sampler" : "sampler_comparison"; return kind_ == ast::SamplerKind::kSampler ? "sampler" : "sampler_comparison";
} }
} // namespace sem } // namespace tint::sem
} // namespace tint

View File

@ -20,8 +20,7 @@
#include "src/tint/ast/sampler.h" #include "src/tint/ast/sampler.h"
#include "src/tint/sem/type.h" #include "src/tint/sem/type.h"
namespace tint { namespace tint::sem {
namespace sem {
/// A sampler type. /// A sampler type.
class Sampler final : public Castable<Sampler, Type> { class Sampler final : public Castable<Sampler, Type> {
@ -57,7 +56,6 @@ class Sampler final : public Castable<Sampler, Type> {
ast::SamplerKind const kind_; ast::SamplerKind const kind_;
}; };
} // namespace sem } // namespace tint::sem
} // namespace tint
#endif // SRC_TINT_SEM_SAMPLER_TYPE_H_ #endif // SRC_TINT_SEM_SAMPLER_TYPE_H_

View File

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

View File

@ -15,8 +15,7 @@
#include "src/tint/sem/test_helper.h" #include "src/tint/sem/test_helper.h"
#include "src/tint/sem/texture_type.h" #include "src/tint/sem/texture_type.h"
namespace tint { namespace tint::sem {
namespace sem {
namespace { namespace {
using ArrayTest = TestHelper; using ArrayTest = TestHelper;
@ -127,5 +126,4 @@ TEST_F(ArrayTest, FriendlyNameStaticSizedNonImplicitStride) {
} }
} // namespace } // namespace
} // namespace sem } // namespace tint::sem
} // namespace tint

View File

@ -16,8 +16,7 @@
#include "src/tint/sem/test_helper.h" #include "src/tint/sem/test_helper.h"
#include "src/tint/sem/texture_type.h" #include "src/tint/sem/texture_type.h"
namespace tint { namespace tint::sem {
namespace sem {
namespace { namespace {
using StructTest = TestHelper; using StructTest = TestHelper;
@ -120,5 +119,4 @@ TEST_F(StructTest, Layout) {
} }
} // namespace } // namespace
} // namespace sem } // namespace tint::sem
} // namespace tint

View File

@ -23,8 +23,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::sem::Statement); TINT_INSTANTIATE_TYPEINFO(tint::sem::Statement);
TINT_INSTANTIATE_TYPEINFO(tint::sem::CompoundStatement); TINT_INSTANTIATE_TYPEINFO(tint::sem::CompoundStatement);
namespace tint { namespace tint::sem {
namespace sem {
Statement::Statement(const ast::Statement* declaration, Statement::Statement(const ast::Statement* declaration,
const CompoundStatement* parent, const CompoundStatement* parent,
@ -44,5 +43,4 @@ CompoundStatement::CompoundStatement(const ast::Statement* declaration,
CompoundStatement::~CompoundStatement() = default; CompoundStatement::~CompoundStatement() = default;
} // namespace sem } // namespace tint::sem
} // namespace tint

View File

@ -26,16 +26,12 @@ class Statement;
} // namespace ast } // namespace ast
namespace sem { namespace sem {
class BlockStatement; class BlockStatement;
class CompoundStatement;
class Function;
} // namespace sem } // namespace sem
} // namespace tint } // namespace tint
namespace tint { namespace tint::sem {
namespace sem {
/// Forward declaration
class CompoundStatement;
class Function;
namespace detail { namespace detail {
/// FindFirstParentReturn is a traits helper for determining the return type for /// FindFirstParentReturn is a traits helper for determining the return type for
/// the template member function Statement::FindFirstParent(). /// the template member function Statement::FindFirstParent().
@ -182,7 +178,6 @@ const detail::FindFirstParentReturnType<TYPES...>* Statement::FindFirstParent()
return nullptr; return nullptr;
} }
} // namespace sem } // namespace tint::sem
} // namespace tint
#endif // SRC_TINT_SEM_STATEMENT_H_ #endif // SRC_TINT_SEM_STATEMENT_H_

View File

@ -19,8 +19,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::sem::StorageTexture); TINT_INSTANTIATE_TYPEINFO(tint::sem::StorageTexture);
namespace tint { namespace tint::sem {
namespace sem {
StorageTexture::StorageTexture(ast::TextureDimension dim, StorageTexture::StorageTexture(ast::TextureDimension dim,
ast::TexelFormat format, ast::TexelFormat format,
@ -87,5 +86,4 @@ sem::Type* StorageTexture::SubtypeFor(ast::TexelFormat format,
return nullptr; return nullptr;
} }
} // namespace sem } // namespace tint::sem
} // namespace tint

View File

@ -21,10 +21,12 @@
#include "src/tint/ast/storage_texture.h" #include "src/tint/ast/storage_texture.h"
#include "src/tint/sem/texture_type.h" #include "src/tint/sem/texture_type.h"
namespace tint { // Forward Declarations
namespace sem { namespace tint::sem {
class Manager; class Manager;
}
namespace tint::sem {
/// A storage texture type. /// A storage texture type.
class StorageTexture final : public Castable<StorageTexture, Texture> { class StorageTexture final : public Castable<StorageTexture, Texture> {
@ -75,7 +77,6 @@ class StorageTexture final : public Castable<StorageTexture, Texture> {
Type* const subtype_; Type* const subtype_;
}; };
} // namespace sem } // namespace tint::sem
} // namespace tint
#endif // SRC_TINT_SEM_STORAGE_TEXTURE_TYPE_H_ #endif // SRC_TINT_SEM_STORAGE_TEXTURE_TYPE_H_

View File

@ -19,8 +19,7 @@
#include "src/tint/sem/sampled_texture_type.h" #include "src/tint/sem/sampled_texture_type.h"
#include "src/tint/sem/test_helper.h" #include "src/tint/sem/test_helper.h"
namespace tint { namespace tint::sem {
namespace sem {
namespace { namespace {
struct StorageTextureTest : public TestHelper { struct StorageTextureTest : public TestHelper {
@ -152,5 +151,4 @@ TEST_F(StorageTextureTest, I32) {
} }
} // namespace } // namespace
} // namespace sem } // namespace tint::sem
} // namespace tint

View File

@ -26,8 +26,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::sem::Struct); TINT_INSTANTIATE_TYPEINFO(tint::sem::Struct);
TINT_INSTANTIATE_TYPEINFO(tint::sem::StructMember); TINT_INSTANTIATE_TYPEINFO(tint::sem::StructMember);
namespace tint { namespace tint::sem {
namespace sem {
Struct::Struct(const ast::Struct* declaration, Struct::Struct(const ast::Struct* declaration,
Symbol name, Symbol name,
@ -181,5 +180,4 @@ StructMember::StructMember(const ast::StructMember* declaration,
StructMember::~StructMember() = default; StructMember::~StructMember() = default;
} // namespace sem } // namespace tint::sem
} // namespace tint

View File

@ -27,18 +27,18 @@
#include "src/tint/sem/type.h" #include "src/tint/sem/type.h"
#include "src/tint/symbol.h" #include "src/tint/symbol.h"
namespace tint {
// Forward declarations // Forward declarations
namespace tint {
namespace ast { namespace ast {
class StructMember; class StructMember;
} // namespace ast } // namespace ast
namespace sem { namespace sem {
// Forward declarations
class StructMember; class StructMember;
class Type; class Type;
} // namespace sem
} // namespace tint
namespace tint::sem {
/// A vector of StructMember pointers. /// A vector of StructMember pointers.
using StructMemberList = std::vector<const StructMember*>; using StructMemberList = std::vector<const StructMember*>;
@ -230,7 +230,6 @@ class StructMember : public Castable<StructMember, Node> {
const uint32_t size_; const uint32_t size_;
}; };
} // namespace sem } // namespace tint::sem
} // namespace tint
#endif // SRC_TINT_SEM_STRUCT_H_ #endif // SRC_TINT_SEM_STRUCT_H_

View File

@ -19,8 +19,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::sem::CaseStatement); TINT_INSTANTIATE_TYPEINFO(tint::sem::CaseStatement);
TINT_INSTANTIATE_TYPEINFO(tint::sem::SwitchStatement); TINT_INSTANTIATE_TYPEINFO(tint::sem::SwitchStatement);
namespace tint { namespace tint::sem {
namespace sem {
SwitchStatement::SwitchStatement(const ast::SwitchStatement* declaration, SwitchStatement::SwitchStatement(const ast::SwitchStatement* declaration,
const CompoundStatement* parent, const CompoundStatement* parent,
@ -49,5 +48,4 @@ const ast::CaseStatement* CaseStatement::Declaration() const {
return static_cast<const ast::CaseStatement*>(Base::Declaration()); return static_cast<const ast::CaseStatement*>(Base::Declaration());
} }
} // namespace sem } // namespace tint::sem
} // namespace tint

View File

@ -18,15 +18,12 @@
#include "src/tint/sem/block_statement.h" #include "src/tint/sem/block_statement.h"
// Forward declarations // Forward declarations
namespace tint { namespace tint::ast {
namespace ast {
class CaseStatement; class CaseStatement;
class SwitchStatement; class SwitchStatement;
} // namespace ast } // namespace tint::ast
} // namespace tint
namespace tint { namespace tint::sem {
namespace sem {
/// Holds semantic information about an switch statement /// Holds semantic information about an switch statement
class SwitchStatement final class SwitchStatement final
@ -74,7 +71,6 @@ class CaseStatement final : public Castable<CaseStatement, CompoundStatement> {
const BlockStatement* body_ = nullptr; const BlockStatement* body_ = nullptr;
}; };
} // namespace sem } // namespace tint::sem
} // namespace tint
#endif // SRC_TINT_SEM_SWITCH_STATEMENT_H_ #endif // SRC_TINT_SEM_SWITCH_STATEMENT_H_

View File

@ -20,8 +20,7 @@
#include "gtest/gtest.h" #include "gtest/gtest.h"
#include "src/tint/program_builder.h" #include "src/tint/program_builder.h"
namespace tint { namespace tint::sem {
namespace sem {
/// Helper class for testing /// Helper class for testing
template <typename BASE> template <typename BASE>
@ -43,7 +42,6 @@ using TestHelper = TestHelperBase<testing::Test>;
template <typename T> template <typename T>
using TestParamHelper = TestHelperBase<testing::TestWithParam<T>>; using TestParamHelper = TestHelperBase<testing::TestWithParam<T>>;
} // namespace sem } // namespace tint::sem
} // namespace tint
#endif // SRC_TINT_SEM_TEST_HELPER_H_ #endif // SRC_TINT_SEM_TEST_HELPER_H_

View File

@ -16,8 +16,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::sem::Texture); TINT_INSTANTIATE_TYPEINFO(tint::sem::Texture);
namespace tint { namespace tint::sem {
namespace sem {
Texture::Texture(ast::TextureDimension dim) : dim_(dim) {} Texture::Texture(ast::TextureDimension dim) : dim_(dim) {}
@ -25,5 +24,4 @@ Texture::Texture(Texture&&) = default;
Texture::~Texture() = default; Texture::~Texture() = default;
} // namespace sem } // namespace tint::sem
} // namespace tint

View File

@ -18,8 +18,7 @@
#include "src/tint/ast/texture.h" #include "src/tint/ast/texture.h"
#include "src/tint/sem/type.h" #include "src/tint/sem/type.h"
namespace tint { namespace tint::sem {
namespace sem {
/// A texture type. /// A texture type.
class Texture : public Castable<Texture, Type> { class Texture : public Castable<Texture, Type> {
@ -38,7 +37,6 @@ class Texture : public Castable<Texture, Type> {
ast::TextureDimension const dim_; ast::TextureDimension const dim_;
}; };
} // namespace sem } // namespace tint::sem
} // namespace tint
#endif // SRC_TINT_SEM_TEXTURE_TYPE_H_ #endif // SRC_TINT_SEM_TEXTURE_TYPE_H_

View File

@ -17,8 +17,7 @@
#include "src/tint/sem/sampled_texture_type.h" #include "src/tint/sem/sampled_texture_type.h"
#include "src/tint/sem/test_helper.h" #include "src/tint/sem/test_helper.h"
namespace tint { namespace tint::sem {
namespace sem {
namespace { namespace {
using TextureTypeDimTest = TestParamHelper<ast::TextureDimension>; using TextureTypeDimTest = TestParamHelper<ast::TextureDimension>;
@ -42,5 +41,4 @@ INSTANTIATE_TEST_SUITE_P(Dimensions,
ast::TextureDimension::kCubeArray)); ast::TextureDimension::kCubeArray));
} // namespace } // namespace
} // namespace sem } // namespace tint::sem
} // namespace tint

View File

@ -27,8 +27,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::sem::Type); TINT_INSTANTIATE_TYPEINFO(tint::sem::Type);
namespace tint { namespace tint::sem {
namespace sem {
Type::Type() = default; Type::Type() = default;
@ -154,5 +153,4 @@ bool Type::is_handle() const {
return IsAnyOf<Sampler, Texture>(); return IsAnyOf<Sampler, Texture>();
} }
} // namespace sem } // namespace tint::sem
} // namespace tint

View File

@ -20,13 +20,13 @@
#include "src/tint/sem/node.h" #include "src/tint/sem/node.h"
namespace tint {
// Forward declarations // Forward declarations
namespace tint {
class ProgramBuilder; class ProgramBuilder;
class SymbolTable; class SymbolTable;
} // namespace tint
namespace sem { namespace tint::sem {
/// Supported memory layouts for calculating sizes /// Supported memory layouts for calculating sizes
enum class MemoryLayout { kUniformBuffer, kStorageBuffer }; enum class MemoryLayout { kUniformBuffer, kStorageBuffer };
@ -118,8 +118,7 @@ class Type : public Castable<Type, Node> {
Type(); Type();
}; };
} // namespace sem } // namespace tint::sem
} // namespace tint
namespace std { namespace std {

View File

@ -16,8 +16,7 @@
TINT_INSTANTIATE_TYPEINFO(tint::sem::TypeConstructor); TINT_INSTANTIATE_TYPEINFO(tint::sem::TypeConstructor);
namespace tint { namespace tint::sem {
namespace sem {
TypeConstructor::TypeConstructor(const sem::Type* type, TypeConstructor::TypeConstructor(const sem::Type* type,
const ParameterList& parameters) const ParameterList& parameters)
@ -25,5 +24,4 @@ TypeConstructor::TypeConstructor(const sem::Type* type,
TypeConstructor::~TypeConstructor() = default; TypeConstructor::~TypeConstructor() = default;
} // namespace sem } // namespace tint::sem
} // namespace tint

View File

@ -17,8 +17,7 @@
#include "src/tint/sem/call_target.h" #include "src/tint/sem/call_target.h"
namespace tint { namespace tint::sem {
namespace sem {
/// TypeConstructor is the CallTarget for a type constructor. /// TypeConstructor is the CallTarget for a type constructor.
class TypeConstructor final : public Castable<TypeConstructor, CallTarget> { class TypeConstructor final : public Castable<TypeConstructor, CallTarget> {
@ -32,7 +31,6 @@ class TypeConstructor final : public Castable<TypeConstructor, CallTarget> {
~TypeConstructor() override; ~TypeConstructor() override;
}; };
} // namespace sem } // namespace tint::sem
} // namespace tint
#endif // SRC_TINT_SEM_TYPE_CONSTRUCTOR_H_ #endif // SRC_TINT_SEM_TYPE_CONSTRUCTOR_H_

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