[webkit-changes] [WebKit/WebKit] f5b0fa: [WGSL] Remove ASTTypeName
Tadeu Zagallo
noreply at github.com
Thu Sep 7 05:33:40 PDT 2023
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: f5b0fa4602967ab41351a98cb72c932d76068c63
https://github.com/WebKit/WebKit/commit/f5b0fa4602967ab41351a98cb72c932d76068c63
Author: Tadeu Zagallo <tzagallo at apple.com>
Date: 2023-09-07 (Thu, 07 Sep 2023)
Changed paths:
M Source/WebGPU/WGSL/AST/AST.h
A Source/WebGPU/WGSL/AST/ASTArrayTypeExpression.h
M Source/WebGPU/WGSL/AST/ASTBitcastExpression.h
M Source/WebGPU/WGSL/AST/ASTCallExpression.h
A Source/WebGPU/WGSL/AST/ASTElaboratedTypeExpression.h
M Source/WebGPU/WGSL/AST/ASTExpression.h
M Source/WebGPU/WGSL/AST/ASTForward.h
M Source/WebGPU/WGSL/AST/ASTFunction.h
M Source/WebGPU/WGSL/AST/ASTNode.h
M Source/WebGPU/WGSL/AST/ASTParameter.h
A Source/WebGPU/WGSL/AST/ASTReferenceTypeExpression.h
M Source/WebGPU/WGSL/AST/ASTStringDumper.cpp
M Source/WebGPU/WGSL/AST/ASTStringDumper.h
M Source/WebGPU/WGSL/AST/ASTStructureMember.h
R Source/WebGPU/WGSL/AST/ASTTypeName.h
M Source/WebGPU/WGSL/AST/ASTVariable.h
M Source/WebGPU/WGSL/AST/ASTVisitor.cpp
M Source/WebGPU/WGSL/AST/ASTVisitor.h
M Source/WebGPU/WGSL/CallGraph.cpp
M Source/WebGPU/WGSL/ConstantRewriter.cpp
M Source/WebGPU/WGSL/EntryPointRewriter.cpp
M Source/WebGPU/WGSL/GlobalSorting.cpp
M Source/WebGPU/WGSL/GlobalVariableRewriter.cpp
M Source/WebGPU/WGSL/MangleNames.cpp
M Source/WebGPU/WGSL/Metal/MetalFunctionWriter.cpp
M Source/WebGPU/WGSL/Parser.cpp
M Source/WebGPU/WGSL/ParserPrivate.h
M Source/WebGPU/WGSL/TypeCheck.cpp
M Source/WebGPU/WGSL/TypeStore.cpp
M Source/WebGPU/WGSL/TypeStore.h
M Source/WebGPU/WGSL/Types.h
M Source/WebGPU/WebGPU.xcodeproj/project.pbxproj
M Tools/TestWebKitAPI/Tests/WGSL/ParserTests.cpp
Log Message:
-----------
[WGSL] Remove ASTTypeName
https://bugs.webkit.org/show_bug.cgi?id=261207
rdar://115060930
Reviewed by Mike Wyrzykowski.
Currently, the AST treats type nodes as unrelated from expression nodes.
This doesn't match the reference grammar, and causes issues since expressions
are allowed as arguments to elaborated types.
* Source/WebGPU/WGSL/AST/AST.h:
* Source/WebGPU/WGSL/AST/ASTArrayTypeExpression.h: Copied from Source/WebGPU/WGSL/AST/ASTBitcastExpression.h.
(WGSL::AST::ArrayTypeExpression::maybeElementType const):
(WGSL::AST::ArrayTypeExpression::maybeElementCount const):
(WGSL::AST::ArrayTypeExpression::ArrayTypeExpression):
* Source/WebGPU/WGSL/AST/ASTBitcastExpression.h:
* Source/WebGPU/WGSL/AST/ASTCallExpression.h:
* Source/WebGPU/WGSL/AST/ASTElaboratedExpression.h: Copied from Source/WebGPU/WGSL/AST/ASTBitcastExpression.h.
(WGSL::AST::ElaboratedExpression::base):
(WGSL::AST::ElaboratedExpression::arguments):
(WGSL::AST::ElaboratedExpression::ElaboratedExpression):
* Source/WebGPU/WGSL/AST/ASTExpression.h:
* Source/WebGPU/WGSL/AST/ASTForward.h:
* Source/WebGPU/WGSL/AST/ASTFunction.h:
* Source/WebGPU/WGSL/AST/ASTNode.h:
* Source/WebGPU/WGSL/AST/ASTParameter.h:
* Source/WebGPU/WGSL/AST/ASTReferenceTypeExpression.h: Copied from Source/WebGPU/WGSL/AST/ASTBitcastExpression.h.
* Source/WebGPU/WGSL/AST/ASTStringDumper.cpp:
(WGSL::AST::StringDumper::visit):
* Source/WebGPU/WGSL/AST/ASTStringDumper.h:
* Source/WebGPU/WGSL/AST/ASTStructureMember.h:
* Source/WebGPU/WGSL/AST/ASTTypeName.h: Removed.
* Source/WebGPU/WGSL/AST/ASTVariable.h:
* Source/WebGPU/WGSL/AST/ASTVisitor.cpp:
(WGSL::AST::Visitor::visit):
* Source/WebGPU/WGSL/AST/ASTVisitor.h:
* Source/WebGPU/WGSL/CallGraph.cpp:
(WGSL::CallGraphBuilder::visit):
* Source/WebGPU/WGSL/ConstantRewriter.cpp:
(WGSL::ConstantRewriter::visit):
* Source/WebGPU/WGSL/EntryPointRewriter.cpp:
(WGSL::EntryPointRewriter::rewrite):
(WGSL::EntryPointRewriter::checkReturnType):
(WGSL::EntryPointRewriter::visit):
* Source/WebGPU/WGSL/GlobalSorting.cpp:
* Source/WebGPU/WGSL/GlobalVariableRewriter.cpp:
(WGSL::RewriteGlobalVariables::pack):
(WGSL::RewriteGlobalVariables::packResource):
(WGSL::RewriteGlobalVariables::packStructResource):
(WGSL::RewriteGlobalVariables::packArrayResource):
(WGSL::RewriteGlobalVariables::updateReference):
(WGSL::bindingMemberForGlobal):
(WGSL::RewriteGlobalVariables::insertParameters):
* Source/WebGPU/WGSL/MangleNames.cpp:
* Source/WebGPU/WGSL/Metal/MetalFunctionWriter.cpp:
(WGSL::Metal::FunctionDefinitionWriter::visit):
(WGSL::Metal::FunctionDefinitionWriter::visitArgumentBufferParameter):
* Source/WebGPU/WGSL/Parser.cpp:
(WGSL::Parser<Lexer>::parseTypeName):
(WGSL::Parser<Lexer>::parseTypeNameAfterIdentifier):
(WGSL::Parser<Lexer>::parseArrayType):
(WGSL::Parser<Lexer>::parseVariableWithAttributes):
(WGSL::Parser<Lexer>::parseFunction):
* Source/WebGPU/WGSL/ParserPrivate.h:
* Source/WebGPU/WGSL/TypeCheck.cpp:
(WGSL::TypeChecker::visitVariable):
(WGSL::TypeChecker::visit):
(WGSL::TypeChecker::resolve):
(WGSL::TypeChecker::allocateSimpleConstructor):
* Source/WebGPU/WGSL/TypeStore.cpp:
(WGSL::TypeStore::typeConstructorType):
* Source/WebGPU/WGSL/TypeStore.h:
* Source/WebGPU/WGSL/Types.h:
* Source/WebGPU/WebGPU.xcodeproj/project.pbxproj:
Canonical link: https://commits.webkit.org/267724@main
More information about the webkit-changes
mailing list