[webkit-changes] [WebKit/WebKit] ba5203: [WGSL] Remove Value subtree from AST hierarchy

Dan Glastonbury noreply at github.com
Fri Feb 17 15:00:28 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: ba5203d0ebe9a99b679304bdee8297cd209982ba
      https://github.com/WebKit/WebKit/commit/ba5203d0ebe9a99b679304bdee8297cd209982ba
  Author: Dan Glastonbury <djg at apple.com>
  Date:   2023-02-17 (Fri, 17 Feb 2023)

  Changed paths:
    M Source/WebGPU/WGSL/AST/AST.h
    R Source/WebGPU/WGSL/AST/ASTConstantValue.h
    M Source/WebGPU/WGSL/AST/ASTForward.h
    M Source/WebGPU/WGSL/AST/ASTFunction.h
    R Source/WebGPU/WGSL/AST/ASTLetValue.h
    M Source/WebGPU/WGSL/AST/ASTNode.h
    R Source/WebGPU/WGSL/AST/ASTOverrideValue.h
    A Source/WebGPU/WGSL/AST/ASTParameter.h
    R Source/WebGPU/WGSL/AST/ASTParameterValue.h
    M Source/WebGPU/WGSL/AST/ASTStatement.h
    M Source/WebGPU/WGSL/AST/ASTStringDumper.cpp
    M Source/WebGPU/WGSL/AST/ASTStringDumper.h
    R Source/WebGPU/WGSL/AST/ASTValue.h
    R Source/WebGPU/WGSL/AST/ASTValueStatement.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/EntryPointRewriter.cpp
    M Source/WebGPU/WGSL/GlobalVariableRewriter.cpp
    M Source/WebGPU/WGSL/Metal/MetalFunctionWriter.cpp
    M Source/WebGPU/WGSL/Parser.cpp
    M Source/WebGPU/WGSL/ParserPrivate.h
    M Source/WebGPU/WGSL/WGSLShaderModule.h
    M Source/WebGPU/WebGPU.xcodeproj/project.pbxproj
    M Tools/TestWebKitAPI/Tests/WGSL/ParserTests.cpp

  Log Message:
  -----------
  [WGSL] Remove Value subtree from AST hierarchy
https://bugs.webkit.org/show_bug.cgi?id=252458
rdar://problem/105581875

Reviewed by Tadeu Zagallo.

Addressing review comment from PR #9369 to remove `ParameterValue` from being
grouped with other kinds of variables. Also eliminate the `Value` subtree of
types and introduce variable "flavor" to represent the kind of `Variable`:
`const`, `let`, `override` or `var`. This change greatly simplified the
implementation of `let` variables through out the various compiler passes.

* Source/WebGPU/WGSL/AST/AST.h:
* Source/WebGPU/WGSL/AST/ASTConstantValue.h: Removed.
* Source/WebGPU/WGSL/AST/ASTForward.h:
* Source/WebGPU/WGSL/AST/ASTFunction.h:
* Source/WebGPU/WGSL/AST/ASTLetValue.h: Removed.
* Source/WebGPU/WGSL/AST/ASTNode.h:
* Source/WebGPU/WGSL/AST/ASTOverrideValue.h: Removed.
* Source/WebGPU/WGSL/AST/ASTParameter.h: Renamed from Source/WebGPU/WGSL/AST/ASTParameterValue.h.
* Source/WebGPU/WGSL/AST/ASTStatement.h:
(isType):
* Source/WebGPU/WGSL/AST/ASTStringDumper.cpp:
(WGSL::AST::StringDumper::visit):
* Source/WebGPU/WGSL/AST/ASTStringDumper.h:
* Source/WebGPU/WGSL/AST/ASTValue.h: Removed.
* Source/WebGPU/WGSL/AST/ASTValueStatement.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/EntryPointRewriter.cpp:
(WGSL::EntryPointRewriter::rewrite):
(WGSL::EntryPointRewriter::materialize):
(WGSL::EntryPointRewriter::visit):
(WGSL::EntryPointRewriter::appendBuiltins):
* Source/WebGPU/WGSL/GlobalVariableRewriter.cpp:
(WGSL::RewriteGlobalVariables::insertParameters):
* Source/WebGPU/WGSL/Metal/MetalFunctionWriter.cpp:
(WGSL::Metal::FunctionDefinitionWriter::visit):
(WGSL::Metal::FunctionDefinitionWriter::visitArgumentBufferParameter):
* Source/WebGPU/WGSL/Parser.cpp:
(WGSL::Types::includes):
(WGSL::Types::appendNameTo):
(WGSL::Types<TT>::includes):
(WGSL::Types<TT>::appendNameTo):
(WGSL::Parser<Lexer>::consumeTypes):
(WGSL::Parser<Lexer>::parseGlobalDecl):
(WGSL::Parser<Lexer>::parseVariableWithAttributes):
(WGSL::Parser<Lexer>::parseFunction):
(WGSL::Parser<Lexer>::parseParameter):
(WGSL::Parser<Lexer>::parseStatement):
(WGSL::Parser<Lexer>::parseParameterValue): Deleted.
(WGSL::Parser<Lexer>::parseConstantValue): Deleted.
(WGSL::Parser<Lexer>::parseLetValue): Deleted.
(WGSL::Parser<Lexer>::parseOverrideValueWithAttributes): Deleted.
* Source/WebGPU/WGSL/ParserPrivate.h:
* Source/WebGPU/WGSL/WGSLShaderModule.h:
(WGSL::ShaderModule::structures):
(WGSL::ShaderModule::values): Deleted.
* Source/WebGPU/WebGPU.xcodeproj/project.pbxproj:
* Tools/TestWebKitAPI/Tests/WGSL/ParserTests.cpp:
(TestWGSLAPI::TEST):

Canonical link: https://commits.webkit.org/260473@main




More information about the webkit-changes mailing list