From 395b99cba21f093e1bbb5a3ddd8a01e628b17336 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Wed, 22 May 2019 08:38:23 +0000 Subject: [PATCH] Delete unnecessary copy ctors llvm-svn: 361358 --- lldb/include/lldb/Core/SearchFilter.h | 2 -- lldb/include/lldb/Utility/FileSpec.h | 8 ------- lldb/include/lldb/Utility/Scalar.h | 1 - lldb/source/Core/SearchFilter.cpp | 3 --- .../Python/PythonDataObjects.cpp | 22 ------------------- .../Python/PythonDataObjects.h | 9 -------- lldb/source/Utility/FileSpec.cpp | 5 ----- lldb/source/Utility/Scalar.cpp | 3 --- .../debugserver/source/StdStringExtractor.cpp | 14 ------------ .../debugserver/source/StdStringExtractor.h | 4 ---- .../intel-features/intel-pt/PTDecoder.cpp | 12 ---------- .../tools/intel-features/intel-pt/PTDecoder.h | 10 --------- 12 files changed, 93 deletions(-) diff --git a/lldb/include/lldb/Core/SearchFilter.h b/lldb/include/lldb/Core/SearchFilter.h index 01dcadd12124b..f38690c95f523 100644 --- a/lldb/include/lldb/Core/SearchFilter.h +++ b/lldb/include/lldb/Core/SearchFilter.h @@ -364,8 +364,6 @@ class SearchFilterByModuleList : public SearchFilter { const FileSpecList &module_list, enum FilterTy filter_ty); - SearchFilterByModuleList(const SearchFilterByModuleList &rhs); - ~SearchFilterByModuleList() override; SearchFilterByModuleList &operator=(const SearchFilterByModuleList &rhs); diff --git a/lldb/include/lldb/Utility/FileSpec.h b/lldb/include/lldb/Utility/FileSpec.h index 967700020dc29..f0bc5c89fec77 100644 --- a/lldb/include/lldb/Utility/FileSpec.h +++ b/lldb/include/lldb/Utility/FileSpec.h @@ -75,14 +75,6 @@ class FileSpec { explicit FileSpec(llvm::StringRef path, const llvm::Triple &Triple); - /// Copy constructor - /// - /// Makes a copy of the uniqued directory and filename strings from \a rhs. - /// - /// \param[in] rhs - /// A const FileSpec object reference to copy. - FileSpec(const FileSpec &rhs); - /// Copy constructor /// /// Makes a copy of the uniqued directory and filename strings from \a rhs diff --git a/lldb/include/lldb/Utility/Scalar.h b/lldb/include/lldb/Utility/Scalar.h index 8f921b242dfde..ebf824ece9a46 100644 --- a/lldb/include/lldb/Utility/Scalar.h +++ b/lldb/include/lldb/Utility/Scalar.h @@ -115,7 +115,6 @@ class Scalar { } lldbassert(false && "unsupported bitwidth"); } - Scalar(const Scalar &rhs); // Scalar(const RegisterValue& reg_value); virtual ~Scalar(); diff --git a/lldb/source/Core/SearchFilter.cpp b/lldb/source/Core/SearchFilter.cpp index c0c14fc4576c1..531fa078de292 100644 --- a/lldb/source/Core/SearchFilter.cpp +++ b/lldb/source/Core/SearchFilter.cpp @@ -524,9 +524,6 @@ SearchFilterByModuleList::SearchFilterByModuleList( enum FilterTy filter_ty) : SearchFilter(target_sp, filter_ty), m_module_spec_list(module_list) {} -SearchFilterByModuleList::SearchFilterByModuleList( - const SearchFilterByModuleList &rhs) = default; - SearchFilterByModuleList &SearchFilterByModuleList:: operator=(const SearchFilterByModuleList &rhs) { m_target_sp = rhs.m_target_sp; diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp index ef4f738b54d9f..29dd037efd86b 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp @@ -215,8 +215,6 @@ PythonBytes::PythonBytes(PyRefType type, PyObject *py_obj) : PythonObject() { Reset(type, py_obj); // Use "Reset()" to ensure that py_obj is a string } -PythonBytes::PythonBytes(const PythonBytes &object) : PythonObject(object) {} - PythonBytes::~PythonBytes() {} bool PythonBytes::Check(PyObject *py_obj) { @@ -340,8 +338,6 @@ PythonString::PythonString(PyRefType type, PyObject *py_obj) : PythonObject() { Reset(type, py_obj); // Use "Reset()" to ensure that py_obj is a string } -PythonString::PythonString(const PythonString &object) : PythonObject(object) {} - PythonString::PythonString(llvm::StringRef string) : PythonObject() { SetString(string); } @@ -441,9 +437,6 @@ PythonInteger::PythonInteger(PyRefType type, PyObject *py_obj) Reset(type, py_obj); // Use "Reset()" to ensure that py_obj is a integer type } -PythonInteger::PythonInteger(const PythonInteger &object) - : PythonObject(object) {} - PythonInteger::PythonInteger(int64_t value) : PythonObject() { SetInteger(value); } @@ -529,9 +522,6 @@ PythonBoolean::PythonBoolean(PyRefType type, PyObject *py_obj) Reset(type, py_obj); // Use "Reset()" to ensure that py_obj is a boolean type } -PythonBoolean::PythonBoolean(const PythonBoolean &object) - : PythonObject(object) {} - PythonBoolean::PythonBoolean(bool value) { SetValue(value); } @@ -584,8 +574,6 @@ PythonList::PythonList(PyRefType type, PyObject *py_obj) : PythonObject() { Reset(type, py_obj); // Use "Reset()" to ensure that py_obj is a list } -PythonList::PythonList(const PythonList &list) : PythonObject(list) {} - PythonList::~PythonList() {} bool PythonList::Check(PyObject *py_obj) { @@ -663,8 +651,6 @@ PythonTuple::PythonTuple(PyRefType type, PyObject *py_obj) : PythonObject() { Reset(type, py_obj); // Use "Reset()" to ensure that py_obj is a tuple } -PythonTuple::PythonTuple(const PythonTuple &tuple) : PythonObject(tuple) {} - PythonTuple::PythonTuple(std::initializer_list objects) { m_py_obj = PyTuple_New(objects.size()); @@ -754,9 +740,6 @@ PythonDictionary::PythonDictionary(PyRefType type, PyObject *py_obj) Reset(type, py_obj); // Use "Reset()" to ensure that py_obj is a dictionary } -PythonDictionary::PythonDictionary(const PythonDictionary &object) - : PythonObject(object) {} - PythonDictionary::~PythonDictionary() {} bool PythonDictionary::Check(PyObject *py_obj) { @@ -826,8 +809,6 @@ PythonModule::PythonModule(PyRefType type, PyObject *py_obj) { Reset(type, py_obj); // Use "Reset()" to ensure that py_obj is a module } -PythonModule::PythonModule(const PythonModule &dict) : PythonObject(dict) {} - PythonModule::~PythonModule() {} PythonModule PythonModule::BuiltinsModule() { @@ -882,9 +863,6 @@ PythonCallable::PythonCallable(PyRefType type, PyObject *py_obj) { Reset(type, py_obj); // Use "Reset()" to ensure that py_obj is a callable } -PythonCallable::PythonCallable(const PythonCallable &callable) - : PythonObject(callable) {} - PythonCallable::~PythonCallable() {} bool PythonCallable::Check(PyObject *py_obj) { diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h index b1e49d49a4178..049ce90bb1b1c 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h +++ b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h @@ -198,7 +198,6 @@ class PythonBytes : public PythonObject { explicit PythonBytes(llvm::ArrayRef bytes); PythonBytes(const uint8_t *bytes, size_t length); PythonBytes(PyRefType type, PyObject *o); - PythonBytes(const PythonBytes &object); ~PythonBytes() override; @@ -250,7 +249,6 @@ class PythonString : public PythonObject { explicit PythonString(llvm::StringRef string); explicit PythonString(const char *string); PythonString(PyRefType type, PyObject *o); - PythonString(const PythonString &object); ~PythonString() override; @@ -275,7 +273,6 @@ class PythonInteger : public PythonObject { PythonInteger(); explicit PythonInteger(int64_t value); PythonInteger(PyRefType type, PyObject *o); - PythonInteger(const PythonInteger &object); ~PythonInteger() override; @@ -298,7 +295,6 @@ class PythonBoolean : public PythonObject { PythonBoolean() = default; explicit PythonBoolean(bool value); PythonBoolean(PyRefType type, PyObject *o); - PythonBoolean(const PythonBoolean &object); ~PythonBoolean() override = default; @@ -322,7 +318,6 @@ class PythonList : public PythonObject { explicit PythonList(PyInitialValue value); explicit PythonList(int list_size); PythonList(PyRefType type, PyObject *o); - PythonList(const PythonList &list); ~PythonList() override; @@ -350,7 +345,6 @@ class PythonTuple : public PythonObject { explicit PythonTuple(PyInitialValue value); explicit PythonTuple(int tuple_size); PythonTuple(PyRefType type, PyObject *o); - PythonTuple(const PythonTuple &tuple); PythonTuple(std::initializer_list objects); PythonTuple(std::initializer_list objects); @@ -377,7 +371,6 @@ class PythonDictionary : public PythonObject { PythonDictionary() {} explicit PythonDictionary(PyInitialValue value); PythonDictionary(PyRefType type, PyObject *o); - PythonDictionary(const PythonDictionary &dict); ~PythonDictionary() override; @@ -402,7 +395,6 @@ class PythonModule : public PythonObject { public: PythonModule(); PythonModule(PyRefType type, PyObject *o); - PythonModule(const PythonModule &dict); ~PythonModule() override; @@ -435,7 +427,6 @@ class PythonCallable : public PythonObject { PythonCallable(); PythonCallable(PyRefType type, PyObject *o); - PythonCallable(const PythonCallable &dict); ~PythonCallable() override; diff --git a/lldb/source/Utility/FileSpec.cpp b/lldb/source/Utility/FileSpec.cpp index e679056df9fa5..35d22404b9480 100644 --- a/lldb/source/Utility/FileSpec.cpp +++ b/lldb/source/Utility/FileSpec.cpp @@ -75,11 +75,6 @@ FileSpec::FileSpec(llvm::StringRef path, Style style) : m_style(style) { FileSpec::FileSpec(llvm::StringRef path, const llvm::Triple &Triple) : FileSpec{path, Triple.isOSWindows() ? Style::windows : Style::posix} {} -// Copy constructor -FileSpec::FileSpec(const FileSpec &rhs) - : m_directory(rhs.m_directory), m_filename(rhs.m_filename), - m_is_resolved(rhs.m_is_resolved), m_style(rhs.m_style) {} - // Copy constructor FileSpec::FileSpec(const FileSpec *rhs) : m_directory(), m_filename() { if (rhs) diff --git a/lldb/source/Utility/Scalar.cpp b/lldb/source/Utility/Scalar.cpp index 7658ac8f05409..bda5aa8ad9687 100644 --- a/lldb/source/Utility/Scalar.cpp +++ b/lldb/source/Utility/Scalar.cpp @@ -71,9 +71,6 @@ static Scalar::Type PromoteToMaxType( Scalar::Scalar() : m_type(e_void), m_float((float)0) {} -Scalar::Scalar(const Scalar &rhs) - : m_type(rhs.m_type), m_integer(rhs.m_integer), m_float(rhs.m_float) {} - bool Scalar::GetData(DataExtractor &data, size_t limit_byte_size) const { size_t byte_size = GetByteSize(); if (byte_size > 0) { diff --git a/lldb/tools/debugserver/source/StdStringExtractor.cpp b/lldb/tools/debugserver/source/StdStringExtractor.cpp index cb706a8f50c4a..e32689cbb5b4f 100644 --- a/lldb/tools/debugserver/source/StdStringExtractor.cpp +++ b/lldb/tools/debugserver/source/StdStringExtractor.cpp @@ -30,20 +30,6 @@ StdStringExtractor::StdStringExtractor(const char *packet_cstr) m_packet.assign(packet_cstr); } -// StdStringExtractor copy constructor -StdStringExtractor::StdStringExtractor(const StdStringExtractor &rhs) - : m_packet(rhs.m_packet), m_index(rhs.m_index) {} - -// StdStringExtractor assignment operator -const StdStringExtractor &StdStringExtractor:: -operator=(const StdStringExtractor &rhs) { - if (this != &rhs) { - m_packet = rhs.m_packet; - m_index = rhs.m_index; - } - return *this; -} - // Destructor StdStringExtractor::~StdStringExtractor() {} diff --git a/lldb/tools/debugserver/source/StdStringExtractor.h b/lldb/tools/debugserver/source/StdStringExtractor.h index d3edfb2f46158..2cad0f14b5f6a 100644 --- a/lldb/tools/debugserver/source/StdStringExtractor.h +++ b/lldb/tools/debugserver/source/StdStringExtractor.h @@ -21,12 +21,8 @@ class StdStringExtractor { // Constructors and Destructors StdStringExtractor(); StdStringExtractor(const char *packet_cstr); - StdStringExtractor(const StdStringExtractor &rhs); virtual ~StdStringExtractor(); - // Operators - const StdStringExtractor &operator=(const StdStringExtractor &rhs); - // Returns true if the file position is still valid for the data // contained in this string extractor object. bool IsGood() const { return m_index != UINT64_MAX; } diff --git a/lldb/tools/intel-features/intel-pt/PTDecoder.cpp b/lldb/tools/intel-features/intel-pt/PTDecoder.cpp index d7f9acea54bce..f09307d0ffedd 100644 --- a/lldb/tools/intel-features/intel-pt/PTDecoder.cpp +++ b/lldb/tools/intel-features/intel-pt/PTDecoder.cpp @@ -60,13 +60,6 @@ void PTInstructionList::Clear() { } // PTTraceOptions class member functions definitions -PTTraceOptions::PTTraceOptions() : m_opaque_sp() {} - -PTTraceOptions::PTTraceOptions(const PTTraceOptions &options) - : m_opaque_sp(options.m_opaque_sp) {} - -PTTraceOptions::~PTTraceOptions() {} - lldb::TraceType PTTraceOptions::GetType() const { return (m_opaque_sp ? m_opaque_sp->getType() : lldb::TraceType::eTraceTypeNone); @@ -96,11 +89,6 @@ void PTTraceOptions::SetSP( PTDecoder::PTDecoder(lldb::SBDebugger &sbdebugger) : m_opaque_sp(new ptdecoder_private::Decoder(sbdebugger)) {} -PTDecoder::PTDecoder(const PTDecoder &ptdecoder) - : m_opaque_sp(ptdecoder.m_opaque_sp) {} - -PTDecoder::~PTDecoder() {} - void PTDecoder::StartProcessorTrace(lldb::SBProcess &sbprocess, lldb::SBTraceOptions &sbtraceoptions, lldb::SBError &sberror) { diff --git a/lldb/tools/intel-features/intel-pt/PTDecoder.h b/lldb/tools/intel-features/intel-pt/PTDecoder.h index 6901f4491dfc5..f44c152747b15 100644 --- a/lldb/tools/intel-features/intel-pt/PTDecoder.h +++ b/lldb/tools/intel-features/intel-pt/PTDecoder.h @@ -102,12 +102,6 @@ class PTInstructionList { /// specific options. class PTTraceOptions { public: - PTTraceOptions(); - - PTTraceOptions(const PTTraceOptions &options); - - ~PTTraceOptions(); - lldb::TraceType GetType() const; uint64_t GetTraceBufferSize() const; @@ -148,10 +142,6 @@ class PTDecoder { public: PTDecoder(lldb::SBDebugger &sbdebugger); - PTDecoder(const PTDecoder &ptdecoder); - - ~PTDecoder(); - /// Start Intel(R) Processor Trace on a thread or complete process with /// Intel(R) Processor Trace specific configuration options ///