mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-10 22:17:51 +00:00
Move the ast node ownership from Context to Module
Fixes: tint:335 Change-Id: I128e229daa56d43e7227ecab72269be33b3ee012 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/33240 Commit-Queue: Ben Clayton <bclayton@google.com> Auto-Submit: Ben Clayton <bclayton@google.com> Reviewed-by: dan sinclair <dsinclair@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
627732c408
commit
2f4096b0d7
@@ -41,13 +41,13 @@ class ValidatorTestHelper {
|
||||
/// @return a pointer to the test module
|
||||
ast::Module* mod() { return &mod_; }
|
||||
|
||||
/// Creates a new `ast::Node` owned by the Context. When the Context is
|
||||
/// Creates a new `ast::Node` owned by the Module. When the Module is
|
||||
/// destructed, the `ast::Node` will also be destructed.
|
||||
/// @param args the arguments to pass to the type constructor
|
||||
/// @returns the node pointer
|
||||
template <typename T, typename... ARGS>
|
||||
T* create(ARGS&&... args) {
|
||||
return ctx_.create<T>(std::forward<ARGS>(args)...);
|
||||
return mod_.create<T>(std::forward<ARGS>(args)...);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user