ast/module: Additional documentation for type methods
Bug: tint:337
Change-Id: I60dae81baba3c5c85efa277e772f4a1f12589e11
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/33786
Auto-Submit: Ben Clayton <bclayton@google.com>
Commit-Queue: David Neto <dneto@google.com>
Reviewed-by: David Neto <dneto@google.com>
diff --git a/src/ast/module.h b/src/ast/module.h
index 0b2aa60..a688cc9 100644
--- a/src/ast/module.h
+++ b/src/ast/module.h
@@ -101,8 +101,13 @@
/// Creates a new `ast::Type` owned by the Module.
/// When the Module is destructed, owned Module and the returned
/// `ast::Type` will also be destructed.
- /// Types are unique (de-aliased), and so `create()` for the same `T` and
- /// arguments will return the same pointer.
+ /// Types are unique (de-aliased), and so calling create() for the same `T`
+ /// and arguments will return the same pointer.
+ /// @warning Use this method to acquire a type only if all of its type
+ /// information is provided in the constructor arguments `args`.<br>
+ /// If the type requires additional configuration after construction that
+ /// affect its fundamental type, build the type with `std::make_unique`, make
+ /// any necessary alterations and then call unique_type() instead.
/// @param args the arguments to pass to the type constructor
/// @returns the de-aliased type pointer
template <typename T, typename... ARGS>
@@ -116,6 +121,7 @@
/// (de-aliased) type.
/// When the Module is destructed, the returned `ast::Type` will also be
/// destructed.
+ /// @see create()
/// @param ty the type to add to the module
/// @returns the de-aliased type pointer
template <typename T>