Rename TypeDeterminer to Resolver

Move out of the src root and into its own subdirectory
Rename methods to remove the 'Determine' prefix.

Fixed: tint:529
Change-Id: Idf89d647780f8a2e7495c1c9e6c402e00ad45b7c
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/44041
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: David Neto <dneto@google.com>
This commit is contained in:
Ben Clayton
2021-03-09 10:54:37 +00:00
committed by Commit Bot service account
parent fd31bbd3f1
commit 5f0ea11365
59 changed files with 648 additions and 705 deletions

View File

@@ -24,7 +24,7 @@
┃ ┌┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┃┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┐
▲ ┆ Build ▼ ┆
┏━━━┻━━━┓ ┆ ┏━━━━━━━━┻━━━━━━━━┓ ┆
┃ Clone ┃ ┆ ┃ Type Determiner ┃ ┆
┃ Clone ┃ ┆ ┃ Resolver ┃ ┆
┗━━━┳━━━┛ ┆ ┗━━━━━━━━━━━━━━━━━┛ ┆
▲ └┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┃┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┘
┃ ▼
@@ -69,8 +69,8 @@ simpler. A `ProgramBuilder` can only be used once, and must be discarded after
the `Program` is constructed.
A `Program` is built from the `ProgramBuilder` by `std::move()`ing the
`ProgramBuilder` to a new `Program` object. When built, type determination is
run so the produced `Program` will contain all the needed semantic information.
`ProgramBuilder` to a new `Program` object. When built, resolution is performed
so the produced `Program` will contain all the needed semantic information.
At any time before building the `Program`, `ProgramBuilder::IsValid()` may be
called to ensure the AST is **structurally** correct. This checks that things
@@ -101,7 +101,7 @@ can set, aside from storing it as an unsigned integer.
## Types
Types are constructed during the Reader and Type Determination phases, and are
Types are constructed during the Reader and resolution phases, and are
held by the `Program` or `ProgramBuilder`. AST and semantic nodes can both
reference types.
@@ -120,7 +120,7 @@ a higher / more abstract level than the AST. This includes information such as
the resolved type of each expression, the resolved overload of an intrinsic
function call, and the module scoped variables used by each function.
Semantic information is generated by the `TypeDeterminer` when the `Program`
Semantic information is generated by the `Resolver` when the `Program`
is built from a `ProgramBuilder`.
The `semantic::Info` class holds a map of `ast::Node`s to `semantic::Node`s.
@@ -142,15 +142,15 @@ During the Writer phase, symbols may be emitted as strings using a `Namer`.
A `Namer` may output the symbol in any form that preserves the uniqueness of
that symbol.
## Type Determiner
## Resolver
The `TypeDeterminer` will automatically run when a `Program` is built.
A `TypeDeterminer` creates the `Program`s semantic information by analyzing the
The `Resolver` will automatically run when a `Program` is built.
A `Resolver` creates the `Program`s semantic information by analyzing the
`Program`s AST and type information.
The `TypeDeterminer` will do the minimal amount of validation required in order
The `Resolver` will do the minimal amount of validation required in order
to always be accessing valid nodes, reporting any errors found in the
`Program`'s diagnostics. Even if the `TypeDeterminer` doesn't generate any
`Program`'s diagnostics. Even if the `Resolver` doesn't generate any
errors doesn't mean the generated `Program` is semantically valid. Use the
`Validator` to check for a `Program`'s final validity.
@@ -158,10 +158,10 @@ errors doesn't mean the generated `Program` is semantically valid. Use the
A `Program` holds an immutable version of the information from the
`ProgramBuilder` along with semantic information generated by the
`TypeDeterminer`.
`Resolver`.
Like `ProgramBuilder`, `Program::IsValid()` may be called to ensure the AST is
structurally correct and that the `TypeDeterminer` did not report any errors.
structurally correct and that the `Resolver` did not report any errors.
`Program::IsValid()` does not perform semantic validation, use the `Validator`
to check for a `Program`'s final validity.
@@ -192,7 +192,7 @@ This is for things like Vertex Pulling or Robust Buffer Access.
A transform operates by cloning the input `Program` into a new `ProgramBuilder`,
applying the required changes, and then finally building and returning a new
output `Program`. As type determination is always run when a `Program` is built,
output `Program`. As the resolver is always run when a `Program` is built,
Transforms will always emit a `Program` with semantic information.
The input `Program` to a transform must be valid (pass validation).