[Lldb-commits] [PATCH] D142824: [lldb][NFC] Use move instead of copy
Chris Cotter via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Sat Jan 28 17:54:07 PST 2023
ccotter created this revision.
Herald added a project: All.
ccotter requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.
For functions that accept an rvalue reference type
parameter, use move to avoid copying the parameter.
These were found when implementing CppCoreGuideline F.18 in
clang-tidy.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D142824
Files:
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp
lldb/source/Plugins/TraceExporter/common/TraceHTR.cpp
lldb/source/Target/Process.cpp
Index: lldb/source/Target/Process.cpp
===================================================================
--- lldb/source/Target/Process.cpp
+++ lldb/source/Target/Process.cpp
@@ -3352,7 +3352,7 @@
void Process::SetUnixSignals(UnixSignalsSP &&signals_sp) {
assert(signals_sp && "null signals_sp");
- m_unix_signals_sp = signals_sp;
+ m_unix_signals_sp = std::move(signals_sp);
}
const lldb::UnixSignalsSP &Process::GetUnixSignals() {
Index: lldb/source/Plugins/TraceExporter/common/TraceHTR.cpp
===================================================================
--- lldb/source/Plugins/TraceExporter/common/TraceHTR.cpp
+++ lldb/source/Plugins/TraceExporter/common/TraceHTR.cpp
@@ -69,7 +69,7 @@
void HTRBlockLayer::AppendNewBlock(size_t block_id, HTRBlock &&block) {
m_block_id_trace.emplace_back(block_id);
- m_block_defs.emplace(block_id, block);
+ m_block_defs.emplace(block_id, std::move(block));
}
void HTRBlockLayer::AppendRepeatedBlock(size_t block_id) {
Index: lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp
===================================================================
--- lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp
+++ lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp
@@ -559,7 +559,7 @@
}
void GDBRemoteCommunicationServerPlatform::SetPortMap(PortMap &&port_map) {
- m_port_map = port_map;
+ m_port_map = std::move(port_map);
}
const FileSpec &GDBRemoteCommunicationServerPlatform::GetDomainSocketDir() {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D142824.493048.patch
Type: text/x-patch
Size: 1559 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20230129/4d886b5b/attachment.bin>
More information about the lldb-commits
mailing list