RESOLVED FIXED193389
[WHLSL] Assorted cleanup
https://bugs.webkit.org/show_bug.cgi?id=193389
Summary [WHLSL] Assorted cleanup
Myles C. Maxfield
Reported 2019-01-13 17:58:38 PST
[WHLSL] Assorted cleanup
Attachments
Patch (101.75 KB, patch)
2019-01-13 18:04 PST, Myles C. Maxfield
no flags
Patch (108.58 KB, patch)
2019-01-13 19:36 PST, Myles C. Maxfield
no flags
Myles C. Maxfield
Comment 1 2019-01-13 18:04:51 PST
Myles C. Maxfield
Comment 2 2019-01-13 19:36:20 PST
Robin Morisset
Comment 3 2019-01-14 10:20:53 PST
Comment on attachment 359017 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=359017&action=review > Source/WebCore/ChangeLog:16 > + - EnumTypes have to have non-null base types. The parser will make sure this is always true. I have not seen this last rule when looking through the patch. It seems a bit weird to me to have such semantic rule verified by the parser. The patch LGTM otherwise
Dean Jackson
Comment 4 2019-01-14 10:30:50 PST
Comment on attachment 359017 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=359017&action=review rs=me assuming robin's comment is addressed. > Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLExpression.h:60 > + UnnamedType* type() { return m_type ? &*m_type : nullptr; } Is this the syntax we usually use for an Optional<UniqueRef<>> ? It looks weird because at first glance it appears to do nothing :)
Myles C. Maxfield
Comment 5 2019-01-14 10:36:59 PST
(In reply to Robin Morisset from comment #3) > Comment on attachment 359017 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=359017&action=review > > > Source/WebCore/ChangeLog:16 > > + - EnumTypes have to have non-null base types. The parser will make sure this is always true. > > I have not seen this last rule when looking through the patch. > It seems a bit weird to me to have such semantic rule verified by the parser. > The patch LGTM otherwise It’s not verified by the parser; the parser just sets the base type to be a reference to “int” if it isn’t present. This is what the reference compiler does.
Myles C. Maxfield
Comment 6 2019-01-14 10:38:03 PST
(In reply to Dean Jackson from comment #4) > Comment on attachment 359017 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=359017&action=review > > rs=me assuming robin's comment is addressed. > > > Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLExpression.h:60 > > + UnnamedType* type() { return m_type ? &*m_type : nullptr; } > > Is this the syntax we usually use for an Optional<UniqueRef<>> ? It looks > weird because at first glance it appears to do nothing :) I don’t know any better way to get a pointer to the thing inside it.
Robin Morisset
Comment 7 2019-01-14 11:04:39 PST
(In reply to Myles C. Maxfield from comment #5) > (In reply to Robin Morisset from comment #3) > > Comment on attachment 359017 [details] > > Patch > > > > View in context: > > https://bugs.webkit.org/attachment.cgi?id=359017&action=review > > > > > Source/WebCore/ChangeLog:16 > > > + - EnumTypes have to have non-null base types. The parser will make sure this is always true. > > > > I have not seen this last rule when looking through the patch. > > It seems a bit weird to me to have such semantic rule verified by the parser. > > The patch LGTM otherwise > > It’s not verified by the parser; the parser just sets the base type to be a > reference to “int” if it isn’t present. This is what the reference compiler > does. OK, I misunderstood your comment as saying that the parser would reject enums who are given an explicit base type by the programmer, when that explicit base type is "null". Which sounded a bit weird, but what you are saying is perfectly reasonable.
WebKit Commit Bot
Comment 8 2019-01-14 11:21:57 PST
Comment on attachment 359017 [details] Patch Clearing flags on attachment: 359017 Committed r239930: <https://trac.webkit.org/changeset/239930>
WebKit Commit Bot
Comment 9 2019-01-14 11:21:58 PST
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 10 2019-01-14 11:22:29 PST
Note You need to log in before you can comment on or make changes to this bug.