- Revision
- 247893
- Author
- [email protected]
- Date
- 2019-07-27 18:31:48 -0700 (Sat, 27 Jul 2019)
Log Message
[WHLSL] Remove UnnamedType copy/move constructors and mark classes as final
https://bugs.webkit.org/show_bug.cgi?id=200188
Reviewed by Myles C. Maxfield.
Since they are ref counted, you should make taking a ref to them
instead of moving or copying them. This patch encodes that by deleting
the relevant copy/move constructors and assignment operators.
* Modules/webgpu/WHLSL/AST/WHLSLArrayReferenceType.h:
* Modules/webgpu/WHLSL/AST/WHLSLArrayType.h:
(WebCore::WHLSL::AST::ArrayType::ArrayType): Deleted.
(WebCore::WHLSL::AST::ArrayType::create): Deleted.
(WebCore::WHLSL::AST::ArrayType::type const): Deleted.
(WebCore::WHLSL::AST::ArrayType::type): Deleted.
(WebCore::WHLSL::AST::ArrayType::numElements const): Deleted.
* Modules/webgpu/WHLSL/AST/WHLSLPointerType.h:
(WebCore::WHLSL::AST::PointerType::PointerType): Deleted.
(WebCore::WHLSL::AST::PointerType::create): Deleted.
* Modules/webgpu/WHLSL/AST/WHLSLReferenceType.h:
* Modules/webgpu/WHLSL/AST/WHLSLTypeReference.h:
(WebCore::WHLSL::AST::TypeReference::TypeReference): Deleted.
(WebCore::WHLSL::AST::TypeReference::create): Deleted.
(WebCore::WHLSL::AST::TypeReference::name): Deleted.
(WebCore::WHLSL::AST::TypeReference::typeArguments): Deleted.
(WebCore::WHLSL::AST::TypeReference::maybeResolvedType const): Deleted.
(WebCore::WHLSL::AST::TypeReference::resolvedType const): Deleted.
(WebCore::WHLSL::AST::TypeReference::setResolvedType): Deleted.
* Modules/webgpu/WHLSL/AST/WHLSLUnnamedType.h:
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (247892 => 247893)
--- trunk/Source/WebCore/ChangeLog 2019-07-28 00:47:00 UTC (rev 247892)
+++ trunk/Source/WebCore/ChangeLog 2019-07-28 01:31:48 UTC (rev 247893)
@@ -1,3 +1,35 @@
+2019-07-27 Saam Barati <[email protected]>
+
+ [WHLSL] Remove UnnamedType copy/move constructors and mark classes as final
+ https://bugs.webkit.org/show_bug.cgi?id=200188
+
+ Reviewed by Myles C. Maxfield.
+
+ Since they are ref counted, you should make taking a ref to them
+ instead of moving or copying them. This patch encodes that by deleting
+ the relevant copy/move constructors and assignment operators.
+
+ * Modules/webgpu/WHLSL/AST/WHLSLArrayReferenceType.h:
+ * Modules/webgpu/WHLSL/AST/WHLSLArrayType.h:
+ (WebCore::WHLSL::AST::ArrayType::ArrayType): Deleted.
+ (WebCore::WHLSL::AST::ArrayType::create): Deleted.
+ (WebCore::WHLSL::AST::ArrayType::type const): Deleted.
+ (WebCore::WHLSL::AST::ArrayType::type): Deleted.
+ (WebCore::WHLSL::AST::ArrayType::numElements const): Deleted.
+ * Modules/webgpu/WHLSL/AST/WHLSLPointerType.h:
+ (WebCore::WHLSL::AST::PointerType::PointerType): Deleted.
+ (WebCore::WHLSL::AST::PointerType::create): Deleted.
+ * Modules/webgpu/WHLSL/AST/WHLSLReferenceType.h:
+ * Modules/webgpu/WHLSL/AST/WHLSLTypeReference.h:
+ (WebCore::WHLSL::AST::TypeReference::TypeReference): Deleted.
+ (WebCore::WHLSL::AST::TypeReference::create): Deleted.
+ (WebCore::WHLSL::AST::TypeReference::name): Deleted.
+ (WebCore::WHLSL::AST::TypeReference::typeArguments): Deleted.
+ (WebCore::WHLSL::AST::TypeReference::maybeResolvedType const): Deleted.
+ (WebCore::WHLSL::AST::TypeReference::resolvedType const): Deleted.
+ (WebCore::WHLSL::AST::TypeReference::setResolvedType): Deleted.
+ * Modules/webgpu/WHLSL/AST/WHLSLUnnamedType.h:
+
2019-07-27 Justin Fan <[email protected]>
[WebGPU] Update GPUComputePipeline errors to match GPURenderPipeline implementation
Modified: trunk/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLArrayReferenceType.h (247892 => 247893)
--- trunk/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLArrayReferenceType.h 2019-07-28 00:47:00 UTC (rev 247892)
+++ trunk/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLArrayReferenceType.h 2019-07-28 01:31:48 UTC (rev 247893)
@@ -30,6 +30,8 @@
#include "WHLSLCodeLocation.h"
#include "WHLSLReferenceType.h"
#include <wtf/FastMalloc.h>
+#include <wtf/Noncopyable.h>
+#include <wtf/Nonmovable.h>
#include <wtf/UniqueRef.h>
#include <wtf/text/WTFString.h>
@@ -41,6 +43,8 @@
class ArrayReferenceType : public ReferenceType {
WTF_MAKE_FAST_ALLOCATED;
+ WTF_MAKE_NONCOPYABLE(ArrayReferenceType);
+ WTF_MAKE_NONMOVABLE(ArrayReferenceType);
using Base = ReferenceType;
ArrayReferenceType(CodeLocation location, AddressSpace addressSpace, Ref<UnnamedType> elementType)
@@ -55,8 +59,6 @@
virtual ~ArrayReferenceType() = default;
- ArrayReferenceType(const ArrayReferenceType&) = delete;
-
bool isArrayReferenceType() const override { return true; }
unsigned hash() const override
Modified: trunk/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLArrayType.h (247892 => 247893)
--- trunk/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLArrayType.h 2019-07-28 00:47:00 UTC (rev 247892)
+++ trunk/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLArrayType.h 2019-07-28 01:31:48 UTC (rev 247893)
@@ -31,6 +31,8 @@
#include "WHLSLTypeArgument.h"
#include "WHLSLUnnamedType.h"
#include <wtf/FastMalloc.h>
+#include <wtf/Noncopyable.h>
+#include <wtf/Nonmovable.h>
#include <wtf/UniqueRef.h>
#include <wtf/text/WTFString.h>
@@ -40,8 +42,10 @@
namespace AST {
-class ArrayType : public UnnamedType {
+class ArrayType final : public UnnamedType {
WTF_MAKE_FAST_ALLOCATED;
+ WTF_MAKE_NONCOPYABLE(ArrayType);
+ WTF_MAKE_NONMOVABLE(ArrayType);
ArrayType(CodeLocation location, Ref<UnnamedType> elementType, unsigned numElements)
: UnnamedType(location)
, m_elementType(WTFMove(elementType))
@@ -57,8 +61,6 @@
virtual ~ArrayType() = default;
- ArrayType(const ArrayType&) = delete;
-
bool isArrayType() const override { return true; }
const UnnamedType& type() const { return m_elementType; }
Modified: trunk/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLPointerType.h (247892 => 247893)
--- trunk/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLPointerType.h 2019-07-28 00:47:00 UTC (rev 247892)
+++ trunk/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLPointerType.h 2019-07-28 01:31:48 UTC (rev 247893)
@@ -30,6 +30,8 @@
#include "WHLSLCodeLocation.h"
#include "WHLSLReferenceType.h"
#include <wtf/FastMalloc.h>
+#include <wtf/Noncopyable.h>
+#include <wtf/Nonmovable.h>
#include <wtf/UniqueRef.h>
#include <wtf/text/WTFString.h>
@@ -39,8 +41,10 @@
namespace AST {
-class PointerType : public ReferenceType {
+class PointerType final : public ReferenceType {
WTF_MAKE_FAST_ALLOCATED;
+ WTF_MAKE_NONCOPYABLE(PointerType);
+ WTF_MAKE_NONMOVABLE(PointerType);
using Base = ReferenceType;
PointerType(CodeLocation location, AddressSpace addressSpace, Ref<UnnamedType> elementType)
@@ -56,8 +60,6 @@
virtual ~PointerType() = default;
- PointerType(const PointerType&) = delete;
-
bool isPointerType() const override { return true; }
unsigned hash() const override
Modified: trunk/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLReferenceType.h (247892 => 247893)
--- trunk/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLReferenceType.h 2019-07-28 00:47:00 UTC (rev 247892)
+++ trunk/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLReferenceType.h 2019-07-28 01:31:48 UTC (rev 247893)
@@ -42,6 +42,8 @@
class ReferenceType : public UnnamedType {
WTF_MAKE_FAST_ALLOCATED;
+ WTF_MAKE_NONCOPYABLE(ReferenceType);
+ WTF_MAKE_NONMOVABLE(ReferenceType);
protected:
ReferenceType(CodeLocation location, AddressSpace addressSpace, Ref<UnnamedType> elementType)
: UnnamedType(location)
@@ -53,8 +55,6 @@
virtual ~ReferenceType() = default;
- ReferenceType(const ReferenceType&) = delete;
-
bool isReferenceType() const override { return true; }
AddressSpace addressSpace() const { return m_addressSpace; }
Modified: trunk/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLTypeReference.h (247892 => 247893)
--- trunk/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLTypeReference.h 2019-07-28 00:47:00 UTC (rev 247892)
+++ trunk/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLTypeReference.h 2019-07-28 01:31:48 UTC (rev 247893)
@@ -32,6 +32,8 @@
#include "WHLSLTypeArgument.h"
#include "WHLSLUnnamedType.h"
#include <wtf/FastMalloc.h>
+#include <wtf/Noncopyable.h>
+#include <wtf/Nonmovable.h>
#include <wtf/UniqueRef.h>
#include <wtf/text/WTFString.h>
@@ -43,8 +45,10 @@
class NamedType;
-class TypeReference : public UnnamedType {
+class TypeReference final : public UnnamedType {
WTF_MAKE_FAST_ALLOCATED;
+ WTF_MAKE_NONCOPYABLE(TypeReference);
+ WTF_MAKE_NONMOVABLE(TypeReference);
TypeReference(CodeLocation location, String&& name, TypeArguments&& typeArguments)
: UnnamedType(location)
, m_name(WTFMove(name))
@@ -59,8 +63,6 @@
virtual ~TypeReference() = default;
- TypeReference(const TypeReference&) = delete;
-
static Ref<TypeReference> wrap(CodeLocation, NamedType& resolvedType);
bool isTypeReference() const override { return true; }
Modified: trunk/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLUnnamedType.h (247892 => 247893)
--- trunk/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLUnnamedType.h 2019-07-28 00:47:00 UTC (rev 247892)
+++ trunk/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLUnnamedType.h 2019-07-28 01:31:48 UTC (rev 247893)
@@ -30,6 +30,8 @@
#include "WHLSLCodeLocation.h"
#include "WHLSLType.h"
#include <wtf/FastMalloc.h>
+#include <wtf/Noncopyable.h>
+#include <wtf/Nonmovable.h>
#include <wtf/RefCounted.h>
#include <wtf/UniqueRef.h>
#include <wtf/text/WTFString.h>
@@ -42,6 +44,8 @@
class UnnamedType : public Type, public RefCounted<UnnamedType> {
WTF_MAKE_FAST_ALLOCATED;
+ WTF_MAKE_NONCOPYABLE(UnnamedType);
+ WTF_MAKE_NONMOVABLE(UnnamedType);
public:
UnnamedType(CodeLocation location)
: m_codeLocation(location)
@@ -50,8 +54,6 @@
virtual ~UnnamedType() = default;
- UnnamedType(const UnnamedType&) = delete;
-
bool isUnnamedType() const override { return true; }
virtual bool isTypeReference() const { return false; }
virtual bool isPointerType() const { return false; }