From 7a73df5e2cdddb9dee833799ab428d2d3fcaf64a Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Fri, 24 May 2019 14:17:02 -0400 Subject: [PATCH] Debugger: Remove needless explicit copy constructors. These worked in identical fashion to what the default copy constructors would be, but their mere presence marks the class as being "non-trivially copyable," which means that memcpy'ing it is now a -Werror on GCC 8. We have to be careful when making this change, though: classes which *are* trivially copyable can be passed inside registers on x86_64, so changes like these break ABI in a dangerous way. These classes is private, so it should not be a problem, but for other classes (e.g. BRect, BPoint) we cannot fix them properly right now. --- headers/private/debugger/arch/Register.h | 1 - headers/private/debugger/types/SourceLocation.h | 14 -------------- .../private/debugger/types/TargetAddressRange.h | 14 -------------- src/kits/debugger/arch/Register.cpp | 13 ------------- 4 files changed, 42 deletions(-) diff --git a/headers/private/debugger/arch/Register.h b/headers/private/debugger/arch/Register.h index 46f28cea6c..df50d9a9eb 100644 --- a/headers/private/debugger/arch/Register.h +++ b/headers/private/debugger/arch/Register.h @@ -32,7 +32,6 @@ public: uint32 bitSize, uint32 valueType, register_type type, bool calleePreserved); // name will not be cloned - Register(const Register& other); int32 Index() const { return fIndex; } const char* Name() const { return fName; } diff --git a/headers/private/debugger/types/SourceLocation.h b/headers/private/debugger/types/SourceLocation.h index d224463b1e..98c1f1bc71 100644 --- a/headers/private/debugger/types/SourceLocation.h +++ b/headers/private/debugger/types/SourceLocation.h @@ -17,20 +17,6 @@ public: { } - SourceLocation(const SourceLocation& other) - : - fLine(other.fLine), - fColumn(other.fColumn) - { - } - - SourceLocation& operator=(const SourceLocation& other) - { - fLine = other.fLine; - fColumn = other.fColumn; - return *this; - } - bool operator==(const SourceLocation& other) const { return fLine == other.fLine && fColumn == other.fColumn; diff --git a/headers/private/debugger/types/TargetAddressRange.h b/headers/private/debugger/types/TargetAddressRange.h index 74feac6d9c..81d3e49af8 100644 --- a/headers/private/debugger/types/TargetAddressRange.h +++ b/headers/private/debugger/types/TargetAddressRange.h @@ -26,20 +26,6 @@ public: { } - TargetAddressRange(const TargetAddressRange& other) - : - fStart(other.fStart), - fSize(other.fSize) - { - } - - TargetAddressRange& operator=(const TargetAddressRange& other) - { - fStart = other.fStart; - fSize = other.fSize; - return *this; - } - bool operator==(const TargetAddressRange& other) const { return fStart == other.fStart && fSize == other.fSize; diff --git a/src/kits/debugger/arch/Register.cpp b/src/kits/debugger/arch/Register.cpp index cf17f8a526..e7f640ae5c 100644 --- a/src/kits/debugger/arch/Register.cpp +++ b/src/kits/debugger/arch/Register.cpp @@ -43,16 +43,3 @@ Register::Register(int32 index, const char* name, uint32 bitSize, break; } } - - -Register::Register(const Register& other) - : - fIndex(other.fIndex), - fName(other.fName), - fBitSize(other.fBitSize), - fValueType(other.fValueType), - fFormat(other.fFormat), - fType(other.fType), - fCalleePreserved(other.fCalleePreserved) -{ -}