Import Tint changes from Dawn
Changes:
- b5a904c884886b7025136155506ae03649993059 [msl] Emit continuing inside a new block by James Price <jrprice@google.com>
- 1aad86d9ef817cdbca98b0595fbb886ab411ae15 [msl] Move RenameConflicts to core and use it by James Price <jrprice@google.com>
- 99df2e6f2090d197b6eb481e6653df64ee6364d0 Update some OWNERS files. by dan sinclair <dsinclair@chromium.org>
GitOrigin-RevId: b5a904c884886b7025136155506ae03649993059
Change-Id: I6b406fc1d8218e7de97da85f908d3ec5724e0a72
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/191580
Reviewed-by: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: James Price <jrprice@google.com>
diff --git a/src/tint/OWNERS b/src/tint/OWNERS
index 07dae49..ee30ba4 100644
--- a/src/tint/OWNERS
+++ b/src/tint/OWNERS
@@ -1,5 +1,4 @@
amaiorano@google.com
-bclayton@google.com
chouinard@google.com
dneto@google.com
dsinclair@chromium.org
diff --git a/src/tint/lang/core/ir/transform/BUILD.bazel b/src/tint/lang/core/ir/transform/BUILD.bazel
index 3bdcfad..f2b02a7 100644
--- a/src/tint/lang/core/ir/transform/BUILD.bazel
+++ b/src/tint/lang/core/ir/transform/BUILD.bazel
@@ -53,6 +53,7 @@
"multiplanar_external_texture.cc",
"preserve_padding.cc",
"remove_terminator_args.cc",
+ "rename_conflicts.cc",
"robustness.cc",
"shader_io.cc",
"std140.cc",
@@ -75,6 +76,7 @@
"multiplanar_external_texture.h",
"preserve_padding.h",
"remove_terminator_args.h",
+ "rename_conflicts.h",
"robustness.h",
"shader_io.h",
"std140.h",
@@ -127,6 +129,7 @@
"multiplanar_external_texture_test.cc",
"preserve_padding_test.cc",
"remove_terminator_args_test.cc",
+ "rename_conflicts_test.cc",
"robustness_test.cc",
"std140_test.cc",
"value_to_let_test.cc",
diff --git a/src/tint/lang/core/ir/transform/BUILD.cmake b/src/tint/lang/core/ir/transform/BUILD.cmake
index 6713300..ce6228e 100644
--- a/src/tint/lang/core/ir/transform/BUILD.cmake
+++ b/src/tint/lang/core/ir/transform/BUILD.cmake
@@ -69,6 +69,8 @@
lang/core/ir/transform/preserve_padding.h
lang/core/ir/transform/remove_terminator_args.cc
lang/core/ir/transform/remove_terminator_args.h
+ lang/core/ir/transform/rename_conflicts.cc
+ lang/core/ir/transform/rename_conflicts.h
lang/core/ir/transform/robustness.cc
lang/core/ir/transform/robustness.h
lang/core/ir/transform/shader_io.cc
@@ -127,6 +129,7 @@
lang/core/ir/transform/multiplanar_external_texture_test.cc
lang/core/ir/transform/preserve_padding_test.cc
lang/core/ir/transform/remove_terminator_args_test.cc
+ lang/core/ir/transform/rename_conflicts_test.cc
lang/core/ir/transform/robustness_test.cc
lang/core/ir/transform/std140_test.cc
lang/core/ir/transform/value_to_let_test.cc
@@ -208,6 +211,7 @@
lang/core/ir/transform/multiplanar_external_texture_fuzz.cc
lang/core/ir/transform/preserve_padding_fuzz.cc
lang/core/ir/transform/remove_terminator_args_fuzz.cc
+ lang/core/ir/transform/rename_conflicts_fuzz.cc
lang/core/ir/transform/robustness_fuzz.cc
lang/core/ir/transform/std140_fuzz.cc
lang/core/ir/transform/value_to_let_fuzz.cc
diff --git a/src/tint/lang/core/ir/transform/BUILD.gn b/src/tint/lang/core/ir/transform/BUILD.gn
index 131161f..5d27b9f 100644
--- a/src/tint/lang/core/ir/transform/BUILD.gn
+++ b/src/tint/lang/core/ir/transform/BUILD.gn
@@ -72,6 +72,8 @@
"preserve_padding.h",
"remove_terminator_args.cc",
"remove_terminator_args.h",
+ "rename_conflicts.cc",
+ "rename_conflicts.h",
"robustness.cc",
"robustness.h",
"shader_io.cc",
@@ -127,6 +129,7 @@
"multiplanar_external_texture_test.cc",
"preserve_padding_test.cc",
"remove_terminator_args_test.cc",
+ "rename_conflicts_test.cc",
"robustness_test.cc",
"std140_test.cc",
"value_to_let_test.cc",
@@ -199,6 +202,7 @@
"multiplanar_external_texture_fuzz.cc",
"preserve_padding_fuzz.cc",
"remove_terminator_args_fuzz.cc",
+ "rename_conflicts_fuzz.cc",
"robustness_fuzz.cc",
"std140_fuzz.cc",
"value_to_let_fuzz.cc",
diff --git a/src/tint/lang/wgsl/writer/raise/rename_conflicts.cc b/src/tint/lang/core/ir/transform/rename_conflicts.cc
similarity index 98%
rename from src/tint/lang/wgsl/writer/raise/rename_conflicts.cc
rename to src/tint/lang/core/ir/transform/rename_conflicts.cc
index f40dd88..fa32ced 100644
--- a/src/tint/lang/wgsl/writer/raise/rename_conflicts.cc
+++ b/src/tint/lang/core/ir/transform/rename_conflicts.cc
@@ -35,6 +35,7 @@
#include "src/tint/lang/core/ir/loop.h"
#include "src/tint/lang/core/ir/module.h"
#include "src/tint/lang/core/ir/multi_in_block.h"
+#include "src/tint/lang/core/ir/transform/rename_conflicts.h"
#include "src/tint/lang/core/ir/validator.h"
#include "src/tint/lang/core/ir/var.h"
#include "src/tint/lang/core/type/matrix.h"
@@ -42,7 +43,6 @@
#include "src/tint/lang/core/type/scalar.h"
#include "src/tint/lang/core/type/struct.h"
#include "src/tint/lang/core/type/vector.h"
-#include "src/tint/lang/wgsl/writer/raise/rename_conflicts.h"
#include "src/tint/utils/containers/hashset.h"
#include "src/tint/utils/containers/reverse.h"
#include "src/tint/utils/containers/scope_stack.h"
@@ -50,7 +50,7 @@
#include "src/tint/utils/rtti/switch.h"
#include "src/tint/utils/text/string.h"
-namespace tint::wgsl::writer::raise {
+namespace tint::core::ir::transform {
namespace {
@@ -298,4 +298,4 @@
return Success;
}
-} // namespace tint::wgsl::writer::raise
+} // namespace tint::core::ir::transform
diff --git a/src/tint/lang/wgsl/writer/raise/rename_conflicts.h b/src/tint/lang/core/ir/transform/rename_conflicts.h
similarity index 85%
rename from src/tint/lang/wgsl/writer/raise/rename_conflicts.h
rename to src/tint/lang/core/ir/transform/rename_conflicts.h
index e9c6816..8086476 100644
--- a/src/tint/lang/wgsl/writer/raise/rename_conflicts.h
+++ b/src/tint/lang/core/ir/transform/rename_conflicts.h
@@ -25,12 +25,9 @@
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef SRC_TINT_LANG_WGSL_WRITER_RAISE_RENAME_CONFLICTS_H_
-#define SRC_TINT_LANG_WGSL_WRITER_RAISE_RENAME_CONFLICTS_H_
+#ifndef SRC_TINT_LANG_CORE_IR_TRANSFORM_RENAME_CONFLICTS_H_
+#define SRC_TINT_LANG_CORE_IR_TRANSFORM_RENAME_CONFLICTS_H_
-#include <string>
-
-#include "src/tint/utils/diagnostic/diagnostic.h"
#include "src/tint/utils/result/result.h"
// Forward declarations.
@@ -38,7 +35,7 @@
class Module;
}
-namespace tint::wgsl::writer::raise {
+namespace tint::core::ir::transform {
/// RenameConflicts is a transform that renames declarations which prevent identifiers from
/// resolving to the correct declaration, and those with identical identifiers declared in the same
@@ -47,6 +44,6 @@
/// @returns success or failure
Result<SuccessType> RenameConflicts(core::ir::Module& module);
-} // namespace tint::wgsl::writer::raise
+} // namespace tint::core::ir::transform
-#endif // SRC_TINT_LANG_WGSL_WRITER_RAISE_RENAME_CONFLICTS_H_
+#endif // SRC_TINT_LANG_CORE_IR_TRANSFORM_RENAME_CONFLICTS_H_
diff --git a/src/tint/lang/wgsl/writer/raise/rename_conflicts_fuzz.cc b/src/tint/lang/core/ir/transform/rename_conflicts_fuzz.cc
similarity index 90%
rename from src/tint/lang/wgsl/writer/raise/rename_conflicts_fuzz.cc
rename to src/tint/lang/core/ir/transform/rename_conflicts_fuzz.cc
index 8ac74e0..c125848 100644
--- a/src/tint/lang/wgsl/writer/raise/rename_conflicts_fuzz.cc
+++ b/src/tint/lang/core/ir/transform/rename_conflicts_fuzz.cc
@@ -25,12 +25,12 @@
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#include "src/tint/lang/wgsl/writer/raise/rename_conflicts.h"
+#include "src/tint/lang/core/ir/transform/rename_conflicts.h"
#include "src/tint/cmd/fuzz/ir/fuzz.h"
#include "src/tint/lang/core/ir/validator.h"
-namespace tint::wgsl::writer::raise {
+namespace tint::core::ir::transform {
namespace {
void RenameConflictsFuzzer(core::ir::Module& module) {
@@ -45,6 +45,6 @@
}
} // namespace
-} // namespace tint::wgsl::writer::raise
+} // namespace tint::core::ir::transform
-TINT_IR_MODULE_FUZZER(tint::wgsl::writer::raise::RenameConflictsFuzzer);
+TINT_IR_MODULE_FUZZER(tint::core::ir::transform::RenameConflictsFuzzer);
diff --git a/src/tint/lang/wgsl/writer/raise/rename_conflicts_test.cc b/src/tint/lang/core/ir/transform/rename_conflicts_test.cc
similarity index 99%
rename from src/tint/lang/wgsl/writer/raise/rename_conflicts_test.cc
rename to src/tint/lang/core/ir/transform/rename_conflicts_test.cc
index d5a25db..74ee81a 100644
--- a/src/tint/lang/wgsl/writer/raise/rename_conflicts_test.cc
+++ b/src/tint/lang/core/ir/transform/rename_conflicts_test.cc
@@ -25,7 +25,7 @@
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#include "src/tint/lang/wgsl/writer/raise/rename_conflicts.h"
+#include "src/tint/lang/core/ir/transform/rename_conflicts.h"
#include <string>
#include <utility>
@@ -36,7 +36,7 @@
#include "src/tint/lang/core/ir/validator.h"
#include "src/tint/lang/core/type/matrix.h"
-namespace tint::wgsl::writer::raise {
+namespace tint::core::ir::transform {
namespace {
using namespace tint::core::fluent_types; // NOLINT
@@ -1149,4 +1149,4 @@
}
} // namespace
-} // namespace tint::wgsl::writer::raise
+} // namespace tint::core::ir::transform
diff --git a/src/tint/lang/msl/writer/printer/printer.cc b/src/tint/lang/msl/writer/printer/printer.cc
index f3c0d79..996010e 100644
--- a/src/tint/lang/msl/writer/printer/printer.cc
+++ b/src/tint/lang/msl/writer/printer/printer.cc
@@ -591,7 +591,14 @@
// }
// }
- auto emit_continuing = [&] { EmitBlock(l->Continuing()); };
+ auto emit_continuing = [&] {
+ Line() << "{";
+ {
+ const ScopedIndent si(current_buffer_);
+ EmitBlock(l->Continuing());
+ }
+ Line() << "}";
+ };
TINT_SCOPED_ASSIGNMENT(emit_continuing_, emit_continuing);
Line() << "{";
diff --git a/src/tint/lang/msl/writer/raise/raise.cc b/src/tint/lang/msl/writer/raise/raise.cc
index d3b5007..dfcee32 100644
--- a/src/tint/lang/msl/writer/raise/raise.cc
+++ b/src/tint/lang/msl/writer/raise/raise.cc
@@ -38,6 +38,7 @@
#include "src/tint/lang/core/ir/transform/multiplanar_external_texture.h"
#include "src/tint/lang/core/ir/transform/preserve_padding.h"
#include "src/tint/lang/core/ir/transform/remove_terminator_args.h"
+#include "src/tint/lang/core/ir/transform/rename_conflicts.h"
#include "src/tint/lang/core/ir/transform/robustness.h"
#include "src/tint/lang/core/ir/transform/value_to_let.h"
#include "src/tint/lang/core/ir/transform/vectorize_scalar_matrix_constructors.h"
@@ -113,6 +114,7 @@
RUN_TRANSFORM(raise::ShaderIO, raise::ShaderIOConfig{options.emit_vertex_point_size});
RUN_TRANSFORM(raise::ModuleScopeVars);
RUN_TRANSFORM(core::ir::transform::RemoveTerminatorArgs);
+ RUN_TRANSFORM(core::ir::transform::RenameConflicts);
RUN_TRANSFORM(core::ir::transform::ValueToLet);
RUN_TRANSFORM(raise::BuiltinPolyfill);
diff --git a/src/tint/lang/wgsl/writer/raise/BUILD.bazel b/src/tint/lang/wgsl/writer/raise/BUILD.bazel
index c4b925d..23184a8 100644
--- a/src/tint/lang/wgsl/writer/raise/BUILD.bazel
+++ b/src/tint/lang/wgsl/writer/raise/BUILD.bazel
@@ -41,13 +41,11 @@
srcs = [
"ptr_to_ref.cc",
"raise.cc",
- "rename_conflicts.cc",
"value_to_let.cc",
],
hdrs = [
"ptr_to_ref.h",
"raise.h",
- "rename_conflicts.h",
"value_to_let.h",
],
deps = [
@@ -56,6 +54,7 @@
"//src/tint/lang/core/constant",
"//src/tint/lang/core/intrinsic",
"//src/tint/lang/core/ir",
+ "//src/tint/lang/core/ir/transform",
"//src/tint/lang/core/type",
"//src/tint/lang/wgsl",
"//src/tint/lang/wgsl/intrinsic",
@@ -83,7 +82,6 @@
srcs = [
"ptr_to_ref_test.cc",
"raise_test.cc",
- "rename_conflicts_test.cc",
"value_to_let_test.cc",
],
deps = [
diff --git a/src/tint/lang/wgsl/writer/raise/BUILD.cmake b/src/tint/lang/wgsl/writer/raise/BUILD.cmake
index ff5b855..2a30f2d 100644
--- a/src/tint/lang/wgsl/writer/raise/BUILD.cmake
+++ b/src/tint/lang/wgsl/writer/raise/BUILD.cmake
@@ -43,8 +43,6 @@
lang/wgsl/writer/raise/ptr_to_ref.h
lang/wgsl/writer/raise/raise.cc
lang/wgsl/writer/raise/raise.h
- lang/wgsl/writer/raise/rename_conflicts.cc
- lang/wgsl/writer/raise/rename_conflicts.h
lang/wgsl/writer/raise/value_to_let.cc
lang/wgsl/writer/raise/value_to_let.h
)
@@ -55,6 +53,7 @@
tint_lang_core_constant
tint_lang_core_intrinsic
tint_lang_core_ir
+ tint_lang_core_ir_transform
tint_lang_core_type
tint_lang_wgsl
tint_lang_wgsl_intrinsic
@@ -81,7 +80,6 @@
tint_add_target(tint_lang_wgsl_writer_raise_test test
lang/wgsl/writer/raise/ptr_to_ref_test.cc
lang/wgsl/writer/raise/raise_test.cc
- lang/wgsl/writer/raise/rename_conflicts_test.cc
lang/wgsl/writer/raise/value_to_let_test.cc
)
@@ -120,7 +118,6 @@
tint_add_target(tint_lang_wgsl_writer_raise_fuzz fuzz
lang/wgsl/writer/raise/ptr_to_ref_fuzz.cc
lang/wgsl/writer/raise/raise_fuzz.cc
- lang/wgsl/writer/raise/rename_conflicts_fuzz.cc
lang/wgsl/writer/raise/value_to_let_fuzz.cc
)
diff --git a/src/tint/lang/wgsl/writer/raise/BUILD.gn b/src/tint/lang/wgsl/writer/raise/BUILD.gn
index 1f5cfa8..aa69071 100644
--- a/src/tint/lang/wgsl/writer/raise/BUILD.gn
+++ b/src/tint/lang/wgsl/writer/raise/BUILD.gn
@@ -48,8 +48,6 @@
"ptr_to_ref.h",
"raise.cc",
"raise.h",
- "rename_conflicts.cc",
- "rename_conflicts.h",
"value_to_let.cc",
"value_to_let.h",
]
@@ -59,6 +57,7 @@
"${tint_src_dir}/lang/core/constant",
"${tint_src_dir}/lang/core/intrinsic",
"${tint_src_dir}/lang/core/ir",
+ "${tint_src_dir}/lang/core/ir/transform",
"${tint_src_dir}/lang/core/type",
"${tint_src_dir}/lang/wgsl",
"${tint_src_dir}/lang/wgsl/intrinsic",
@@ -83,7 +82,6 @@
sources = [
"ptr_to_ref_test.cc",
"raise_test.cc",
- "rename_conflicts_test.cc",
"value_to_let_test.cc",
]
deps = [
@@ -117,7 +115,6 @@
sources = [
"ptr_to_ref_fuzz.cc",
"raise_fuzz.cc",
- "rename_conflicts_fuzz.cc",
"value_to_let_fuzz.cc",
]
deps = [
diff --git a/src/tint/lang/wgsl/writer/raise/raise.cc b/src/tint/lang/wgsl/writer/raise/raise.cc
index 6720392..56e9fac 100644
--- a/src/tint/lang/wgsl/writer/raise/raise.cc
+++ b/src/tint/lang/wgsl/writer/raise/raise.cc
@@ -33,12 +33,13 @@
#include "src/tint/lang/core/ir/builder.h"
#include "src/tint/lang/core/ir/core_builtin_call.h"
#include "src/tint/lang/core/ir/load.h"
+#include "src/tint/lang/core/ir/transform/rename_conflicts.h"
#include "src/tint/lang/core/type/pointer.h"
#include "src/tint/lang/wgsl/builtin_fn.h"
#include "src/tint/lang/wgsl/ir/builtin_call.h"
#include "src/tint/lang/wgsl/writer/raise/ptr_to_ref.h"
-#include "src/tint/lang/wgsl/writer/raise/rename_conflicts.h"
#include "src/tint/lang/wgsl/writer/raise/value_to_let.h"
+#include "src/tint/utils/result/result.h"
namespace tint::wgsl::writer {
namespace {
@@ -236,7 +237,7 @@
}
}
- if (auto result = raise::RenameConflicts(mod); result != Success) {
+ if (auto result = core::ir::transform::RenameConflicts(mod); result != Success) {
return result.Failure();
}
if (auto result = raise::ValueToLet(mod); result != Success) {