⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 245727 in webkit


Ignore:
Timestamp:
May 23, 2019, 4:41:56 PM (7 years ago)
Author:
sbarati@apple.com
Message:

[WHLSL] Make the AST dumper disambiguate expressions using parenthesis to represent AST construction
https://bugs.webkit.org/show_bug.cgi?id=198199

Reviewed by Myles C. Maxfield.

We would dump "*foo.bar" for "(*foo).bar", which is super confusing.
We now dump "(*foo).bar".

  • Modules/webgpu/WHLSL/WHLSLASTDumper.cpp:

(WebCore::WHLSL::ASTDumper::visit):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r245724 r245727  
     12019-05-23  Saam barati  <sbarati@apple.com>
     2
     3        [WHLSL] Make the AST dumper disambiguate expressions using parenthesis to represent AST construction
     4        https://bugs.webkit.org/show_bug.cgi?id=198199
     5
     6        Reviewed by Myles C. Maxfield.
     7
     8        We would dump "*foo.bar" for "(*foo).bar", which is super confusing.
     9        We now dump "(*foo).bar".
     10
     11        * Modules/webgpu/WHLSL/WHLSLASTDumper.cpp:
     12        (WebCore::WHLSL::ASTDumper::visit):
     13
    1142019-05-23  Saam barati  <sbarati@apple.com>
    215
  • trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLASTDumper.cpp

    r245724 r245727  
    420420void ASTDumper::visit(AST::Expression& expression)
    421421{
     422    bool skipParens = is<AST::BooleanLiteral>(expression)
     423        || is<AST::FloatLiteral>(expression)
     424        || is<AST::IntegerLiteral>(expression)
     425        || is<AST::NullLiteral>(expression)
     426        || is<AST::UnsignedIntegerLiteral>(expression)
     427        || is<AST::EnumerationMemberLiteral>(expression)
     428        || is<AST::CommaExpression>(expression)
     429        || is<AST::VariableReference>(expression);
     430
     431    if (!skipParens)
     432        m_out.print("(");
    422433    Base::visit(expression);
     434    if (!skipParens)
     435        m_out.print(")");
    423436}
    424437
Note: See TracChangeset for help on using the changeset viewer.