diff --git a/src/transform/manager.cc b/src/transform/manager.cc index a7b336463d..24476051f4 100644 --- a/src/transform/manager.cc +++ b/src/transform/manager.cc @@ -14,10 +14,15 @@ #include "src/transform/manager.h" +#include "src/type_determiner.h" + namespace tint { namespace transform { -Manager::Manager() = default; +Manager::Manager() : context_(nullptr), module_(nullptr) {} + +Manager::Manager(Context* context, ast::Module* module) + : context_(context), module_(module) {} Manager::~Manager() = default; @@ -28,6 +33,17 @@ bool Manager::Run() { return false; } } + + if (context_ != nullptr && module_ != nullptr) { + // The transformed have potentially inserted nodes into the AST, so the type + // determinater needs to be run. + TypeDeterminer td(context_, module_); + if (!td.Determine()) { + error_ = td.error(); + return false; + } + } + return true; } diff --git a/src/transform/manager.h b/src/transform/manager.h index 2848ec9a57..9f88e83e6a 100644 --- a/src/transform/manager.h +++ b/src/transform/manager.h @@ -31,7 +31,11 @@ namespace transform { class Manager { public: /// Constructor + /// DEPRECATED Manager(); + /// @param ctx the tint context + /// @param mod the module to transform + Manager(Context* context, ast::Module* module); ~Manager(); /// Add pass to the manager @@ -48,6 +52,8 @@ class Manager { std::string error() const { return error_; } private: + Context* context_; + ast::Module* module_; std::vector> transforms_; std::string error_;