Bug 200188 - [WHLSL] Remove UnnamedType copy/move constructors and mark classes as final
Summary: [WHLSL] Remove UnnamedType copy/move constructors and mark classes as final
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGPU (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Saam Barati
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-07-26 19:04 PDT by Saam Barati
Modified: 2019-07-31 17:04 PDT (History)
9 users (show)

See Also:


Attachments
patch (8.81 KB, patch)
2019-07-26 19:27 PDT, Saam Barati
mmaxfield: review+
Details | Formatted Diff | Diff
followup patch (5.97 KB, patch)
2019-07-31 15:06 PDT, Saam Barati
no flags Details | Formatted Diff | Diff
followup patch (5.98 KB, patch)
2019-07-31 15:07 PDT, Saam Barati
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Saam Barati 2019-07-26 19:04:49 PDT
They don't make any sense anymore since UnnamedType is now ref counted. You should just take a ref to the thing instead.
Comment 1 Saam Barati 2019-07-26 19:27:19 PDT
Created attachment 375009 [details]
patch
Comment 2 EWS Watchlist 2019-07-26 19:30:22 PDT
Attachment 375009 [details] did not pass style-queue:


ERROR: Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLPointerType.h:33:  Alphabetical sorting problem.  [build/include_order] [4]
ERROR: Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLUnnamedType.h:33:  Alphabetical sorting problem.  [build/include_order] [4]
ERROR: Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLArrayType.h:34:  Alphabetical sorting problem.  [build/include_order] [4]
ERROR: Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLTypeReference.h:35:  Alphabetical sorting problem.  [build/include_order] [4]
ERROR: Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLArrayReferenceType.h:33:  Alphabetical sorting problem.  [build/include_order] [4]
Total errors found: 5 in 7 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Saam Barati 2019-07-27 18:32:13 PDT
landed in:
https://trac.webkit.org/changeset/247893/webkit
Comment 4 Radar WebKit Bug Importer 2019-07-27 18:33:16 PDT
<rdar://problem/53628171>
Comment 5 Darin Adler 2019-07-29 11:26:41 PDT
Comment on attachment 375009 [details]
patch

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

> Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLArrayReferenceType.h:47
> +    WTF_MAKE_NONCOPYABLE(ArrayReferenceType);
> +    WTF_MAKE_NONMOVABLE(ArrayReferenceType);

Doesn’t make sense to me that you would ever need both of these. I don’t think that’s how C++ works. If you delete the copy constructor I don’t think you normally have to explicitly delete the move constructor too, for example.
Comment 6 Saam Barati 2019-07-31 14:17:42 PDT
(In reply to Darin Adler from comment #5)
> Comment on attachment 375009 [details]
> patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=375009&action=review
> 
> > Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLArrayReferenceType.h:47
> > +    WTF_MAKE_NONCOPYABLE(ArrayReferenceType);
> > +    WTF_MAKE_NONMOVABLE(ArrayReferenceType);
> 
> Doesn’t make sense to me that you would ever need both of these. I don’t
> think that’s how C++ works. If you delete the copy constructor I don’t think
> you normally have to explicitly delete the move constructor too, for example.

Yeah good point. I was employing full paranoia without remembering that explicitly defining (a deleted or not) copy constructor removes the move constructor.
Comment 7 Saam Barati 2019-07-31 14:21:29 PDT
I can prep a patch in a few minutes
Comment 8 Saam Barati 2019-07-31 15:06:05 PDT
Created attachment 375258 [details]
followup patch
Comment 9 Saam Barati 2019-07-31 15:07:26 PDT
Created attachment 375259 [details]
followup patch
Comment 10 Saam Barati 2019-07-31 17:04:44 PDT
landed followup in
https://trac.webkit.org/changeset/248083/webkit