tint: Fix doxygen errors

Change-Id: I19324ccbf989a66c088f8886411f050820b46d5b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86306
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
This commit is contained in:
Ben Clayton 2022-04-11 17:47:10 +00:00 committed by Dawn LUCI CQ
parent be352ea5b9
commit 05caf3a20f
9 changed files with 27 additions and 12 deletions

View File

@ -149,6 +149,7 @@ struct Construct {
const uint32_t scope_end_pos = 0; const uint32_t scope_end_pos = 0;
}; };
/// ConstructList is a list of Construct unique pointers.
using ConstructList = std::vector<std::unique_ptr<Construct>>; using ConstructList = std::vector<std::unique_ptr<Construct>>;
/// Converts a construct kind to a string. /// Converts a construct kind to a string.

View File

@ -175,6 +175,10 @@ struct BlockInfo {
std::vector<uint32_t> phis_needing_state_vars; std::vector<uint32_t> phis_needing_state_vars;
}; };
/// Writes the BlockInfo to the ostream
/// @param o the ostream
/// @param bi the BlockInfo
/// @returns the ostream so calls can be chained
inline std::ostream& operator<<(std::ostream& o, const BlockInfo& bi) { inline std::ostream& operator<<(std::ostream& o, const BlockInfo& bi) {
o << "BlockInfo{" o << "BlockInfo{"
<< " id: " << bi.id << " pos: " << bi.pos << " id: " << bi.id << " pos: " << bi.pos
@ -312,6 +316,10 @@ struct DefInfo {
SkipReason skip = SkipReason::kDontSkip; SkipReason skip = SkipReason::kDontSkip;
}; };
/// Writes the DefInfo to the ostream
/// @param o the ostream
/// @param di the DefInfo
/// @returns the ostream so calls can be chained
inline std::ostream& operator<<(std::ostream& o, const DefInfo& di) { inline std::ostream& operator<<(std::ostream& o, const DefInfo& di) {
o << "DefInfo{" o << "DefInfo{"
<< " inst.result_id: " << di.inst.result_id() << " inst.result_id: " << di.inst.result_id()

View File

@ -58,6 +58,8 @@ namespace tint::reader::spirv {
/// Example: { SpvDecorationBlock } /// Example: { SpvDecorationBlock }
/// Example: { SpvDecorationArrayStride, 16 } /// Example: { SpvDecorationArrayStride, 16 }
using Decoration = std::vector<uint32_t>; using Decoration = std::vector<uint32_t>;
/// DecorationList is a list of decorations
using DecorationList = std::vector<Decoration>; using DecorationList = std::vector<Decoration>;
/// An AST expression with its type. /// An AST expression with its type.

View File

@ -307,7 +307,8 @@ class SpvParserTestBase : public T {
} }
}; };
// Use this form when you don't need to template any further. /// SpvParserTest the the base class for SPIR-V reader unit tests.
/// Use this form when you don't need to template any further.
using SpvParserTest = SpvParserTestBase<::testing::Test>; using SpvParserTest = SpvParserTestBase<::testing::Test>;
} // namespace tint::reader::spirv } // namespace tint::reader::spirv

View File

@ -119,55 +119,47 @@ struct StorageTextureHasher {
}; };
} // namespace } // namespace
// Equality operators
//! @cond Doxygen_Suppress
static bool operator==(const Pointer& a, const Pointer& b) { static bool operator==(const Pointer& a, const Pointer& b) {
return a.type == b.type && a.storage_class == b.storage_class; return a.type == b.type && a.storage_class == b.storage_class;
} }
static bool operator==(const Reference& a, const Reference& b) { static bool operator==(const Reference& a, const Reference& b) {
return a.type == b.type && a.storage_class == b.storage_class; return a.type == b.type && a.storage_class == b.storage_class;
} }
static bool operator==(const Vector& a, const Vector& b) { static bool operator==(const Vector& a, const Vector& b) {
return a.type == b.type && a.size == b.size; return a.type == b.type && a.size == b.size;
} }
static bool operator==(const Matrix& a, const Matrix& b) { static bool operator==(const Matrix& a, const Matrix& b) {
return a.type == b.type && a.columns == b.columns && a.rows == b.rows; return a.type == b.type && a.columns == b.columns && a.rows == b.rows;
} }
static bool operator==(const Array& a, const Array& b) { static bool operator==(const Array& a, const Array& b) {
return a.type == b.type && a.size == b.size && a.stride == b.stride; return a.type == b.type && a.size == b.size && a.stride == b.stride;
} }
static bool operator==(const Named& a, const Named& b) { static bool operator==(const Named& a, const Named& b) {
return a.name == b.name; return a.name == b.name;
} }
static bool operator==(const Sampler& a, const Sampler& b) { static bool operator==(const Sampler& a, const Sampler& b) {
return a.kind == b.kind; return a.kind == b.kind;
} }
static bool operator==(const DepthTexture& a, const DepthTexture& b) { static bool operator==(const DepthTexture& a, const DepthTexture& b) {
return a.dims == b.dims; return a.dims == b.dims;
} }
static bool operator==(const DepthMultisampledTexture& a, static bool operator==(const DepthMultisampledTexture& a,
const DepthMultisampledTexture& b) { const DepthMultisampledTexture& b) {
return a.dims == b.dims; return a.dims == b.dims;
} }
static bool operator==(const MultisampledTexture& a, static bool operator==(const MultisampledTexture& a,
const MultisampledTexture& b) { const MultisampledTexture& b) {
return a.dims == b.dims && a.type == b.type; return a.dims == b.dims && a.type == b.type;
} }
static bool operator==(const SampledTexture& a, const SampledTexture& b) { static bool operator==(const SampledTexture& a, const SampledTexture& b) {
return a.dims == b.dims && a.type == b.type; return a.dims == b.dims && a.type == b.type;
} }
static bool operator==(const StorageTexture& a, const StorageTexture& b) { static bool operator==(const StorageTexture& a, const StorageTexture& b) {
return a.dims == b.dims && a.format == b.format; return a.dims == b.dims && a.format == b.format;
} }
//! @endcond
const ast::Type* Void::Build(ProgramBuilder& b) const { const ast::Type* Void::Build(ProgramBuilder& b) const {
return b.ty.void_(); return b.ty.void_();

View File

@ -87,6 +87,7 @@ class Type : public Castable<Type> {
#endif // NDEBUG #endif // NDEBUG
}; };
/// TypeList is a list of Types
using TypeList = std::vector<const Type*>; using TypeList = std::vector<const Type*>;
/// `void` type /// `void` type

View File

@ -124,6 +124,10 @@ class Usage {
bool is_storage_write_ = false; bool is_storage_write_ = false;
}; };
/// Writes the Usage to the ostream
/// @param out the ostream
/// @param u the Usage
/// @returns the ostream so calls can be chained
inline std::ostream& operator<<(std::ostream& out, const Usage& u) { inline std::ostream& operator<<(std::ostream& out, const Usage& u) {
return u.operator<<(out); return u.operator<<(out);
} }

View File

@ -68,6 +68,7 @@ struct SanitizedResult {
/// Sanitize a program in preparation for generating HLSL. /// Sanitize a program in preparation for generating HLSL.
/// @program The program to sanitize /// @program The program to sanitize
/// @param program the input program
/// @param options The HLSL generator options. /// @param options The HLSL generator options.
/// @returns the sanitized program and any supplementary information /// @returns the sanitized program and any supplementary information
SanitizedResult Sanitize(const Program* program, const Options& options); SanitizedResult Sanitize(const Program* program, const Options& options);

View File

@ -105,8 +105,13 @@ class TestHelperBase : public BODY, public ProgramBuilder {
private: private:
std::unique_ptr<GeneratorImpl> gen_; std::unique_ptr<GeneratorImpl> gen_;
}; };
/// TestHelper the the base class for HLSL writer unit tests.
/// Use this form when you don't need to template any further.
using TestHelper = TestHelperBase<testing::Test>; using TestHelper = TestHelperBase<testing::Test>;
/// TestParamHelper the the base class for HLSL unit tests that take a templated
/// parameter.
template <typename T> template <typename T>
using TestParamHelper = TestHelperBase<testing::TestWithParam<T>>; using TestParamHelper = TestHelperBase<testing::TestWithParam<T>>;