Convert @location to store expression internally.

This CL updates the internal storage for a `@location` attribute
to store the `Expression` instead of a raw `uint32_t`. The current
parser is updated to generate an `IntLiteralExpression` so we still
parse as a `uint32_t` at the moment.

Bug: tint:1633
Change-Id: I2b9684754a657b39554160c81727cf1541bee96c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/101461
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
This commit is contained in:
dan sinclair
2022-09-07 22:25:24 +00:00
committed by Dawn LUCI CQ
parent 145337f309
commit f9eeed6106
41 changed files with 387 additions and 249 deletions

View File

@@ -19,6 +19,7 @@
namespace tint::sem {
namespace {
using namespace tint::number_suffixes; // NOLINT
using StructTest = TestHelper;
TEST_F(StructTest, Creation) {
@@ -107,7 +108,7 @@ TEST_F(StructTest, Layout) {
TEST_F(StructTest, Location) {
auto* st = Structure("st", utils::Vector{
Member("a", ty.i32(), utils::Vector{Location(1u)}),
Member("a", ty.i32(), utils::Vector{Location(1_u)}),
Member("b", ty.u32()),
});