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:
Ben Clayton
2020-11-18 20:58:20 +00:00
committed by Commit Bot service account
parent 627732c408
commit 2f4096b0d7
23 changed files with 85 additions and 82 deletions

View File

@@ -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: