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

@@ -76,13 +76,13 @@ class BoundArrayAccessorsTest : public testing::Test {
Manager* manager() { return manager_.get(); }
/// 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:

View File

@@ -44,13 +44,13 @@ class Transformer {
const std::string& error() { return error_; }
protected:
/// 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)...);
}
/// The context

View File

@@ -86,13 +86,13 @@ class VertexPullingTransformHelper {
Manager* manager() { return manager_.get(); }
VertexPullingTransform* transform() { return transform_; }
/// 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: