[webkit-changes] [WebKit/WebKit] bbdc36: [WGSL] AST Visitor helper

Dan Glastonbury noreply at github.com
Wed Oct 19 02:20:02 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: bbdc3617fa55e95db6b63934f8929aef08ddd639
      https://github.com/WebKit/WebKit/commit/bbdc3617fa55e95db6b63934f8929aef08ddd639
  Author: Dan Glastonbury <djg at apple.com>
  Date:   2022-10-19 (Wed, 19 Oct 2022)

  Changed paths:
    A Source/WebGPU/WGSL/AST/AST.h
    M Source/WebGPU/WGSL/AST/ASTArrayAccess.h
    M Source/WebGPU/WGSL/AST/ASTCallableExpression.h
    A Source/WebGPU/WGSL/AST/ASTForward.h
    A Source/WebGPU/WGSL/AST/ASTVisitor.cpp
    A Source/WebGPU/WGSL/AST/ASTVisitor.h
    M Source/WebGPU/WebGPU.xcodeproj/project.pbxproj

  Log Message:
  -----------
  [WGSL] AST Visitor helper
https://bugs.webkit.org/show_bug.cgi?id=246660
rdar://problem/101268329

Reviewed by Antti Koivisto.

Many analysis passes in the compiler need to work with the subtrees of the
AST. AST::Visitor provides the boilerplate for performing a preorder traversal
of an AST; analyzers derived from AST::Visitor can override visit methods for
just the kinds of nodes for its task.

* Source/WebGPU/WGSL/AST/AST.h: Copied from Source/WebGPU/WGSL/AST/ASTArrayAccess.h.
* Source/WebGPU/WGSL/AST/ASTArrayAccess.h:
* Source/WebGPU/WGSL/AST/ASTCallableExpression.h:
* Source/WebGPU/WGSL/AST/ASTForward.h: Copied from Source/WebGPU/WGSL/AST/ASTArrayAccess.h.
* Source/WebGPU/WGSL/AST/ASTVisitor.cpp: Added.
(WGSL::Visitor::hasError const):
(WGSL::Visitor::result):
(WGSL::Visitor::checkErrorAndVisit):
(WGSL::Visitor::maybeCheckErrorAndVisit):
(WGSL::Visitor::visit):
* Source/WebGPU/WGSL/AST/ASTVisitor.h: Added.
(WGSL::Visitor::setError):
* Source/WebGPU/WebGPU.xcodeproj/project.pbxproj:

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




More information about the webkit-changes mailing list