forked from OSchip/llvm-project
[lldb] Add missings moves where appropiate (NFC)
Manually curated list of things found by clang-tidy's performance-unnecessary-value-param.
This commit is contained in:
parent
02af25df2b
commit
c4701c9c62
|
@ -545,7 +545,7 @@ public:
|
|||
/// 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);
|
||||
|
|
|
@ -702,12 +702,12 @@ public:
|
|||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
|
@ -74,7 +74,7 @@ public:
|
|||
: 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 {
|
||||
|
|
|
@ -109,7 +109,7 @@ public:
|
|||
|
||||
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; }
|
||||
|
||||
|
|
|
@ -91,52 +91,52 @@ public:
|
|||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -84,7 +84,8 @@ private:
|
|||
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();
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -362,7 +362,7 @@ public:
|
|||
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; }
|
||||
|
|
|
@ -35,11 +35,11 @@ public:
|
|||
: 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;
|
||||
|
|
|
@ -53,7 +53,7 @@ protected:
|
|||
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; }
|
||||
|
|
|
@ -327,7 +327,7 @@ public:
|
|||
}
|
||||
|
||||
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 @@ public:
|
|||
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(); }
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -46,7 +46,7 @@ public:
|
|||
|
||||
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()),
|
||||
|
|
Loading…
Reference in New Issue