[Lldb-commits] [lldb] c4701c9 - [lldb] Add missings moves where appropiate (NFC)
Jonas Devlieghere via lldb-commits
lldb-commits at lists.llvm.org
Mon Aug 10 21:02:19 PDT 2020
Author: Jonas Devlieghere
Date: 2020-08-10T21:02:11-07:00
New Revision: c4701c9c620fecfd6975e2885dae02d6e1b96698
URL: https://github.com/llvm/llvm-project/commit/c4701c9c620fecfd6975e2885dae02d6e1b96698
DIFF: https://github.com/llvm/llvm-project/commit/c4701c9c620fecfd6975e2885dae02d6e1b96698.diff
LOG: [lldb] Add missings moves where appropiate (NFC)
Manually curated list of things found by clang-tidy's
performance-unnecessary-value-param.
Added:
Modified:
lldb/include/lldb/Breakpoint/Breakpoint.h
lldb/include/lldb/Core/ValueObject.h
lldb/include/lldb/DataFormatters/FormattersContainer.h
lldb/include/lldb/DataFormatters/StringPrinter.h
lldb/include/lldb/DataFormatters/TypeCategory.h
lldb/include/lldb/DataFormatters/TypeCategoryMap.h
lldb/include/lldb/DataFormatters/TypeSummary.h
lldb/include/lldb/DataFormatters/TypeSynthetic.h
lldb/include/lldb/Host/FileSystem.h
lldb/include/lldb/Target/InstrumentationRuntime.h
lldb/include/lldb/Target/Process.h
lldb/source/Core/Debugger.cpp
lldb/source/Core/ValueObjectSyntheticFilter.cpp
Removed:
################################################################################
diff --git a/lldb/include/lldb/Breakpoint/Breakpoint.h b/lldb/include/lldb/Breakpoint/Breakpoint.h
index 5d3e596c474b..ddb70b719d6e 100644
--- a/lldb/include/lldb/Breakpoint/Breakpoint.h
+++ b/lldb/include/lldb/Breakpoint/Breakpoint.h
@@ -545,7 +545,7 @@ class Breakpoint : public std::enable_shared_from_this<Breakpoint>,
/// if the condition says to stop and false otherwise.
///
void SetPrecondition(lldb::BreakpointPreconditionSP precondition_sp) {
- m_precondition_sp = precondition_sp;
+ m_precondition_sp = std::move(precondition_sp);
}
bool EvaluatePrecondition(StoppointCallbackContext &context);
diff --git a/lldb/include/lldb/Core/ValueObject.h b/lldb/include/lldb/Core/ValueObject.h
index a557d69f3ae3..a665e7afa0ca 100644
--- a/lldb/include/lldb/Core/ValueObject.h
+++ b/lldb/include/lldb/Core/ValueObject.h
@@ -702,12 +702,12 @@ class ValueObject : public UserID {
}
void SetSummaryFormat(lldb::TypeSummaryImplSP format) {
- m_type_summary_sp = format;
+ m_type_summary_sp = std::move(format);
ClearUserVisibleData(eClearUserVisibleDataItemsSummary);
}
void SetValueFormat(lldb::TypeFormatImplSP format) {
- m_type_format_sp = format;
+ m_type_format_sp = std::move(format);
ClearUserVisibleData(eClearUserVisibleDataItemsValue);
}
diff --git a/lldb/include/lldb/DataFormatters/FormattersContainer.h b/lldb/include/lldb/DataFormatters/FormattersContainer.h
index a30ad920ef45..aebccbe413cc 100644
--- a/lldb/include/lldb/DataFormatters/FormattersContainer.h
+++ b/lldb/include/lldb/DataFormatters/FormattersContainer.h
@@ -74,7 +74,7 @@ class TypeMatcher {
: m_type_name(type_name), m_is_regex(false) {}
/// Creates a matcher that accepts any type matching the given regex.
TypeMatcher(RegularExpression regex)
- : m_type_name_regex(regex), m_is_regex(true) {}
+ : m_type_name_regex(std::move(regex)), m_is_regex(true) {}
/// True iff this matches the given type name.
bool Matches(ConstString type_name) const {
diff --git a/lldb/include/lldb/DataFormatters/StringPrinter.h b/lldb/include/lldb/DataFormatters/StringPrinter.h
index 17c645f8637a..4a6e2e9051bf 100644
--- a/lldb/include/lldb/DataFormatters/StringPrinter.h
+++ b/lldb/include/lldb/DataFormatters/StringPrinter.h
@@ -109,7 +109,7 @@ class StringPrinter {
uint64_t GetLocation() const { return m_location; }
- void SetProcessSP(lldb::ProcessSP p) { m_process_sp = p; }
+ void SetProcessSP(lldb::ProcessSP p) { m_process_sp = std::move(p); }
lldb::ProcessSP GetProcessSP() const { return m_process_sp; }
diff --git a/lldb/include/lldb/DataFormatters/TypeCategory.h b/lldb/include/lldb/DataFormatters/TypeCategory.h
index 2662ffc5aeac..2c9305901837 100644
--- a/lldb/include/lldb/DataFormatters/TypeCategory.h
+++ b/lldb/include/lldb/DataFormatters/TypeCategory.h
@@ -91,52 +91,52 @@ class TypeCategoryImpl {
template <typename U = TypeFormatImpl>
typename std::enable_if<std::is_same<U, T>::value, ForEachCallbacks &>::type
SetExact(FormatContainer::ExactMatchForEachCallback callback) {
- m_format_exact = callback;
+ m_format_exact = std::move(callback);
return *this;
}
template <typename U = TypeFormatImpl>
typename std::enable_if<std::is_same<U, T>::value, ForEachCallbacks &>::type
SetWithRegex(FormatContainer::RegexMatchForEachCallback callback) {
- m_format_regex = callback;
+ m_format_regex = std::move(callback);
return *this;
}
template <typename U = TypeSummaryImpl>
typename std::enable_if<std::is_same<U, T>::value, ForEachCallbacks &>::type
SetExact(SummaryContainer::ExactMatchForEachCallback callback) {
- m_summary_exact = callback;
+ m_summary_exact = std::move(callback);
return *this;
}
template <typename U = TypeSummaryImpl>
typename std::enable_if<std::is_same<U, T>::value, ForEachCallbacks &>::type
SetWithRegex(SummaryContainer::RegexMatchForEachCallback callback) {
- m_summary_regex = callback;
+ m_summary_regex = std::move(callback);
return *this;
}
template <typename U = TypeFilterImpl>
typename std::enable_if<std::is_same<U, T>::value, ForEachCallbacks &>::type
SetExact(FilterContainer::ExactMatchForEachCallback callback) {
- m_filter_exact = callback;
+ m_filter_exact = std::move(callback);
return *this;
}
template <typename U = TypeFilterImpl>
typename std::enable_if<std::is_same<U, T>::value, ForEachCallbacks &>::type
SetWithRegex(FilterContainer::RegexMatchForEachCallback callback) {
- m_filter_regex = callback;
+ m_filter_regex = std::move(callback);
return *this;
}
template <typename U = SyntheticChildren>
typename std::enable_if<std::is_same<U, T>::value, ForEachCallbacks &>::type
SetExact(SynthContainer::ExactMatchForEachCallback callback) {
- m_synth_exact = callback;
+ m_synth_exact = std::move(callback);
return *this;
}
template <typename U = SyntheticChildren>
typename std::enable_if<std::is_same<U, T>::value, ForEachCallbacks &>::type
SetWithRegex(SynthContainer::RegexMatchForEachCallback callback) {
- m_synth_regex = callback;
+ m_synth_regex = std::move(callback);
return *this;
}
diff --git a/lldb/include/lldb/DataFormatters/TypeCategoryMap.h b/lldb/include/lldb/DataFormatters/TypeCategoryMap.h
index 6cd773786386..4dbca29db066 100644
--- a/lldb/include/lldb/DataFormatters/TypeCategoryMap.h
+++ b/lldb/include/lldb/DataFormatters/TypeCategoryMap.h
@@ -84,7 +84,8 @@ class TypeCategoryMap {
lldb::TypeCategoryImplSP ptr;
public:
- delete_matching_categories(lldb::TypeCategoryImplSP p) : ptr(p) {}
+ delete_matching_categories(lldb::TypeCategoryImplSP p)
+ : ptr(std::move(p)) {}
bool operator()(const lldb::TypeCategoryImplSP &other) {
return ptr.get() == other.get();
diff --git a/lldb/include/lldb/DataFormatters/TypeSummary.h b/lldb/include/lldb/DataFormatters/TypeSummary.h
index 6c3780f7276d..ce3195dbb693 100644
--- a/lldb/include/lldb/DataFormatters/TypeSummary.h
+++ b/lldb/include/lldb/DataFormatters/TypeSummary.h
@@ -322,7 +322,7 @@ struct CXXFunctionSummaryFormat : public TypeSummaryImpl {
const char *GetTextualInfo() const { return m_description.c_str(); }
- void SetBackendFunction(Callback cb_func) { m_impl = cb_func; }
+ void SetBackendFunction(Callback cb_func) { m_impl = std::move(cb_func); }
void SetTextualInfo(const char *descr) {
if (descr)
diff --git a/lldb/include/lldb/DataFormatters/TypeSynthetic.h b/lldb/include/lldb/DataFormatters/TypeSynthetic.h
index c852ff18bfa2..fa1458281f1e 100644
--- a/lldb/include/lldb/DataFormatters/TypeSynthetic.h
+++ b/lldb/include/lldb/DataFormatters/TypeSynthetic.h
@@ -362,7 +362,7 @@ class CXXSyntheticChildren : public SyntheticChildren {
CreateFrontEndCallback;
CXXSyntheticChildren(const SyntheticChildren::Flags &flags,
const char *description, CreateFrontEndCallback callback)
- : SyntheticChildren(flags), m_create_callback(callback),
+ : SyntheticChildren(flags), m_create_callback(std::move(callback)),
m_description(description ? description : "") {}
bool IsScripted() override { return false; }
diff --git a/lldb/include/lldb/Host/FileSystem.h b/lldb/include/lldb/Host/FileSystem.h
index 8dcff3402592..697e799387b8 100644
--- a/lldb/include/lldb/Host/FileSystem.h
+++ b/lldb/include/lldb/Host/FileSystem.h
@@ -35,11 +35,11 @@ class FileSystem {
: m_fs(llvm::vfs::getRealFileSystem()), m_collector(nullptr),
m_mapped(false) {}
FileSystem(std::shared_ptr<llvm::FileCollector> collector)
- : m_fs(llvm::vfs::getRealFileSystem()), m_collector(collector),
+ : m_fs(llvm::vfs::getRealFileSystem()), m_collector(std::move(collector)),
m_mapped(false) {}
FileSystem(llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> fs,
bool mapped = false)
- : m_fs(fs), m_collector(nullptr), m_mapped(mapped) {}
+ : m_fs(std::move(fs)), m_collector(nullptr), m_mapped(mapped) {}
FileSystem(const FileSystem &fs) = delete;
FileSystem &operator=(const FileSystem &fs) = delete;
diff --git a/lldb/include/lldb/Target/InstrumentationRuntime.h b/lldb/include/lldb/Target/InstrumentationRuntime.h
index dd4da26c215e..eeec91f36af4 100644
--- a/lldb/include/lldb/Target/InstrumentationRuntime.h
+++ b/lldb/include/lldb/Target/InstrumentationRuntime.h
@@ -53,7 +53,7 @@ class InstrumentationRuntime
lldb::ModuleSP GetRuntimeModuleSP() { return m_runtime_module; }
void SetRuntimeModuleSP(lldb::ModuleSP module_sp) {
- m_runtime_module = module_sp;
+ m_runtime_module = std::move(module_sp);
}
lldb::user_id_t GetBreakpointID() const { return m_breakpoint_id; }
diff --git a/lldb/include/lldb/Target/Process.h b/lldb/include/lldb/Target/Process.h
index 2abedb8f6e2e..cf0d78f24951 100644
--- a/lldb/include/lldb/Target/Process.h
+++ b/lldb/include/lldb/Target/Process.h
@@ -327,7 +327,7 @@ class ProcessModID {
}
void SetStopEventForLastNaturalStopID(lldb::EventSP event_sp) {
- m_last_natural_stop_event = event_sp;
+ m_last_natural_stop_event = std::move(event_sp);
}
lldb::EventSP GetStopEventForStopID(uint32_t stop_id) const {
@@ -2164,7 +2164,7 @@ class Process : public std::enable_shared_from_this<Process>,
public:
ProcessEventHijacker(Process &process, lldb::ListenerSP listener_sp)
: m_process(process) {
- m_process.HijackProcessEvents(listener_sp);
+ m_process.HijackProcessEvents(std::move(listener_sp));
}
~ProcessEventHijacker() { m_process.RestoreProcessEvents(); }
diff --git a/lldb/source/Core/Debugger.cpp b/lldb/source/Core/Debugger.cpp
index 05cfac19915e..1fb7393eef0a 100644
--- a/lldb/source/Core/Debugger.cpp
+++ b/lldb/source/Core/Debugger.cpp
@@ -776,7 +776,7 @@ repro::DataRecorder *Debugger::GetInputRecorder() { return m_input_recorder; }
void Debugger::SetInputFile(FileSP file_sp, repro::DataRecorder *recorder) {
assert(file_sp && file_sp->IsValid());
m_input_recorder = recorder;
- m_input_file_sp = file_sp;
+ m_input_file_sp = std::move(file_sp);
// Save away the terminal state if that is relevant, so that we can restore
// it in RestoreInputState.
SaveInputTerminalState();
diff --git a/lldb/source/Core/ValueObjectSyntheticFilter.cpp b/lldb/source/Core/ValueObjectSyntheticFilter.cpp
index fb2d32e602ce..cebf7abfe523 100644
--- a/lldb/source/Core/ValueObjectSyntheticFilter.cpp
+++ b/lldb/source/Core/ValueObjectSyntheticFilter.cpp
@@ -46,7 +46,7 @@ class DummySyntheticFrontEnd : public SyntheticChildrenFrontEnd {
ValueObjectSynthetic::ValueObjectSynthetic(ValueObject &parent,
lldb::SyntheticChildrenSP filter)
- : ValueObject(parent), m_synth_sp(filter), m_children_byindex(),
+ : ValueObject(parent), m_synth_sp(std::move(filter)), m_children_byindex(),
m_name_toindex(), m_synthetic_children_cache(),
m_synthetic_children_count(UINT32_MAX),
m_parent_type_name(parent.GetTypeName()),
More information about the lldb-commits
mailing list