[webkit-changes] [WebKit/WebKit] ebf1a7: [WGSL] Refactor statement serialization
Tadeu Zagallo
noreply at github.com
Fri May 26 08:08:29 PDT 2023
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: ebf1a7a962f5ba6936419e6b85d13deab0f0bc77
https://github.com/WebKit/WebKit/commit/ebf1a7a962f5ba6936419e6b85d13deab0f0bc77
Author: Tadeu Zagallo <tzagallo at apple.com>
Date: 2023-05-26 (Fri, 26 May 2023)
Changed paths:
M Source/WebGPU/WGSL/Metal/MetalFunctionWriter.cpp
Log Message:
-----------
[WGSL] Refactor statement serialization
https://bugs.webkit.org/show_bug.cgi?id=257322
rdar://109829013
Reviewed by Mike Wyrzykowski.
In our current implementation, statements that need to be semicolon-terminated
(such as variable declarations, assignments, etc) emit their semicolons and
newline directly in its own serialization code. That is a problem, since statements
can appear in places where we can't emit the semicolon, such as in for-loops'
init and update clauses. The main place statements appear, and where it's necessary
to print the semicolons (and nice to print newlines) is in a CompondStatement, so
this patch changes the serializztion of compound statements to print the semicolon
and new-line after its nested statements as necessary.
* Source/WebGPU/WGSL/Metal/MetalFunctionWriter.cpp:
(WGSL::Metal::FunctionDefinitionWriter::visit):
Canonical link: https://commits.webkit.org/264581@main
More information about the webkit-changes
mailing list