Implement type inference

Bug: tint:672
Change-Id: I3f586ee867f75427c4e8c309f72fb468643c23c0
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/53182
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
This commit is contained in:
Antonio Maiorano
2021-06-04 15:28:47 +00:00
committed by Tint LUCI CQ
parent 7697c31e84
commit 9834fefa7f
27 changed files with 1096 additions and 30 deletions

View File

@@ -55,15 +55,6 @@ TEST_F(ModuleTest, Assert_Null_GlobalVariable) {
"internal compiler error");
}
TEST_F(ModuleTest, Assert_Invalid_GlobalVariable) {
EXPECT_FATAL_FAILURE(
{
ProgramBuilder builder;
builder.Global("var", nullptr, StorageClass::kInput);
},
"internal compiler error");
}
TEST_F(ModuleTest, Assert_Null_ConstructedType) {
EXPECT_FATAL_FAILURE(
{

View File

@@ -40,8 +40,6 @@ Variable::Variable(ProgramID program_id,
declared_storage_class_(declared_storage_class) {
TINT_ASSERT(symbol_.IsValid());
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(symbol_, program_id);
// no type means we must have a constructor to infer it
TINT_ASSERT(type_ || constructor);
TINT_ASSERT_PROGRAM_IDS_EQUAL_IF_VALID(constructor, program_id);
}

View File

@@ -71,15 +71,6 @@ TEST_F(VariableTest, Assert_MissingSymbol) {
"internal compiler error");
}
TEST_F(VariableTest, Assert_Null_Type) {
EXPECT_FATAL_FAILURE(
{
ProgramBuilder b;
b.Var("x", nullptr, StorageClass::kNone);
},
"internal compiler error");
}
TEST_F(VariableTest, Assert_DifferentProgramID_Symbol) {
EXPECT_FATAL_FAILURE(
{