[shuffle] Move constant to new structure.
This CL moves the constant folder into the `lang/base/constant` folder
and updates the includes. The namespaces and build groups are not updated
in this CL, just the code move.
Bug: tint:1988
Change-Id: Ic45da80e8bb491ffd1f80d89805f8adf9bf17caa
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/142141
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
diff --git a/src/tint/BUILD.gn b/src/tint/BUILD.gn
index 66f1ffb..67aa0d6 100644
--- a/src/tint/BUILD.gn
+++ b/src/tint/BUILD.gn
@@ -928,19 +928,19 @@
libtint_source_set("libtint_constant_src") {
sources = [
- "constant/clone_context.h",
- "constant/composite.cc",
- "constant/composite.h",
- "constant/manager.cc",
- "constant/manager.h",
- "constant/node.cc",
- "constant/node.h",
- "constant/scalar.cc",
- "constant/scalar.h",
- "constant/splat.cc",
- "constant/splat.h",
- "constant/value.cc",
- "constant/value.h",
+ "lang/base/constant/clone_context.h",
+ "lang/base/constant/composite.cc",
+ "lang/base/constant/composite.h",
+ "lang/base/constant/manager.cc",
+ "lang/base/constant/manager.h",
+ "lang/base/constant/node.cc",
+ "lang/base/constant/node.h",
+ "lang/base/constant/scalar.cc",
+ "lang/base/constant/scalar.h",
+ "lang/base/constant/splat.cc",
+ "lang/base/constant/splat.h",
+ "lang/base/constant/value.cc",
+ "lang/base/constant/value.h",
]
deps = [
":libtint_builtins_src",
@@ -1786,11 +1786,11 @@
tint_unittests_source_set("tint_unittests_constant_src") {
sources = [
- "constant/composite_test.cc",
- "constant/manager_test.cc",
- "constant/scalar_test.cc",
- "constant/splat_test.cc",
- "constant/value_test.cc",
+ "lang/base/constant/composite_test.cc",
+ "lang/base/constant/manager_test.cc",
+ "lang/base/constant/scalar_test.cc",
+ "lang/base/constant/splat_test.cc",
+ "lang/base/constant/value_test.cc",
]
}
diff --git a/src/tint/CMakeLists.txt b/src/tint/CMakeLists.txt
index 8733078..d1e9eac 100644
--- a/src/tint/CMakeLists.txt
+++ b/src/tint/CMakeLists.txt
@@ -239,19 +239,19 @@
lang/base/builtin/number.h
clone_context.cc
clone_context.h
- constant/clone_context.h
- constant/composite.cc
- constant/composite.h
- constant/manager.cc
- constant/manager.h
- constant/scalar.cc
- constant/scalar.h
- constant/splat.cc
- constant/splat.h
- constant/node.cc
- constant/node.h
- constant/value.cc
- constant/value.h
+ lang/base/constant/clone_context.h
+ lang/base/constant/composite.cc
+ lang/base/constant/composite.h
+ lang/base/constant/manager.cc
+ lang/base/constant/manager.h
+ lang/base/constant/scalar.cc
+ lang/base/constant/scalar.h
+ lang/base/constant/splat.cc
+ lang/base/constant/splat.h
+ lang/base/constant/node.cc
+ lang/base/constant/node.h
+ lang/base/constant/value.cc
+ lang/base/constant/value.h
inspector/entry_point.cc
inspector/entry_point.h
inspector/inspector.cc
@@ -1010,11 +1010,11 @@
lang/wgsl/ast/workgroup_attribute_test.cc
lang/base/builtin/number_test.cc
clone_context_test.cc
- constant/composite_test.cc
- constant/manager_test.cc
- constant/scalar_test.cc
- constant/splat_test.cc
- constant/value_test.cc
+ lang/base/constant/composite_test.cc
+ lang/base/constant/manager_test.cc
+ lang/base/constant/scalar_test.cc
+ lang/base/constant/splat_test.cc
+ lang/base/constant/value_test.cc
debug_test.cc
core/diagnostic/diagnostic_test.cc
core/diagnostic/formatter_test.cc
diff --git a/src/tint/ir/builder.cc b/src/tint/ir/builder.cc
index e3d0f29..4a5b239 100644
--- a/src/tint/ir/builder.cc
+++ b/src/tint/ir/builder.cc
@@ -16,7 +16,7 @@
#include <utility>
-#include "src/tint/constant/scalar.h"
+#include "src/tint/lang/base/constant/scalar.h"
#include "src/tint/type/pointer.h"
#include "src/tint/type/reference.h"
diff --git a/src/tint/ir/builder.h b/src/tint/ir/builder.h
index 6bb437b..b71e462 100644
--- a/src/tint/ir/builder.h
+++ b/src/tint/ir/builder.h
@@ -17,9 +17,6 @@
#include <utility>
-#include "src/tint/constant/composite.h"
-#include "src/tint/constant/scalar.h"
-#include "src/tint/constant/splat.h"
#include "src/tint/core/scoped_assignment.h"
#include "src/tint/ir/access.h"
#include "src/tint/ir/binary.h"
@@ -58,6 +55,9 @@
#include "src/tint/ir/user_call.h"
#include "src/tint/ir/value.h"
#include "src/tint/ir/var.h"
+#include "src/tint/lang/base/constant/composite.h"
+#include "src/tint/lang/base/constant/scalar.h"
+#include "src/tint/lang/base/constant/splat.h"
#include "src/tint/switch.h"
#include "src/tint/type/bool.h"
#include "src/tint/type/f16.h"
diff --git a/src/tint/ir/constant.h b/src/tint/ir/constant.h
index 90acb04..fb025ae 100644
--- a/src/tint/ir/constant.h
+++ b/src/tint/ir/constant.h
@@ -15,8 +15,8 @@
#ifndef SRC_TINT_IR_CONSTANT_H_
#define SRC_TINT_IR_CONSTANT_H_
-#include "src/tint/constant/value.h"
#include "src/tint/ir/value.h"
+#include "src/tint/lang/base/constant/value.h"
namespace tint::ir {
diff --git a/src/tint/ir/disassembler.cc b/src/tint/ir/disassembler.cc
index 9ec32be..cd14b4e 100644
--- a/src/tint/ir/disassembler.cc
+++ b/src/tint/ir/disassembler.cc
@@ -15,9 +15,6 @@
#include "src/tint/ir/disassembler.h"
#include "src//tint/ir/unary.h"
-#include "src/tint/constant/composite.h"
-#include "src/tint/constant/scalar.h"
-#include "src/tint/constant/splat.h"
#include "src/tint/core/scoped_assignment.h"
#include "src/tint/core/string.h"
#include "src/tint/ir/access.h"
@@ -52,6 +49,9 @@
#include "src/tint/ir/unreachable.h"
#include "src/tint/ir/user_call.h"
#include "src/tint/ir/var.h"
+#include "src/tint/lang/base/constant/composite.h"
+#include "src/tint/lang/base/constant/scalar.h"
+#include "src/tint/lang/base/constant/splat.h"
#include "src/tint/switch.h"
#include "src/tint/type/struct.h"
#include "src/tint/type/type.h"
diff --git a/src/tint/ir/from_program_accessor_test.cc b/src/tint/ir/from_program_accessor_test.cc
index 5245b91..2886bdb 100644
--- a/src/tint/ir/from_program_accessor_test.cc
+++ b/src/tint/ir/from_program_accessor_test.cc
@@ -13,11 +13,11 @@
// limitations under the License.
#include "gmock/gmock.h"
-#include "src/tint/constant/scalar.h"
#include "src/tint/ir/block.h"
#include "src/tint/ir/constant.h"
#include "src/tint/ir/program_test_helper.h"
#include "src/tint/ir/var.h"
+#include "src/tint/lang/base/constant/scalar.h"
#include "src/tint/lang/wgsl/ast/case_selector.h"
#include "src/tint/lang/wgsl/ast/int_literal_expression.h"
diff --git a/src/tint/ir/from_program_binary_test.cc b/src/tint/ir/from_program_binary_test.cc
index 03dd7d5..1e50b0b 100644
--- a/src/tint/ir/from_program_binary_test.cc
+++ b/src/tint/ir/from_program_binary_test.cc
@@ -13,8 +13,8 @@
// limitations under the License.
#include "gmock/gmock.h"
-#include "src/tint/constant/scalar.h"
#include "src/tint/ir/program_test_helper.h"
+#include "src/tint/lang/base/constant/scalar.h"
#include "src/tint/lang/wgsl/ast/case_selector.h"
#include "src/tint/lang/wgsl/ast/int_literal_expression.h"
diff --git a/src/tint/ir/from_program_builtin_test.cc b/src/tint/ir/from_program_builtin_test.cc
index 952bca1..22df3cb 100644
--- a/src/tint/ir/from_program_builtin_test.cc
+++ b/src/tint/ir/from_program_builtin_test.cc
@@ -13,8 +13,8 @@
// limitations under the License.
#include "gmock/gmock.h"
-#include "src/tint/constant/scalar.h"
#include "src/tint/ir/program_test_helper.h"
+#include "src/tint/lang/base/constant/scalar.h"
#include "src/tint/lang/wgsl/ast/case_selector.h"
#include "src/tint/lang/wgsl/ast/int_literal_expression.h"
diff --git a/src/tint/ir/from_program_call_test.cc b/src/tint/ir/from_program_call_test.cc
index 2411ffd..7d54904 100644
--- a/src/tint/ir/from_program_call_test.cc
+++ b/src/tint/ir/from_program_call_test.cc
@@ -13,8 +13,8 @@
// limitations under the License.
#include "gmock/gmock.h"
-#include "src/tint/constant/scalar.h"
#include "src/tint/ir/program_test_helper.h"
+#include "src/tint/lang/base/constant/scalar.h"
#include "src/tint/lang/wgsl/ast/case_selector.h"
#include "src/tint/lang/wgsl/ast/int_literal_expression.h"
diff --git a/src/tint/ir/from_program_function_test.cc b/src/tint/ir/from_program_function_test.cc
index 0e098e9..9f92fef 100644
--- a/src/tint/ir/from_program_function_test.cc
+++ b/src/tint/ir/from_program_function_test.cc
@@ -13,8 +13,8 @@
// limitations under the License.
#include "gmock/gmock.h"
-#include "src/tint/constant/scalar.h"
#include "src/tint/ir/program_test_helper.h"
+#include "src/tint/lang/base/constant/scalar.h"
#include "src/tint/lang/wgsl/ast/case_selector.h"
#include "src/tint/lang/wgsl/ast/int_literal_expression.h"
diff --git a/src/tint/ir/from_program_let_test.cc b/src/tint/ir/from_program_let_test.cc
index 538bc762..bebd3a1 100644
--- a/src/tint/ir/from_program_let_test.cc
+++ b/src/tint/ir/from_program_let_test.cc
@@ -13,8 +13,8 @@
// limitations under the License.
#include "gmock/gmock.h"
-#include "src/tint/constant/scalar.h"
#include "src/tint/ir/program_test_helper.h"
+#include "src/tint/lang/base/constant/scalar.h"
#include "src/tint/lang/wgsl/ast/case_selector.h"
#include "src/tint/lang/wgsl/ast/int_literal_expression.h"
diff --git a/src/tint/ir/from_program_literal_test.cc b/src/tint/ir/from_program_literal_test.cc
index 397dc2a..2d3fb6d 100644
--- a/src/tint/ir/from_program_literal_test.cc
+++ b/src/tint/ir/from_program_literal_test.cc
@@ -13,11 +13,11 @@
// limitations under the License.
#include "gmock/gmock.h"
-#include "src/tint/constant/scalar.h"
#include "src/tint/ir/block.h"
#include "src/tint/ir/constant.h"
#include "src/tint/ir/program_test_helper.h"
#include "src/tint/ir/var.h"
+#include "src/tint/lang/base/constant/scalar.h"
#include "src/tint/lang/wgsl/ast/case_selector.h"
#include "src/tint/lang/wgsl/ast/int_literal_expression.h"
diff --git a/src/tint/ir/from_program_materialize_test.cc b/src/tint/ir/from_program_materialize_test.cc
index 221718b..7d40448 100644
--- a/src/tint/ir/from_program_materialize_test.cc
+++ b/src/tint/ir/from_program_materialize_test.cc
@@ -13,8 +13,8 @@
// limitations under the License.
#include "gmock/gmock.h"
-#include "src/tint/constant/scalar.h"
#include "src/tint/ir/program_test_helper.h"
+#include "src/tint/lang/base/constant/scalar.h"
#include "src/tint/lang/wgsl/ast/case_selector.h"
#include "src/tint/lang/wgsl/ast/int_literal_expression.h"
diff --git a/src/tint/ir/from_program_store_test.cc b/src/tint/ir/from_program_store_test.cc
index 324e946..28432db 100644
--- a/src/tint/ir/from_program_store_test.cc
+++ b/src/tint/ir/from_program_store_test.cc
@@ -13,8 +13,8 @@
// limitations under the License.
#include "gmock/gmock.h"
-#include "src/tint/constant/scalar.h"
#include "src/tint/ir/program_test_helper.h"
+#include "src/tint/lang/base/constant/scalar.h"
#include "src/tint/lang/wgsl/ast/case_selector.h"
#include "src/tint/lang/wgsl/ast/int_literal_expression.h"
diff --git a/src/tint/ir/from_program_test.cc b/src/tint/ir/from_program_test.cc
index c721c7a..ce064a8 100644
--- a/src/tint/ir/from_program_test.cc
+++ b/src/tint/ir/from_program_test.cc
@@ -13,13 +13,13 @@
// limitations under the License.
#include "gmock/gmock.h"
-#include "src/tint/constant/scalar.h"
#include "src/tint/ir/block.h"
#include "src/tint/ir/if.h"
#include "src/tint/ir/loop.h"
#include "src/tint/ir/multi_in_block.h"
#include "src/tint/ir/program_test_helper.h"
#include "src/tint/ir/switch.h"
+#include "src/tint/lang/base/constant/scalar.h"
#include "src/tint/lang/wgsl/ast/case_selector.h"
#include "src/tint/lang/wgsl/ast/int_literal_expression.h"
diff --git a/src/tint/ir/from_program_unary_test.cc b/src/tint/ir/from_program_unary_test.cc
index bd7708f..5b907a1 100644
--- a/src/tint/ir/from_program_unary_test.cc
+++ b/src/tint/ir/from_program_unary_test.cc
@@ -14,7 +14,7 @@
#include "src/tint/ir/program_test_helper.h"
-#include "src/tint/constant/scalar.h"
+#include "src/tint/lang/base/constant/scalar.h"
#include "src/tint/lang/wgsl/ast/case_selector.h"
#include "src/tint/lang/wgsl/ast/int_literal_expression.h"
diff --git a/src/tint/ir/from_program_var_test.cc b/src/tint/ir/from_program_var_test.cc
index 8cb53f1..a2d0ed7 100644
--- a/src/tint/ir/from_program_var_test.cc
+++ b/src/tint/ir/from_program_var_test.cc
@@ -13,8 +13,8 @@
// limitations under the License.
#include "gmock/gmock.h"
-#include "src/tint/constant/scalar.h"
#include "src/tint/ir/program_test_helper.h"
+#include "src/tint/lang/base/constant/scalar.h"
#include "src/tint/lang/wgsl/ast/case_selector.h"
#include "src/tint/lang/wgsl/ast/int_literal_expression.h"
diff --git a/src/tint/ir/module.h b/src/tint/ir/module.h
index b717f4b..90bcd88 100644
--- a/src/tint/ir/module.h
+++ b/src/tint/ir/module.h
@@ -18,7 +18,6 @@
#include <memory>
#include <string>
-#include "src/tint/constant/manager.h"
#include "src/tint/core/block_allocator.h"
#include "src/tint/core/result.h"
#include "src/tint/core/vector.h"
@@ -27,6 +26,7 @@
#include "src/tint/ir/function.h"
#include "src/tint/ir/instruction.h"
#include "src/tint/ir/value.h"
+#include "src/tint/lang/base/constant/manager.h"
#include "src/tint/program_id.h"
#include "src/tint/symbol_table.h"
#include "src/tint/type/manager.h"
diff --git a/src/tint/ir/to_program.cc b/src/tint/ir/to_program.cc
index e3d0d56..45817cb 100644
--- a/src/tint/ir/to_program.cc
+++ b/src/tint/ir/to_program.cc
@@ -18,7 +18,6 @@
#include <tuple>
#include <utility>
-#include "src/tint/constant/splat.h"
#include "src/tint/core/hashmap.h"
#include "src/tint/core/math.h"
#include "src/tint/core/predicates.h"
@@ -61,6 +60,7 @@
#include "src/tint/ir/validator.h"
#include "src/tint/ir/var.h"
#include "src/tint/lang/base/builtin/builtin.h"
+#include "src/tint/lang/base/constant/splat.h"
#include "src/tint/program_builder.h"
#include "src/tint/switch.h"
#include "src/tint/type/atomic.h"
diff --git a/src/tint/constant/clone_context.h b/src/tint/lang/base/constant/clone_context.h
similarity index 86%
rename from src/tint/constant/clone_context.h
rename to src/tint/lang/base/constant/clone_context.h
index 5709baf..feea4f4 100644
--- a/src/tint/constant/clone_context.h
+++ b/src/tint/lang/base/constant/clone_context.h
@@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#ifndef SRC_TINT_CONSTANT_CLONE_CONTEXT_H_
-#define SRC_TINT_CONSTANT_CLONE_CONTEXT_H_
+#ifndef SRC_TINT_LANG_BASE_CONSTANT_CLONE_CONTEXT_H_
+#define SRC_TINT_LANG_BASE_CONSTANT_CLONE_CONTEXT_H_
#include "src/tint/type/clone_context.h"
@@ -35,4 +35,4 @@
} // namespace tint::constant
-#endif // SRC_TINT_CONSTANT_CLONE_CONTEXT_H_
+#endif // SRC_TINT_LANG_BASE_CONSTANT_CLONE_CONTEXT_H_
diff --git a/src/tint/constant/composite.cc b/src/tint/lang/base/constant/composite.cc
similarity index 93%
rename from src/tint/constant/composite.cc
rename to src/tint/lang/base/constant/composite.cc
index 488f6f0..99e8ce6 100644
--- a/src/tint/constant/composite.cc
+++ b/src/tint/lang/base/constant/composite.cc
@@ -12,11 +12,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "src/tint/constant/composite.h"
+#include "src/tint/lang/base/constant/composite.h"
#include <utility>
-#include "src/tint/constant/manager.h"
+#include "src/tint/lang/base/constant/manager.h"
TINT_INSTANTIATE_TYPEINFO(tint::constant::Composite);
diff --git a/src/tint/constant/composite.h b/src/tint/lang/base/constant/composite.h
similarity index 93%
rename from src/tint/constant/composite.h
rename to src/tint/lang/base/constant/composite.h
index acaee30..2c29b99 100644
--- a/src/tint/constant/composite.h
+++ b/src/tint/lang/base/constant/composite.h
@@ -12,14 +12,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#ifndef SRC_TINT_CONSTANT_COMPOSITE_H_
-#define SRC_TINT_CONSTANT_COMPOSITE_H_
+#ifndef SRC_TINT_LANG_BASE_CONSTANT_COMPOSITE_H_
+#define SRC_TINT_LANG_BASE_CONSTANT_COMPOSITE_H_
-#include "src/tint/constant/value.h"
#include "src/tint/core/castable.h"
#include "src/tint/core/hash.h"
#include "src/tint/core/vector.h"
#include "src/tint/lang/base/builtin/number.h"
+#include "src/tint/lang/base/constant/value.h"
#include "src/tint/type/type.h"
namespace tint::constant {
@@ -90,4 +90,4 @@
} // namespace tint::constant
-#endif // SRC_TINT_CONSTANT_COMPOSITE_H_
+#endif // SRC_TINT_LANG_BASE_CONSTANT_COMPOSITE_H_
diff --git a/src/tint/constant/composite_test.cc b/src/tint/lang/base/constant/composite_test.cc
similarity index 95%
rename from src/tint/constant/composite_test.cc
rename to src/tint/lang/base/constant/composite_test.cc
index 6a4c12d..48f9e83 100644
--- a/src/tint/constant/composite_test.cc
+++ b/src/tint/lang/base/constant/composite_test.cc
@@ -12,10 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "src/tint/constant/composite.h"
+#include "src/tint/lang/base/constant/composite.h"
-#include "src/tint/constant/scalar.h"
-#include "src/tint/constant/test_helper.h"
+#include "src/tint/lang/base/constant/scalar.h"
+#include "src/tint/lang/base/constant/test_helper.h"
namespace tint::constant {
namespace {
diff --git a/src/tint/constant/manager.cc b/src/tint/lang/base/constant/manager.cc
similarity index 93%
rename from src/tint/constant/manager.cc
rename to src/tint/lang/base/constant/manager.cc
index 1774d9f..6ad824f 100644
--- a/src/tint/constant/manager.cc
+++ b/src/tint/lang/base/constant/manager.cc
@@ -12,12 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "src/tint/constant/manager.h"
+#include "src/tint/lang/base/constant/manager.h"
-#include "src/tint/constant/composite.h"
-#include "src/tint/constant/scalar.h"
-#include "src/tint/constant/splat.h"
#include "src/tint/core/predicates.h"
+#include "src/tint/lang/base/constant/composite.h"
+#include "src/tint/lang/base/constant/scalar.h"
+#include "src/tint/lang/base/constant/splat.h"
#include "src/tint/type/abstract_float.h"
#include "src/tint/type/abstract_int.h"
#include "src/tint/type/bool.h"
diff --git a/src/tint/constant/manager.h b/src/tint/lang/base/constant/manager.h
similarity index 96%
rename from src/tint/constant/manager.h
rename to src/tint/lang/base/constant/manager.h
index 5ff7076..7cb9055 100644
--- a/src/tint/constant/manager.h
+++ b/src/tint/lang/base/constant/manager.h
@@ -12,15 +12,15 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#ifndef SRC_TINT_CONSTANT_MANAGER_H_
-#define SRC_TINT_CONSTANT_MANAGER_H_
+#ifndef SRC_TINT_LANG_BASE_CONSTANT_MANAGER_H_
+#define SRC_TINT_LANG_BASE_CONSTANT_MANAGER_H_
#include <utility>
-#include "src/tint/constant/value.h"
#include "src/tint/core/hash.h"
#include "src/tint/core/unique_allocator.h"
#include "src/tint/lang/base/builtin/number.h"
+#include "src/tint/lang/base/constant/value.h"
#include "src/tint/type/manager.h"
namespace tint::constant {
@@ -154,4 +154,4 @@
} // namespace tint::constant
-#endif // SRC_TINT_CONSTANT_MANAGER_H_
+#endif // SRC_TINT_LANG_BASE_CONSTANT_MANAGER_H_
diff --git a/src/tint/constant/manager_test.cc b/src/tint/lang/base/constant/manager_test.cc
similarity index 97%
rename from src/tint/constant/manager_test.cc
rename to src/tint/lang/base/constant/manager_test.cc
index ab6135c..d24232f 100644
--- a/src/tint/constant/manager_test.cc
+++ b/src/tint/lang/base/constant/manager_test.cc
@@ -12,10 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "src/tint/constant/manager.h"
+#include "src/tint/lang/base/constant/manager.h"
#include "gtest/gtest.h"
-#include "src/tint/constant/scalar.h"
+#include "src/tint/lang/base/constant/scalar.h"
#include "src/tint/type/abstract_float.h"
#include "src/tint/type/abstract_int.h"
#include "src/tint/type/bool.h"
diff --git a/src/tint/constant/node.cc b/src/tint/lang/base/constant/node.cc
similarity index 94%
rename from src/tint/constant/node.cc
rename to src/tint/lang/base/constant/node.cc
index 8f18ba6..2046547 100644
--- a/src/tint/constant/node.cc
+++ b/src/tint/lang/base/constant/node.cc
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "src/tint/constant/node.h"
+#include "src/tint/lang/base/constant/node.h"
TINT_INSTANTIATE_TYPEINFO(tint::constant::Node);
diff --git a/src/tint/constant/node.h b/src/tint/lang/base/constant/node.h
similarity index 87%
rename from src/tint/constant/node.h
rename to src/tint/lang/base/constant/node.h
index 64e58c3..3cac2da 100644
--- a/src/tint/constant/node.h
+++ b/src/tint/lang/base/constant/node.h
@@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#ifndef SRC_TINT_CONSTANT_NODE_H_
-#define SRC_TINT_CONSTANT_NODE_H_
+#ifndef SRC_TINT_LANG_BASE_CONSTANT_NODE_H_
+#define SRC_TINT_LANG_BASE_CONSTANT_NODE_H_
#include "src/tint/core/castable.h"
@@ -34,4 +34,4 @@
} // namespace tint::constant
-#endif // SRC_TINT_CONSTANT_NODE_H_
+#endif // SRC_TINT_LANG_BASE_CONSTANT_NODE_H_
diff --git a/src/tint/constant/scalar.cc b/src/tint/lang/base/constant/scalar.cc
similarity index 95%
rename from src/tint/constant/scalar.cc
rename to src/tint/lang/base/constant/scalar.cc
index 9a9e551..ef4f6f5 100644
--- a/src/tint/constant/scalar.cc
+++ b/src/tint/lang/base/constant/scalar.cc
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "src/tint/constant/scalar.h"
+#include "src/tint/lang/base/constant/scalar.h"
TINT_INSTANTIATE_TYPEINFO(tint::constant::ScalarBase);
TINT_INSTANTIATE_TYPEINFO(tint::constant::Scalar<tint::AInt>);
diff --git a/src/tint/constant/scalar.h b/src/tint/lang/base/constant/scalar.h
similarity index 93%
rename from src/tint/constant/scalar.h
rename to src/tint/lang/base/constant/scalar.h
index 6b999e2..24639fb 100644
--- a/src/tint/constant/scalar.h
+++ b/src/tint/lang/base/constant/scalar.h
@@ -12,14 +12,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#ifndef SRC_TINT_CONSTANT_SCALAR_H_
-#define SRC_TINT_CONSTANT_SCALAR_H_
+#ifndef SRC_TINT_LANG_BASE_CONSTANT_SCALAR_H_
+#define SRC_TINT_LANG_BASE_CONSTANT_SCALAR_H_
-#include "src/tint/constant/manager.h"
-#include "src/tint/constant/value.h"
#include "src/tint/core/castable.h"
#include "src/tint/core/hash.h"
#include "src/tint/lang/base/builtin/number.h"
+#include "src/tint/lang/base/constant/manager.h"
+#include "src/tint/lang/base/constant/value.h"
#include "src/tint/type/type.h"
namespace tint::constant {
@@ -108,4 +108,4 @@
} // namespace tint::constant
-#endif // SRC_TINT_CONSTANT_SCALAR_H_
+#endif // SRC_TINT_LANG_BASE_CONSTANT_SCALAR_H_
diff --git a/src/tint/constant/scalar_test.cc b/src/tint/lang/base/constant/scalar_test.cc
similarity index 97%
rename from src/tint/constant/scalar_test.cc
rename to src/tint/lang/base/constant/scalar_test.cc
index 49881e5..e4ad8fc 100644
--- a/src/tint/constant/scalar_test.cc
+++ b/src/tint/lang/base/constant/scalar_test.cc
@@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "src/tint/constant/scalar.h"
+#include "src/tint/lang/base/constant/scalar.h"
-#include "src/tint/constant/test_helper.h"
+#include "src/tint/lang/base/constant/test_helper.h"
namespace tint::constant {
namespace {
diff --git a/src/tint/constant/splat.cc b/src/tint/lang/base/constant/splat.cc
similarity index 91%
rename from src/tint/constant/splat.cc
rename to src/tint/lang/base/constant/splat.cc
index 8adbed7..c1eb1d7 100644
--- a/src/tint/constant/splat.cc
+++ b/src/tint/lang/base/constant/splat.cc
@@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "src/tint/constant/splat.h"
+#include "src/tint/lang/base/constant/splat.h"
-#include "src/tint/constant/manager.h"
+#include "src/tint/lang/base/constant/manager.h"
TINT_INSTANTIATE_TYPEINFO(tint::constant::Splat);
diff --git a/src/tint/constant/splat.h b/src/tint/lang/base/constant/splat.h
similarity index 92%
rename from src/tint/constant/splat.h
rename to src/tint/lang/base/constant/splat.h
index a85d5e2..5c0ca99 100644
--- a/src/tint/constant/splat.h
+++ b/src/tint/lang/base/constant/splat.h
@@ -12,12 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#ifndef SRC_TINT_CONSTANT_SPLAT_H_
-#define SRC_TINT_CONSTANT_SPLAT_H_
+#ifndef SRC_TINT_LANG_BASE_CONSTANT_SPLAT_H_
+#define SRC_TINT_LANG_BASE_CONSTANT_SPLAT_H_
-#include "src/tint/constant/composite.h"
#include "src/tint/core/castable.h"
#include "src/tint/core/vector.h"
+#include "src/tint/lang/base/constant/composite.h"
#include "src/tint/type/type.h"
namespace tint::constant {
@@ -73,4 +73,4 @@
} // namespace tint::constant
-#endif // SRC_TINT_CONSTANT_SPLAT_H_
+#endif // SRC_TINT_LANG_BASE_CONSTANT_SPLAT_H_
diff --git a/src/tint/constant/splat_test.cc b/src/tint/lang/base/constant/splat_test.cc
similarity index 94%
rename from src/tint/constant/splat_test.cc
rename to src/tint/lang/base/constant/splat_test.cc
index e310d63..b372ebb 100644
--- a/src/tint/constant/splat_test.cc
+++ b/src/tint/lang/base/constant/splat_test.cc
@@ -12,10 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "src/tint/constant/splat.h"
+#include "src/tint/lang/base/constant/splat.h"
-#include "src/tint/constant/scalar.h"
-#include "src/tint/constant/test_helper.h"
+#include "src/tint/lang/base/constant/scalar.h"
+#include "src/tint/lang/base/constant/test_helper.h"
namespace tint::constant {
namespace {
diff --git a/src/tint/constant/test_helper.h b/src/tint/lang/base/constant/test_helper.h
similarity index 87%
rename from src/tint/constant/test_helper.h
rename to src/tint/lang/base/constant/test_helper.h
index 1c4b928..0f3e281 100644
--- a/src/tint/constant/test_helper.h
+++ b/src/tint/lang/base/constant/test_helper.h
@@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#ifndef SRC_TINT_CONSTANT_TEST_HELPER_H_
-#define SRC_TINT_CONSTANT_TEST_HELPER_H_
+#ifndef SRC_TINT_LANG_BASE_CONSTANT_TEST_HELPER_H_
+#define SRC_TINT_LANG_BASE_CONSTANT_TEST_HELPER_H_
#include "gtest/gtest.h"
#include "src/tint/program_builder.h"
@@ -33,4 +33,4 @@
} // namespace tint::constant
-#endif // SRC_TINT_CONSTANT_TEST_HELPER_H_
+#endif // SRC_TINT_LANG_BASE_CONSTANT_TEST_HELPER_H_
diff --git a/src/tint/constant/value.cc b/src/tint/lang/base/constant/value.cc
similarity index 96%
rename from src/tint/constant/value.cc
rename to src/tint/lang/base/constant/value.cc
index 989f2ba..3880720 100644
--- a/src/tint/constant/value.cc
+++ b/src/tint/lang/base/constant/value.cc
@@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "src/tint/constant/value.h"
+#include "src/tint/lang/base/constant/value.h"
-#include "src/tint/constant/splat.h"
+#include "src/tint/lang/base/constant/splat.h"
#include "src/tint/switch.h"
#include "src/tint/type/array.h"
#include "src/tint/type/matrix.h"
diff --git a/src/tint/constant/value.h b/src/tint/lang/base/constant/value.h
similarity index 92%
rename from src/tint/constant/value.h
rename to src/tint/lang/base/constant/value.h
index 0e469c3..12fe265 100644
--- a/src/tint/constant/value.h
+++ b/src/tint/lang/base/constant/value.h
@@ -12,15 +12,15 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#ifndef SRC_TINT_CONSTANT_VALUE_H_
-#define SRC_TINT_CONSTANT_VALUE_H_
+#ifndef SRC_TINT_LANG_BASE_CONSTANT_VALUE_H_
+#define SRC_TINT_LANG_BASE_CONSTANT_VALUE_H_
#include <variant>
-#include "src/tint/constant/clone_context.h"
-#include "src/tint/constant/node.h"
#include "src/tint/core/castable.h"
#include "src/tint/lang/base/builtin/number.h"
+#include "src/tint/lang/base/constant/clone_context.h"
+#include "src/tint/lang/base/constant/node.h"
#include "src/tint/type/type.h"
namespace tint::constant {
@@ -90,4 +90,4 @@
} // namespace tint::constant
-#endif // SRC_TINT_CONSTANT_VALUE_H_
+#endif // SRC_TINT_LANG_BASE_CONSTANT_VALUE_H_
diff --git a/src/tint/constant/value_test.cc b/src/tint/lang/base/constant/value_test.cc
similarity index 94%
rename from src/tint/constant/value_test.cc
rename to src/tint/lang/base/constant/value_test.cc
index e715c21..b9ab506 100644
--- a/src/tint/constant/value_test.cc
+++ b/src/tint/lang/base/constant/value_test.cc
@@ -12,10 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "src/tint/constant/splat.h"
+#include "src/tint/lang/base/constant/splat.h"
-#include "src/tint/constant/scalar.h"
-#include "src/tint/constant/test_helper.h"
+#include "src/tint/lang/base/constant/scalar.h"
+#include "src/tint/lang/base/constant/test_helper.h"
namespace tint::constant {
namespace {
diff --git a/src/tint/lang/glsl/ast_writer/generator_impl.cc b/src/tint/lang/glsl/ast_writer/generator_impl.cc
index 60f7089..0498769 100644
--- a/src/tint/lang/glsl/ast_writer/generator_impl.cc
+++ b/src/tint/lang/glsl/ast_writer/generator_impl.cc
@@ -22,14 +22,14 @@
#include <utility>
#include <vector>
-#include "src/tint/constant/splat.h"
-#include "src/tint/constant/value.h"
#include "src/tint/core/defer.h"
#include "src/tint/core/map.h"
#include "src/tint/core/scoped_assignment.h"
#include "src/tint/core/string.h"
#include "src/tint/core/string_stream.h"
#include "src/tint/debug.h"
+#include "src/tint/lang/base/constant/splat.h"
+#include "src/tint/lang/base/constant/value.h"
#include "src/tint/lang/wgsl/ast/call_statement.h"
#include "src/tint/lang/wgsl/ast/id_attribute.h"
#include "src/tint/lang/wgsl/ast/internal_attribute.h"
diff --git a/src/tint/lang/hlsl/ast_writer/generator_impl.cc b/src/tint/lang/hlsl/ast_writer/generator_impl.cc
index 10c5821..9f7851e 100644
--- a/src/tint/lang/hlsl/ast_writer/generator_impl.cc
+++ b/src/tint/lang/hlsl/ast_writer/generator_impl.cc
@@ -22,8 +22,6 @@
#include <utility>
#include <vector>
-#include "src/tint/constant/splat.h"
-#include "src/tint/constant/value.h"
#include "src/tint/core/compiler_macros.h"
#include "src/tint/core/defer.h"
#include "src/tint/core/map.h"
@@ -31,6 +29,8 @@
#include "src/tint/core/string.h"
#include "src/tint/core/string_stream.h"
#include "src/tint/debug.h"
+#include "src/tint/lang/base/constant/splat.h"
+#include "src/tint/lang/base/constant/value.h"
#include "src/tint/lang/wgsl/ast/call_statement.h"
#include "src/tint/lang/wgsl/ast/id_attribute.h"
#include "src/tint/lang/wgsl/ast/internal_attribute.h"
diff --git a/src/tint/lang/msl/ast_writer/generator_impl.cc b/src/tint/lang/msl/ast_writer/generator_impl.cc
index 1b869fa..4c41bc2 100644
--- a/src/tint/lang/msl/ast_writer/generator_impl.cc
+++ b/src/tint/lang/msl/ast_writer/generator_impl.cc
@@ -21,12 +21,12 @@
#include <utility>
#include <vector>
-#include "src/tint/constant/splat.h"
-#include "src/tint/constant/value.h"
#include "src/tint/core/defer.h"
#include "src/tint/core/map.h"
#include "src/tint/core/scoped_assignment.h"
#include "src/tint/core/string_stream.h"
+#include "src/tint/lang/base/constant/splat.h"
+#include "src/tint/lang/base/constant/value.h"
#include "src/tint/lang/msl/ast_writer/generator_support.h"
#include "src/tint/lang/wgsl/ast/alias.h"
#include "src/tint/lang/wgsl/ast/bool_literal_expression.h"
diff --git a/src/tint/lang/msl/writer/generator_impl_ir.cc b/src/tint/lang/msl/writer/generator_impl_ir.cc
index 1d81a0e..53eb3ac 100644
--- a/src/tint/lang/msl/writer/generator_impl_ir.cc
+++ b/src/tint/lang/msl/writer/generator_impl_ir.cc
@@ -14,11 +14,11 @@
#include "src/tint/lang/msl/writer/generator_impl_ir.h"
-#include "src/tint/constant/composite.h"
-#include "src/tint/constant/splat.h"
#include "src/tint/core/scoped_assignment.h"
#include "src/tint/ir/constant.h"
#include "src/tint/ir/validator.h"
+#include "src/tint/lang/base/constant/composite.h"
+#include "src/tint/lang/base/constant/splat.h"
#include "src/tint/lang/msl/ast_writer/generator_support.h"
#include "src/tint/switch.h"
#include "src/tint/transform/manager.h"
diff --git a/src/tint/lang/wgsl/sem/value_expression.h b/src/tint/lang/wgsl/sem/value_expression.h
index 924cc7e..7c7cb20 100644
--- a/src/tint/lang/wgsl/sem/value_expression.h
+++ b/src/tint/lang/wgsl/sem/value_expression.h
@@ -15,7 +15,7 @@
#ifndef SRC_TINT_LANG_WGSL_SEM_VALUE_EXPRESSION_H_
#define SRC_TINT_LANG_WGSL_SEM_VALUE_EXPRESSION_H_
-#include "src/tint/constant/value.h"
+#include "src/tint/lang/base/constant/value.h"
#include "src/tint/lang/wgsl/sem/behavior.h"
#include "src/tint/lang/wgsl/sem/evaluation_stage.h"
#include "src/tint/lang/wgsl/sem/expression.h"
diff --git a/src/tint/program.h b/src/tint/program.h
index cdc2041..a4a2963 100644
--- a/src/tint/program.h
+++ b/src/tint/program.h
@@ -18,7 +18,7 @@
#include <string>
#include <unordered_set>
-#include "src/tint/constant/manager.h"
+#include "src/tint/lang/base/constant/manager.h"
#include "src/tint/lang/wgsl/ast/function.h"
#include "src/tint/lang/wgsl/sem/info.h"
#include "src/tint/program_id.h"
diff --git a/src/tint/program_builder.h b/src/tint/program_builder.h
index 212540c..c27d090 100644
--- a/src/tint/program_builder.h
+++ b/src/tint/program_builder.h
@@ -21,13 +21,13 @@
#include "tint/override_id.h"
-#include "src/tint/constant/manager.h"
#include "src/tint/core/string.h"
#include "src/tint/lang/base/builtin/extension.h"
#include "src/tint/lang/base/builtin/fluent_types.h"
#include "src/tint/lang/base/builtin/interpolation_sampling.h"
#include "src/tint/lang/base/builtin/interpolation_type.h"
#include "src/tint/lang/base/builtin/number.h"
+#include "src/tint/lang/base/constant/manager.h"
#include "src/tint/lang/wgsl/ast/alias.h"
#include "src/tint/lang/wgsl/ast/assignment_statement.h"
#include "src/tint/lang/wgsl/ast/binary_expression.h"
diff --git a/src/tint/resolver/const_eval.cc b/src/tint/resolver/const_eval.cc
index 791965e..e65ed5b 100644
--- a/src/tint/resolver/const_eval.cc
+++ b/src/tint/resolver/const_eval.cc
@@ -22,16 +22,16 @@
#include <type_traits>
#include <utility>
-#include "src/tint/constant/composite.h"
-#include "src/tint/constant/scalar.h"
-#include "src/tint/constant/splat.h"
-#include "src/tint/constant/value.h"
#include "src/tint/core/bitcast.h"
#include "src/tint/core/compiler_macros.h"
#include "src/tint/core/map.h"
#include "src/tint/core/string_stream.h"
#include "src/tint/core/transform.h"
#include "src/tint/lang/base/builtin/number.h"
+#include "src/tint/lang/base/constant/composite.h"
+#include "src/tint/lang/base/constant/scalar.h"
+#include "src/tint/lang/base/constant/splat.h"
+#include "src/tint/lang/base/constant/value.h"
#include "src/tint/lang/wgsl/sem/member_accessor_expression.h"
#include "src/tint/lang/wgsl/sem/value_constructor.h"
#include "src/tint/program_builder.h"
diff --git a/src/tint/resolver/const_eval_conversion_test.cc b/src/tint/resolver/const_eval_conversion_test.cc
index 6a148e8..2df3460 100644
--- a/src/tint/resolver/const_eval_conversion_test.cc
+++ b/src/tint/resolver/const_eval_conversion_test.cc
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "src/tint/constant/splat.h"
+#include "src/tint/lang/base/constant/splat.h"
#include "src/tint/lang/wgsl/sem/materialize.h"
#include "src/tint/resolver/const_eval_test.h"
diff --git a/src/tint/resolver/const_eval_runtime_semantics_test.cc b/src/tint/resolver/const_eval_runtime_semantics_test.cc
index 2e41482..7908ca6 100644
--- a/src/tint/resolver/const_eval_runtime_semantics_test.cc
+++ b/src/tint/resolver/const_eval_runtime_semantics_test.cc
@@ -14,7 +14,7 @@
#include "src/tint/resolver/const_eval_test.h"
-#include "src/tint/constant/scalar.h"
+#include "src/tint/lang/base/constant/scalar.h"
using namespace tint::number_suffixes; // NOLINT
diff --git a/src/tint/resolver/resolver.h b/src/tint/resolver/resolver.h
index f3596ea..4260f04 100644
--- a/src/tint/resolver/resolver.h
+++ b/src/tint/resolver/resolver.h
@@ -23,9 +23,9 @@
#include <utility>
#include <vector>
-#include "src/tint/constant/value.h"
#include "src/tint/core/bitset.h"
#include "src/tint/core/unique_vector.h"
+#include "src/tint/lang/base/constant/value.h"
#include "src/tint/lang/wgsl/sem/binding_point.h"
#include "src/tint/lang/wgsl/sem/block_statement.h"
#include "src/tint/lang/wgsl/sem/function.h"
diff --git a/src/tint/writer/spirv/builder.cc b/src/tint/writer/spirv/builder.cc
index 6f76c6f..e25e342 100644
--- a/src/tint/writer/spirv/builder.cc
+++ b/src/tint/writer/spirv/builder.cc
@@ -18,11 +18,11 @@
#include <utility>
#include "spirv/unified1/GLSL.std.450.h"
-#include "src/tint/constant/value.h"
#include "src/tint/core/compiler_macros.h"
#include "src/tint/core/defer.h"
#include "src/tint/core/map.h"
#include "src/tint/core/string_stream.h"
+#include "src/tint/lang/base/constant/value.h"
#include "src/tint/lang/wgsl/ast/call_statement.h"
#include "src/tint/lang/wgsl/ast/id_attribute.h"
#include "src/tint/lang/wgsl/ast/internal_attribute.h"
diff --git a/src/tint/writer/spirv/ir/generator_impl_ir.cc b/src/tint/writer/spirv/ir/generator_impl_ir.cc
index 721048f..b5938a0 100644
--- a/src/tint/writer/spirv/ir/generator_impl_ir.cc
+++ b/src/tint/writer/spirv/ir/generator_impl_ir.cc
@@ -18,7 +18,6 @@
#include "spirv/unified1/GLSL.std.450.h"
#include "spirv/unified1/spirv.h"
-#include "src/tint/constant/scalar.h"
#include "src/tint/core/scoped_assignment.h"
#include "src/tint/ir/access.h"
#include "src/tint/ir/binary.h"
@@ -56,6 +55,7 @@
#include "src/tint/ir/user_call.h"
#include "src/tint/ir/validator.h"
#include "src/tint/ir/var.h"
+#include "src/tint/lang/base/constant/scalar.h"
#include "src/tint/switch.h"
#include "src/tint/transform/manager.h"
#include "src/tint/type/array.h"
diff --git a/src/tint/writer/spirv/ir/generator_impl_ir.h b/src/tint/writer/spirv/ir/generator_impl_ir.h
index ce713b2..ba1e464 100644
--- a/src/tint/writer/spirv/ir/generator_impl_ir.h
+++ b/src/tint/writer/spirv/ir/generator_impl_ir.h
@@ -17,7 +17,6 @@
#include <vector>
-#include "src/tint/constant/value.h"
#include "src/tint/core/diagnostic/diagnostic.h"
#include "src/tint/core/hashmap.h"
#include "src/tint/core/vector.h"
@@ -25,6 +24,7 @@
#include "src/tint/lang/base/builtin/address_space.h"
#include "src/tint/lang/base/builtin/builtin_value.h"
#include "src/tint/lang/base/builtin/texel_format.h"
+#include "src/tint/lang/base/constant/value.h"
#include "src/tint/symbol.h"
#include "src/tint/writer/spirv/binary_writer.h"
#include "src/tint/writer/spirv/function.h"