sem: Rename methods of sem::Pointer and Reference

Rename:
* type() to StoreType()
* storage_class() to StorageClass()

Move away from snake_case methods in the semantic namespace.
Try to avoid generic 'type()' method names.

Also add an assertion to detect doubly nested references (these are
invalid).

Bug: tint:727
Change-Id: I975a3f1e5fbed7947cc2fc156fee892b282c63de
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/51220
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: David Neto <dneto@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
This commit is contained in:
Ben Clayton
2021-05-17 20:38:17 +00:00
committed by Commit Bot service account
parent 7b25769aed
commit c5eebaf7d6
12 changed files with 40 additions and 34 deletions

View File

@@ -334,7 +334,7 @@ void InsertGlobal(CloneContext& ctx,
const ast::NamedType* ConstructedTypeOf(const sem::Type* ty) {
while (true) {
if (auto* ptr = ty->As<sem::Pointer>()) {
ty = ptr->type();
ty = ptr->StoreType();
continue;
}
if (auto* str = ty->As<sem::Struct>()) {