[webkit-changes] [WebKit/WebKit] 243c46: [WGSL] Add support for binary add

Tadeu Zagallo noreply at github.com
Fri Jan 20 06:13:07 PST 2023


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

  Changed paths:
    M Source/WebGPU/WGSL/AST/AST.h
    A Source/WebGPU/WGSL/AST/ASTBinaryExpression.h
    M Source/WebGPU/WGSL/AST/ASTForward.h
    M Source/WebGPU/WGSL/AST/ASTNode.h
    M Source/WebGPU/WGSL/AST/ASTStringDumper.cpp
    M Source/WebGPU/WGSL/AST/ASTStringDumper.h
    M Source/WebGPU/WGSL/AST/ASTVisitor.cpp
    M Source/WebGPU/WGSL/AST/ASTVisitor.h
    M Source/WebGPU/WGSL/Lexer.cpp
    M Source/WebGPU/WGSL/Metal/MetalFunctionWriter.cpp
    M Source/WebGPU/WGSL/Parser.cpp
    M Source/WebGPU/WGSL/ParserPrivate.h
    M Source/WebGPU/WGSL/Token.cpp
    M Source/WebGPU/WGSL/Token.h
    M Tools/TestWebKitAPI/Tests/WGSL/LexerTests.cpp
    M Tools/TestWebKitAPI/Tests/WGSL/ParserTests.cpp

  Log Message:
  -----------
  [WGSL] Add support for binary add
https://bugs.webkit.org/show_bug.cgi?id=250849
<rdar://problem/104432245>

Reviewed by Myles C. Maxfield.

Add lexing for `+` and `++`, add a new BinaryExpression AST node,
implement parsing and codegen for add.

* Source/WebGPU/WGSL/AST/AST.h:
* Source/WebGPU/WGSL/AST/ASTBinaryExpression.h: Copied from Source/WebGPU/WGSL/AST/AST.h.
* Source/WebGPU/WGSL/AST/ASTForward.h:
* Source/WebGPU/WGSL/AST/ASTNode.h:
* Source/WebGPU/WGSL/AST/ASTStringDumper.cpp:
(WGSL::AST::StringDumper::visit):
* Source/WebGPU/WGSL/AST/ASTStringDumper.h:
* Source/WebGPU/WGSL/AST/ASTVisitor.cpp:
(WGSL::AST::Visitor::visit):
* Source/WebGPU/WGSL/AST/ASTVisitor.h:
* Source/WebGPU/WGSL/Lexer.cpp:
(WGSL::Lexer<T>::lex):
* Source/WebGPU/WGSL/Metal/MetalFunctionWriter.cpp:
(WGSL::Metal::FunctionDefinitionWriter::visit):
* Source/WebGPU/WGSL/Parser.cpp:
(WGSL::Parser<Lexer>::parseArrayType):
(WGSL::Parser<Lexer>::parseReturnStatement):
(WGSL::Parser<Lexer>::parseRelationalExpression):
(WGSL::Parser<Lexer>::parseShiftExpression):
(WGSL::Parser<Lexer>::parseAdditiveExpression):
(WGSL::Parser<Lexer>::parseMultiplicativeExpression):
(WGSL::Parser<Lexer>::parseExpression):
(WGSL::Parser<Lexer>::parseShortCircuitOrExpression): Deleted.
* Source/WebGPU/WGSL/ParserPrivate.h:
* Source/WebGPU/WGSL/Token.cpp:
(WGSL::toString):
* Source/WebGPU/WGSL/Token.h:
* Tools/TestWebKitAPI/Tests/WGSL/LexerTests.cpp:
(TestWGSLAPI::TEST):
* Tools/TestWebKitAPI/Tests/WGSL/ParserTests.cpp:
(TestWGSLAPI::TEST):

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




More information about the webkit-changes mailing list