Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WGSL] Implement compound assignment parsing and code gen #13001

Merged

Conversation

djg
Copy link
Contributor

@djg djg commented Apr 21, 2023

56d070d

[WGSL] Implement compound assignment parsing and code gen
https://bugs.webkit.org/show_bug.cgi?id=255754
rdar://problem/108347694

Reviewed by Tadeu Zagallo.

Implement parsing and code gen for compound assignment statements (eg. "x +=
1"). Doesn't implement type checking, which will be implemented in a follow up patch.

* Source/WebGPU/WGSL/AST/ASTStringDumper.cpp:
(WGSL::AST::StringDumper::visit):
* Source/WebGPU/WGSL/AST/ASTStringDumper.h:
* Source/WebGPU/WGSL/Lexer.cpp:
(WGSL::Lexer<T>::lex):
* Source/WebGPU/WGSL/Parser.cpp:
(WGSL::canContinueCompoundAssignmentStatement):
(WGSL::toBinaryOperation):
(WGSL::Parser<Lexer>::parseStatement):
* Source/WebGPU/WGSL/Token.cpp:
(WGSL::toString):
* Source/WebGPU/WGSL/Token.h:
* Source/WebGPU/WGSL/TypeCheck.cpp:
(WGSL::TypeChecker::visit):
* Source/WebGPU/WGSL/tests/valid/overload.wgsl:
* Tools/TestWebKitAPI/Tests/WGSL/LexerTests.cpp:
(TestWGSLAPI::TEST):

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

c06eb41

Misc iOS, tvOS & watchOS macOS Linux Windows
βœ… πŸ§ͺ style βœ… πŸ›  ios βœ… πŸ›  mac βœ… πŸ›  wpe βœ… πŸ›  wincairo
βœ… πŸ§ͺ bindings βœ… πŸ›  ios-sim βœ… πŸ›  mac-AS-debug βœ… πŸ§ͺ wpe-wk2
βœ… πŸ§ͺ webkitperl   πŸ§ͺ ios-wk2   πŸ§ͺ api-mac βœ… πŸ›  gtk
  πŸ§ͺ ios-wk2-wpt βœ… πŸ§ͺ mac-wk1   πŸ§ͺ gtk-wk2
  πŸ§ͺ api-ios βœ… πŸ§ͺ mac-wk2 βœ… πŸ§ͺ api-gtk
  πŸ›  tv   πŸ§ͺ mac-AS-debug-wk2
  πŸ›  tv-sim βœ… πŸ§ͺ mac-wk2-stress
βœ… πŸ›  πŸ§ͺ merge   πŸ›  watch
  πŸ›  watch-sim

@djg djg self-assigned this Apr 21, 2023
@djg djg added the WebGPU For bugs in WebGPU label Apr 21, 2023
@djg djg requested a review from tadeuzagallo April 21, 2023 00:45
Copy link
Member

@tadeuzagallo tadeuzagallo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks good, but please fix the title of the PR and fill in the bug and radar before landing.

@djg djg changed the title [WGSL] Implement [WGSL] Implement compound assignment parsing and code gen Apr 21, 2023
@djg djg force-pushed the wgsl/compound-assignment-statement branch from 4b6c413 to f159612 Compare April 21, 2023 23:41
@djg djg force-pushed the wgsl/compound-assignment-statement branch from f159612 to c06eb41 Compare April 22, 2023 00:07
@djg
Copy link
Contributor Author

djg commented Apr 22, 2023

The code looks good, but please fix the title of the PR and fill in the bug and radar before landing.

Not sure what happened to those in the original upload.

@djg djg added the merge-queue Applied to send a pull request to merge-queue label Apr 22, 2023
https://bugs.webkit.org/show_bug.cgi?id=255754
rdar://problem/108347694

Reviewed by Tadeu Zagallo.

Implement parsing and code gen for compound assignment statements (eg. "x +=
1"). Doesn't implement type checking, which will be implemented in a follow up patch.

* Source/WebGPU/WGSL/AST/ASTStringDumper.cpp:
(WGSL::AST::StringDumper::visit):
* Source/WebGPU/WGSL/AST/ASTStringDumper.h:
* Source/WebGPU/WGSL/Lexer.cpp:
(WGSL::Lexer<T>::lex):
* Source/WebGPU/WGSL/Parser.cpp:
(WGSL::canContinueCompoundAssignmentStatement):
(WGSL::toBinaryOperation):
(WGSL::Parser<Lexer>::parseStatement):
* Source/WebGPU/WGSL/Token.cpp:
(WGSL::toString):
* Source/WebGPU/WGSL/Token.h:
* Source/WebGPU/WGSL/TypeCheck.cpp:
(WGSL::TypeChecker::visit):
* Source/WebGPU/WGSL/tests/valid/overload.wgsl:
* Tools/TestWebKitAPI/Tests/WGSL/LexerTests.cpp:
(TestWGSLAPI::TEST):

Canonical link: https://commits.webkit.org/263272@main
@webkit-commit-queue
Copy link
Collaborator

Committed 263272@main (56d070d): https://commits.webkit.org/263272@main

Reviewed commits have been landed. Closing PR #13001 and removing active labels.

@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Apr 22, 2023
@webkit-commit-queue webkit-commit-queue merged commit 56d070d into WebKit:main Apr 22, 2023
@djg djg deleted the wgsl/compound-assignment-statement branch November 7, 2023 04:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WebGPU For bugs in WebGPU
Projects
None yet
4 participants