[ir] Remove ir::Transform base class This is no longer used now that all transforms are free functions. Bug: tint::1718 Change-Id: I63a0e764711cd9ff77595db60e4bf9e9be3824a7 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/143830 Reviewed-by: Dan Sinclair <dsinclair@chromium.org> Kokoro: Kokoro <noreply+kokoro@google.com>
diff --git a/src/tint/BUILD.gn b/src/tint/BUILD.gn index f60cd8f..e570fe8 100644 --- a/src/tint/BUILD.gn +++ b/src/tint/BUILD.gn
@@ -1343,8 +1343,6 @@ "lang/core/ir/terminate_invocation.h", "lang/core/ir/terminator.cc", "lang/core/ir/terminator.h", - "lang/core/ir/transform/transform.cc", - "lang/core/ir/transform/transform.h", "lang/core/ir/unary.cc", "lang/core/ir/unary.h", "lang/core/ir/unreachable.cc",
diff --git a/src/tint/CMakeLists.txt b/src/tint/CMakeLists.txt index 8dc1023..d9e69b7 100644 --- a/src/tint/CMakeLists.txt +++ b/src/tint/CMakeLists.txt
@@ -880,8 +880,6 @@ lang/core/ir/transform/demote_to_helper.h lang/core/ir/transform/shader_io.cc lang/core/ir/transform/shader_io.h - lang/core/ir/transform/transform.cc - lang/core/ir/transform/transform.h ) endif()
diff --git a/src/tint/lang/core/ir/transform/helper_test.h b/src/tint/lang/core/ir/transform/helper_test.h index 8590171..32d2919 100644 --- a/src/tint/lang/core/ir/transform/helper_test.h +++ b/src/tint/lang/core/ir/transform/helper_test.h
@@ -23,7 +23,6 @@ #include "gtest/gtest.h" #include "src/tint/lang/core/ir/builder.h" #include "src/tint/lang/core/ir/disassembler.h" -#include "src/tint/lang/core/ir/transform/transform.h" #include "src/tint/lang/core/ir/validator.h" namespace tint::ir::transform { @@ -32,26 +31,6 @@ template <typename BASE> class TransformTestBase : public BASE { public: - /// Transforms the module, using the transforms `TRANSFORMS`. - template <typename... TRANSFORMS> - void Run() { - // Validate the input IR. - { - auto res = ir::Validate(mod); - EXPECT_TRUE(res) << res.Failure().str(); - if (!res) { - return; - } - } - - // Run the transforms. - (TRANSFORMS().Run(&mod), ...); - - // Validate the output IR. - auto res = ir::Validate(mod); - EXPECT_TRUE(res) << res.Failure().str(); - } - /// Transforms the module, using @p transform. /// @param transform_func the transform to run /// @param args the arguments to the transform function
diff --git a/src/tint/lang/core/ir/transform/transform.cc b/src/tint/lang/core/ir/transform/transform.cc deleted file mode 100644 index efb23a2..0000000 --- a/src/tint/lang/core/ir/transform/transform.cc +++ /dev/null
@@ -1,24 +0,0 @@ -// Copyright 2023 The Tint Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "src/tint/lang/core/ir/transform/transform.h" - -TINT_INSTANTIATE_TYPEINFO(tint::ir::transform::Transform); - -namespace tint::ir::transform { - -Transform::Transform() = default; -Transform::~Transform() = default; - -} // namespace tint::ir::transform
diff --git a/src/tint/lang/core/ir/transform/transform.h b/src/tint/lang/core/ir/transform/transform.h deleted file mode 100644 index a88cec2..0000000 --- a/src/tint/lang/core/ir/transform/transform.h +++ /dev/null
@@ -1,45 +0,0 @@ -// Copyright 2023 The Tint Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef SRC_TINT_LANG_CORE_IR_TRANSFORM_TRANSFORM_H_ -#define SRC_TINT_LANG_CORE_IR_TRANSFORM_TRANSFORM_H_ - -#include <utility> - -#include "src/tint/lang/core/builtin/address_space.h" -#include "src/tint/utils/rtti/castable.h" - -// Forward declarations -namespace tint::ir { -class Module; -} // namespace tint::ir - -namespace tint::ir::transform { - -/// Interface for IR Module transforms. -class Transform : public Castable<Transform> { - public: - /// Constructor - Transform(); - /// Destructor - ~Transform() override; - - /// Run the transform on @p module - /// @param module the source module to transform - virtual void Run(ir::Module* module) const = 0; -}; - -} // namespace tint::ir::transform - -#endif // SRC_TINT_LANG_CORE_IR_TRANSFORM_TRANSFORM_H_