Add tint layering doc.

A simple MD file to show the source set hierarchy which constrains where
includes can go in Tint.

Change-Id: Ia360430793faef01503260f29f88ef361bb91611
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/120443
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
This commit is contained in:
dan sinclair 2023-02-20 09:56:29 +00:00 committed by Dawn LUCI CQ
parent adcc598cc7
commit accc687b32
1 changed files with 68 additions and 0 deletions

68
docs/tint/layering.md Normal file
View File

@ -0,0 +1,68 @@
# Tint Source Layering
The `BUILD.gn` is setup with small source units for various components
in Tint. The hierarchy of sources almost matches to folder structure in
tint (except for `base` which is a mix of things in `src/tint` and
`src/tint/util`.
```
+-----------------------------------------+
| Readers | Writers |
+-----------------------------------------+
|
V
+-----------------------------------------+
| Val | Demangler | Inspector | Transform |
+-----------------------------------------+
| |
+--------------+------------------------------+
| |
V V
+-----------------------------------------+ +-----------+
| AST | | Utils IO |
+-----------------------------------------+ +-----------+
| |
V |
+-----------------------------------------+ |
| Program | Sem | |
+-----------------------------------------+ |
| |
V |
+-----------------------------------------+ |
| AST Hdrs | |
| (program and sem cause a cycle) | |
+-----------------------------------------+ |
| |
V |
+-----------------------------------------+ |
| Clone Context Hdrs | |
| (program and sem cause a cycle) | |
+-----------------------------------------+ |
| |
V |
+-----------------------------------------+ |
| Constant | |
+-----------------------------------------+ |
| |
V |
+-----------------------------------------+ |
| Types | |
+-----------------------------------------+ |
| |
V |
+-----------------------------------------+ |
| Builtin | |
+-----------------------------------------+ |
| |
|------------------------------+
V
+-----------------------------------------+
| Base |
+-----------------------------------------+
|
V
+-----------------------------------------+ +-------------+
| Text (unicode) | | Initializer |
+-----------------------------------------+ +-------------+
```