Fixup compilation issues with type manager.

This CL fixes up some issues with the type manager.

TBR=dneto@google.com

Change-Id: I2d05935f26490fd8d20b1b6b1b61692a45e4a0f3
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/17940
Reviewed-by: dan sinclair <dsinclair@google.com>
diff --git a/src/reader/spirv/parser_impl.cc b/src/reader/spirv/parser_impl.cc
index f0fe50f..2d3a953 100644
--- a/src/reader/spirv/parser_impl.cc
+++ b/src/reader/spirv/parser_impl.cc
@@ -48,7 +48,6 @@
 
 ParserImpl::ParserImpl(Context* ctx, const std::vector<uint32_t>& spv_binary)
     : Reader(ctx),
-      ctx_(ctx),
       spv_binary_(spv_binary),
       fail_stream_(&success_, &errors_),
       namer_(fail_stream_),
@@ -188,7 +187,7 @@
       auto* ast_elem_ty =
           ConvertType(type_mgr_->GetId(rtarr_ty->element_type()));
       if (ast_elem_ty != nullptr) {
-        result = ctx_.type_mgr->Get(
+        result = ctx_.type_mgr().Get(
             std::make_unique<ast::type::ArrayType>(ast_elem_ty));
       }
       // In the error case, we'll already have emitted a diagnostic.
@@ -229,7 +228,7 @@
                << num_elem;
         return nullptr;
       }
-      result = ctx_.type_mgr->Get(std::make_unique<ast::type::ArrayType>(
+      result = ctx_.type_mgr().Get(std::make_unique<ast::type::ArrayType>(
           ast_elem_ty, static_cast<uint32_t>(num_elem)));
       break;
     }
diff --git a/src/reader/spirv/parser_impl.h b/src/reader/spirv/parser_impl.h
index 9c4fa58..a422cb6 100644
--- a/src/reader/spirv/parser_impl.h
+++ b/src/reader/spirv/parser_impl.h
@@ -122,8 +122,6 @@
   /// Emit entry point AST nodes.
   bool EmitEntryPoints();
 
-  // The Tint context
-  Context ctx_;
   // The SPIR-V binary we're parsing
   std::vector<uint32_t> spv_binary_;
 
diff --git a/src/reader/spirv/parser_impl_test_helper.h b/src/reader/spirv/parser_impl_test_helper.h
index 8c40a2b..66a48df 100644
--- a/src/reader/spirv/parser_impl_test_helper.h
+++ b/src/reader/spirv/parser_impl_test_helper.h
@@ -37,9 +37,7 @@
   void SetUp() { ctx_.Reset(); }
 
   /// Tears down the test helper
-  void TearDown() {
-    impl_ = nullptr;
-  }
+  void TearDown() { impl_ = nullptr; }
 
   /// Retrieves the parser from the helper
   /// @param input the SPIR-V binary to parse
diff --git a/src/reader/wgsl/parser_impl.cc b/src/reader/wgsl/parser_impl.cc
index f2131f5..70ed71f 100644
--- a/src/reader/wgsl/parser_impl.cc
+++ b/src/reader/wgsl/parser_impl.cc
@@ -2093,7 +2093,7 @@
   if (t.IsTrue()) {
     next();  // Consume the peek
 
-    auto type = ctx_.type_mgr->Get(std::make_unique<ast::type::BoolType>());
+    auto type = ctx_.type_mgr().Get(std::make_unique<ast::type::BoolType>());
     if (!type) {
       return nullptr;
     }
@@ -2101,7 +2101,7 @@
   }
   if (t.IsFalse()) {
     next();  // Consume the peek
-    auto type = ctx_.type_mgr->Get(std::make_unique<ast::type::BoolType>());
+    auto type = ctx_.type_mgr().Get(std::make_unique<ast::type::BoolType>());
     if (!type) {
       return nullptr;
     }
@@ -2109,7 +2109,7 @@
   }
   if (t.IsIntLiteral()) {
     next();  // Consume the peek
-    auto type = ctx_.type_mgr->Get(std::make_unique<ast::type::I32Type>());
+    auto type = ctx_.type_mgr().Get(std::make_unique<ast::type::I32Type>());
     if (!type) {
       return nullptr;
     }
@@ -2117,7 +2117,7 @@
   }
   if (t.IsUintLiteral()) {
     next();  // Consume the peek
-    auto type = ctx_.type_mgr->Get(std::make_unique<ast::type::U32Type>());
+    auto type = ctx_.type_mgr().Get(std::make_unique<ast::type::U32Type>());
     if (!type) {
       return nullptr;
     }
@@ -2125,7 +2125,7 @@
   }
   if (t.IsFloatLiteral()) {
     next();  // Consume the peek
-    auto type = ctx_.type_mgr->Get(std::make_unique<ast::type::F32Type>());
+    auto type = ctx_.type_mgr().Get(std::make_unique<ast::type::F32Type>());
     if (!type) {
       return nullptr;
     }
diff --git a/src/reader/wgsl/parser_impl_builtin_decoration_test.cc b/src/reader/wgsl/parser_impl_builtin_decoration_test.cc
index 09755b6..47cb2f8 100644
--- a/src/reader/wgsl/parser_impl_builtin_decoration_test.cc
+++ b/src/reader/wgsl/parser_impl_builtin_decoration_test.cc
@@ -38,9 +38,7 @@
 
   void SetUp() { ctx_.Reset(); }
 
-  void TearDown() {
-    impl_ = nullptr;
-  }
+  void TearDown() { impl_ = nullptr; }
 
   ParserImpl* parser(const std::string& str) {
     impl_ = std::make_unique<ParserImpl>(&ctx_, str);
diff --git a/src/reader/wgsl/parser_impl_derivative_modifier_test.cc b/src/reader/wgsl/parser_impl_derivative_modifier_test.cc
index b73469a..72e88f4 100644
--- a/src/reader/wgsl/parser_impl_derivative_modifier_test.cc
+++ b/src/reader/wgsl/parser_impl_derivative_modifier_test.cc
@@ -40,9 +40,7 @@
 
   void SetUp() { ctx_.Reset(); }
 
-  void TearDown() {
-    impl_ = nullptr;
-  }
+  void TearDown() { impl_ = nullptr; }
 
   ParserImpl* parser(const std::string& str) {
     impl_ = std::make_unique<ParserImpl>(&ctx_, str);
diff --git a/src/reader/wgsl/parser_impl_pipeline_stage_test.cc b/src/reader/wgsl/parser_impl_pipeline_stage_test.cc
index f280575..b566534 100644
--- a/src/reader/wgsl/parser_impl_pipeline_stage_test.cc
+++ b/src/reader/wgsl/parser_impl_pipeline_stage_test.cc
@@ -38,9 +38,7 @@
 
   void SetUp() { ctx_.Reset(); }
 
-  void TearDown() {
-    impl_ = nullptr;
-  }
+  void TearDown() { impl_ = nullptr; }
 
   ParserImpl* parser(const std::string& str) {
     impl_ = std::make_unique<ParserImpl>(&ctx_, str);
diff --git a/src/reader/wgsl/parser_impl_storage_class_test.cc b/src/reader/wgsl/parser_impl_storage_class_test.cc
index 7c27682..923dd76 100644
--- a/src/reader/wgsl/parser_impl_storage_class_test.cc
+++ b/src/reader/wgsl/parser_impl_storage_class_test.cc
@@ -38,9 +38,7 @@
 
   void SetUp() { ctx_.Reset(); }
 
-  void TearDown() {
-    impl_ = nullptr;
-  }
+  void TearDown() { impl_ = nullptr; }
 
   ParserImpl* parser(const std::string& str) {
     impl_ = std::make_unique<ParserImpl>(&ctx_, str);
diff --git a/src/reader/wgsl/parser_impl_struct_decoration_test.cc b/src/reader/wgsl/parser_impl_struct_decoration_test.cc
index d32e2ab..b87ecbe 100644
--- a/src/reader/wgsl/parser_impl_struct_decoration_test.cc
+++ b/src/reader/wgsl/parser_impl_struct_decoration_test.cc
@@ -39,9 +39,7 @@
 
   void SetUp() { ctx_.Reset(); }
 
-  void TearDown() {
-    impl_ = nullptr;
-  }
+  void TearDown() { impl_ = nullptr; }
 
   ParserImpl* parser(const std::string& str) {
     impl_ = std::make_unique<ParserImpl>(&ctx_, str);
diff --git a/src/reader/wgsl/parser_impl_test_helper.h b/src/reader/wgsl/parser_impl_test_helper.h
index a58b32f..fd177e9 100644
--- a/src/reader/wgsl/parser_impl_test_helper.h
+++ b/src/reader/wgsl/parser_impl_test_helper.h
@@ -37,9 +37,7 @@
   void SetUp() { ctx_.Reset(); }
 
   /// Tears down the test helper
-  void TearDown() {
-    impl_ = nullptr;
-  }
+  void TearDown() { impl_ = nullptr; }
 
   /// Retrieves the parser from the helper
   /// @param str the string to parse
diff --git a/src/reader/wgsl/parser_impl_type_decl_test.cc b/src/reader/wgsl/parser_impl_type_decl_test.cc
index df8b65f..d8119ef 100644
--- a/src/reader/wgsl/parser_impl_type_decl_test.cc
+++ b/src/reader/wgsl/parser_impl_type_decl_test.cc
@@ -127,9 +127,7 @@
 
   void SetUp() { ctx_.Reset(); }
 
-  void TearDown() {
-    impl_ = nullptr;
-  }
+  void TearDown() { impl_ = nullptr; }
 
   ParserImpl* parser(const std::string& str) {
     impl_ = std::make_unique<ParserImpl>(&ctx_, str);
@@ -163,9 +161,7 @@
 
   void SetUp() { ctx_.Reset(); }
 
-  void TearDown() {
-    impl_ = nullptr;
-  }
+  void TearDown() { impl_ = nullptr; }
 
   ParserImpl* parser(const std::string& str) {
     impl_ = std::make_unique<ParserImpl>(&ctx_, str);
@@ -198,9 +194,7 @@
 
   void SetUp() { ctx_.Reset(); }
 
-  void TearDown() {
-    impl_ = nullptr;
-  }
+  void TearDown() { impl_ = nullptr; }
 
   ParserImpl* parser(const std::string& str) {
     impl_ = std::make_unique<ParserImpl>(&ctx_, str);
@@ -233,9 +227,7 @@
 
   void SetUp() { ctx_.Reset(); }
 
-  void TearDown() {
-    impl_ = nullptr;
-  }
+  void TearDown() { impl_ = nullptr; }
 
   ParserImpl* parser(const std::string& str) {
     impl_ = std::make_unique<ParserImpl>(&ctx_, str);
@@ -268,9 +260,7 @@
 
   void SetUp() { ctx_.Reset(); }
 
-  void TearDown() {
-    impl_ = nullptr;
-  }
+  void TearDown() { impl_ = nullptr; }
 
   ParserImpl* parser(const std::string& str) {
     impl_ = std::make_unique<ParserImpl>(&ctx_, str);
@@ -485,9 +475,7 @@
 
   void SetUp() { ctx_.Reset(); }
 
-  void TearDown() {
-    impl_ = nullptr;
-  }
+  void TearDown() { impl_ = nullptr; }
 
   ParserImpl* parser(const std::string& str) {
     impl_ = std::make_unique<ParserImpl>(&ctx_, str);
@@ -529,9 +517,7 @@
 
   void SetUp() { ctx_.Reset(); }
 
-  void TearDown() {
-    impl_ = nullptr;
-  }
+  void TearDown() { impl_ = nullptr; }
 
   ParserImpl* parser(const std::string& str) {
     impl_ = std::make_unique<ParserImpl>(&ctx_, str);
@@ -569,9 +555,7 @@
 
   void SetUp() { ctx_.Reset(); }
 
-  void TearDown() {
-    impl_ = nullptr;
-  }
+  void TearDown() { impl_ = nullptr; }
 
   ParserImpl* parser(const std::string& str) {
     impl_ = std::make_unique<ParserImpl>(&ctx_, str);
@@ -609,9 +593,7 @@
 
   void SetUp() { ctx_.Reset(); }
 
-  void TearDown() {
-    impl_ = nullptr;
-  }
+  void TearDown() { impl_ = nullptr; }
 
   ParserImpl* parser(const std::string& str) {
     impl_ = std::make_unique<ParserImpl>(&ctx_, str);
@@ -649,9 +631,7 @@
 
   void SetUp() { ctx_.Reset(); }
 
-  void TearDown() {
-    impl_ = nullptr;
-  }
+  void TearDown() { impl_ = nullptr; }
 
   ParserImpl* parser(const std::string& str) {
     impl_ = std::make_unique<ParserImpl>(&ctx_, str);
diff --git a/src/reader/wgsl/parser_impl_variable_storage_decoration_test.cc b/src/reader/wgsl/parser_impl_variable_storage_decoration_test.cc
index 9bf38aa..27a82f1 100644
--- a/src/reader/wgsl/parser_impl_variable_storage_decoration_test.cc
+++ b/src/reader/wgsl/parser_impl_variable_storage_decoration_test.cc
@@ -38,9 +38,7 @@
 
   void SetUp() { ctx_.Reset(); }
 
-  void TearDown() {
-    impl_ = nullptr;
-  }
+  void TearDown() { impl_ = nullptr; }
 
   ParserImpl* parser(const std::string& str) {
     impl_ = std::make_unique<ParserImpl>(&ctx_, str);