[webkit-changes] [WebKit/WebKit] 3b30d3: [WGSL] Move builtin types into their own class
Tadeu Zagallo
noreply at github.com
Mon Feb 6 03:20:46 PST 2023
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 3b30d3baaa8fe572c7c167f5ca5224300d598d8e
https://github.com/WebKit/WebKit/commit/3b30d3baaa8fe572c7c167f5ca5224300d598d8e
Author: Tadeu Zagallo <tzagallo at apple.com>
Date: 2023-02-06 (Mon, 06 Feb 2023)
Changed paths:
M Source/WebGPU/WGSL/TypeCheck.cpp
A Source/WebGPU/WGSL/TypeStore.cpp
A Source/WebGPU/WGSL/TypeStore.h
M Source/WebGPU/WebGPU.xcodeproj/project.pbxproj
Log Message:
-----------
[WGSL] Move builtin types into their own class
https://bugs.webkit.org/show_bug.cgi?id=251683
rdar://105003822
Reviewed by Myles C. Maxfield.
As suggested in #9539, it's nicer to have the types be managed by their own class
instead of living in the type checker. Ideally this type store should be owned by
the same container that owns the AST, but that container doesn't exist yet, it'll
come in a next refactor.
* Source/WebGPU/WGSL/TypeCheck.cpp:
(WGSL::TypeChecker::TypeChecker):
(WGSL::TypeChecker::visit):
(WGSL::TypeChecker::allocateType): Deleted.
* Source/WebGPU/WGSL/TypeStore.cpp: Added.
(WGSL::TypeStore::TypeStore):
(WGSL::TypeStore::allocateType):
(WGSL::TypeStore::allocateConstructor):
* Source/WebGPU/WGSL/TypeStore.h: Added.
(WGSL::TypeStore::voidType const):
(WGSL::TypeStore::boolType const):
(WGSL::TypeStore::abstractIntType const):
(WGSL::TypeStore::i32Type const):
(WGSL::TypeStore::u32Type const):
(WGSL::TypeStore::abstractFloatType const):
(WGSL::TypeStore::f32Type const):
* Source/WebGPU/WebGPU.xcodeproj/project.pbxproj:
Canonical link: https://commits.webkit.org/259887@main
More information about the webkit-changes
mailing list