[webkit-reviews] review granted: [Bug 192991] [WHLSL] Implement parser AST nodes : [Attachment 357974] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jan 3 08:34:15 PST 2019


Alex Christensen <achristensen at apple.com> has granted Myles C. Maxfield
<mmaxfield at apple.com>'s request for review:
Bug 192991: [WHLSL] Implement parser AST nodes
https://bugs.webkit.org/show_bug.cgi?id=192991

Attachment 357974: Patch

https://bugs.webkit.org/attachment.cgi?id=357974&action=review




--- Comment #4 from Alex Christensen <achristensen at apple.com> ---
Comment on attachment 357974
  --> https://bugs.webkit.org/attachment.cgi?id=357974
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=357974&action=review

r=me with suggestions

> Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLEnumerationMember.h:62
> +}

These could probably use comments
} // namespace AST

> Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLForLoop.h:65
> +    std::unique_ptr<Expression> m_increment; // nullable
> +    std::unique_ptr<Statement> m_body;

You might consider using UniqueRef for the non-nullable ones.

> Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLFunctionAttribute.h:40
> +typedef Variant<NumThreadsFunctionAttribute> FunctionAttribute;

using FunctionAttribute = Variant<NumThreadsFunctionAttribute>.
Also, a Variant of only one type?

> Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLFunctionDeclaration.h:46
> +    enum class EntryPointType {

Declaring storage types for enum classes used as member variables can save
memory.  Here you only need uint8_t

>
Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLVariableDeclarationsStatement.h:55
> +    Vector<VariableDeclaration>&& m_variableDeclarations;

Did you mean to have an r-value reference as a member variable?

> Source/WebCore/Modules/webgpu/WHLSL/WHLSLParser.cpp:37
> +namespace WHLSL {
> +
> +}

This file doesn't seem useful right now.  I'm assuming it will be soon.


More information about the webkit-reviews mailing list