[webkit-changes] [WebKit/WebKit] afec2b: [WGSL] Add support for switch statements

Tadeu Zagallo noreply at github.com
Fri Oct 20 13:02:47 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: afec2be5706616f59530963bbf45cf0332c7f801
      https://github.com/WebKit/WebKit/commit/afec2be5706616f59530963bbf45cf0332c7f801
  Author: Tadeu Zagallo <tzagallo at apple.com>
  Date:   2023-10-20 (Fri, 20 Oct 2023)

  Changed paths:
    M Source/WebGPU/WGSL/AST/ASTForward.h
    M Source/WebGPU/WGSL/AST/ASTSwitchStatement.h
    M Source/WebGPU/WGSL/AST/ASTVisitor.cpp
    M Source/WebGPU/WGSL/AST/ASTVisitor.h
    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
    A Source/WebGPU/WGSL/tests/invalid/switch.wgsl
    A Source/WebGPU/WGSL/tests/valid/switch.wgsl

  Log Message:
  -----------
  [WGSL] Add support for switch statements
https://bugs.webkit.org/show_bug.cgi?id=263404
rdar://117224289

Reviewed by Dan Glastonbury.

Add parsing, type checking and code generation for switch statements.

* Source/WebGPU/WGSL/AST/ASTForward.h:
* Source/WebGPU/WGSL/AST/ASTSwitchStatement.h:
* Source/WebGPU/WGSL/AST/ASTVisitor.cpp:
(WGSL::AST::Visitor::visit):
* Source/WebGPU/WGSL/AST/ASTVisitor.h:
* Source/WebGPU/WGSL/Metal/MetalFunctionWriter.cpp:
(WGSL::Metal::FunctionDefinitionWriter::visit):
* Source/WebGPU/WGSL/Parser.cpp:
(WGSL::Parser<Lexer>::parseStatement):
(WGSL::Parser<Lexer>::parseSwitchStatement):
* Source/WebGPU/WGSL/ParserPrivate.h:
* Source/WebGPU/WGSL/TypeCheck.cpp:
(WGSL::TypeChecker::visit):
* Source/WebGPU/WGSL/tests/invalid/switch.wgsl: Added.
* Source/WebGPU/WGSL/tests/valid/switch.wgsl: Added.

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




More information about the webkit-changes mailing list