[webkit-changes] [WebKit/WebKit] 89a790: [WGSL] Type check user-defined function calls

Tadeu Zagallo noreply at github.com
Thu Jun 1 00:23:45 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 89a790ad2a426bfdcb8f91242716cab722a972dd
      https://github.com/WebKit/WebKit/commit/89a790ad2a426bfdcb8f91242716cab722a972dd
  Author: Tadeu Zagallo <tzagallo at apple.com>
  Date:   2023-06-01 (Thu, 01 Jun 2023)

  Changed paths:
    M Source/WebGPU/WGSL/ContextProvider.h
    M Source/WebGPU/WGSL/ContextProviderInlines.h
    M Source/WebGPU/WGSL/TypeCheck.cpp
    A Source/WebGPU/WGSL/tests/invalid/function-call.wgsl

  Log Message:
  -----------
  [WGSL] Type check user-defined function calls
https://bugs.webkit.org/show_bug.cgi?id=257557
rdar://110075508

Reviewed by Myles C. Maxfield.

Before resolving overloads, check if a user-defined function is available when
type checking function calls. The implementation is rather similar to how we
validate struct initializers, but trying to share the code made the code more
confusing than concise, so for now the two paths are kept separately.

* Source/WebGPU/WGSL/ContextProvider.h:
* Source/WebGPU/WGSL/ContextProviderInlines.h:
(WGSL::ContextProvider<Value>::Context::lookup const):
(WGSL::ContextProvider<Value>::Context::add):
(WGSL::ContextProvider<Value>::introduceVariable const):
(WGSL::ContextProvider<Value>::readVariable const const):
* Source/WebGPU/WGSL/TypeCheck.cpp:
(WGSL::TypeChecker::visit):
* Source/WebGPU/WGSL/tests/invalid/function-call.wgsl: Added.

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




More information about the webkit-changes mailing list