summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2015-07-28 09:18:32 +0000
committerPavel Labath <labath@google.com>2015-07-28 09:18:32 +0000
commit3a29f8b9ec905f27829b6180c10f0f41fa883f0f (patch)
tree13efc3f7b775406d65ef3b5aa43271699eb82479
parente5b47640ee437b49313657aeee7f4e8c08bb0019 (diff)
downloadbcm5719-llvm-3a29f8b9ec905f27829b6180c10f0f41fa883f0f.tar.gz
bcm5719-llvm-3a29f8b9ec905f27829b6180c10f0f41fa883f0f.zip
Fix warnings detected by -Wpessimizing-move
patch by Eugene Zelenko Differential Revision: http://reviews.llvm.org/D11429 llvm-svn: 243399
-rw-r--r--lldb/source/API/SBPlatform.cpp2
-rw-r--r--lldb/source/Core/FormatEntity.cpp16
-rw-r--r--lldb/source/Core/RegularExpression.cpp3
-rw-r--r--lldb/source/Core/StreamAsynchronousIO.cpp2
-rw-r--r--lldb/source/Expression/ClangExpressionParser.cpp2
-rw-r--r--lldb/source/Host/common/HostInfoBase.cpp2
-rw-r--r--lldb/source/Host/common/XML.cpp4
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp12
8 files changed, 20 insertions, 23 deletions
diff --git a/lldb/source/API/SBPlatform.cpp b/lldb/source/API/SBPlatform.cpp
index 97ffcf14975..b8dc01ba781 100644
--- a/lldb/source/API/SBPlatform.cpp
+++ b/lldb/source/API/SBPlatform.cpp
@@ -189,7 +189,7 @@ SBPlatformShellCommand::~SBPlatformShellCommand()
void
SBPlatformShellCommand::Clear()
{
- m_opaque_ptr->m_output = std::move(std::string());
+ m_opaque_ptr->m_output = std::string();
m_opaque_ptr->m_status = 0;
m_opaque_ptr->m_signo = 0;
}
diff --git a/lldb/source/Core/FormatEntity.cpp b/lldb/source/Core/FormatEntity.cpp
index e89d6c9cb4a..b960007251f 100644
--- a/lldb/source/Core/FormatEntity.cpp
+++ b/lldb/source/Core/FormatEntity.cpp
@@ -1976,7 +1976,7 @@ ParseEntry (const llvm::StringRef &format_str,
switch (entry_def->type)
{
case FormatEntity::Entry::Type::ParentString:
- entry.string = std::move(format_str.str());
+ entry.string = format_str.str();
return error; // Success
case FormatEntity::Entry::Type::ParentNumber:
@@ -2026,7 +2026,7 @@ ParseEntry (const llvm::StringRef &format_str,
{
// Any value whose separator is a with a ':' means this value has a string argument
// that needs to be stored in the entry (like "${script.var:modulename.function}")
- entry.string = std::move(value.str());
+ entry.string = value.str();
}
else
{
@@ -2247,7 +2247,7 @@ FormatEntity::ParseInternal (llvm::StringRef &format, Entry &parent_entry, uint3
Entry entry;
if (!variable_format.empty())
{
- entry.printf_format = std::move(variable_format.str());
+ entry.printf_format = variable_format.str();
// If the format contains a '%' we are going to assume this is
// a printf style format. So if you want to format your thread ID
@@ -2449,7 +2449,7 @@ MakeMatch (const llvm::StringRef &prefix, const char *suffix)
{
std::string match(prefix.str());
match.append(suffix);
- return std::move(match);
+ return match;
}
static void
@@ -2463,7 +2463,7 @@ AddMatches (const FormatEntity::Entry::Definition *def,
{
for (size_t i=0; i<n; ++i)
{
- std::string match = std::move(prefix.str());
+ std::string match = prefix.str();
if (match_prefix.empty())
matches.AppendString(MakeMatch (prefix, def->children[i].name));
else if (strncmp(def->children[i].name, match_prefix.data(), match_prefix.size()) == 0)
@@ -2488,7 +2488,7 @@ FormatEntity::AutoComplete (const char *s,
// Hitting TAB after $ at the end of the string add a "{"
if (dollar_pos == str.size() - 1)
{
- std::string match = std::move(str.str());
+ std::string match = str.str();
match.append("{");
matches.AppendString(std::move(match));
}
@@ -2521,12 +2521,12 @@ FormatEntity::AutoComplete (const char *s,
if (n > 0)
{
// "${thread.info" <TAB>
- matches.AppendString(std::move(MakeMatch (str, ".")));
+ matches.AppendString(MakeMatch(str, "."));
}
else
{
// "${thread.id" <TAB>
- matches.AppendString(std::move(MakeMatch (str, "}")));
+ matches.AppendString(MakeMatch (str, "}"));
word_complete = true;
}
}
diff --git a/lldb/source/Core/RegularExpression.cpp b/lldb/source/Core/RegularExpression.cpp
index 3f712e1b2da..767521500af 100644
--- a/lldb/source/Core/RegularExpression.cpp
+++ b/lldb/source/Core/RegularExpression.cpp
@@ -153,7 +153,7 @@ RegularExpression::Match::GetMatchAtIndex (const char* s, uint32_t idx, std::str
llvm::StringRef match_str_ref;
if (GetMatchAtIndex(s, idx, match_str_ref))
{
- match_str = std::move(match_str_ref.str());
+ match_str = match_str_ref.str();
return true;
}
return false;
@@ -258,4 +258,3 @@ RegularExpression::operator < (const RegularExpression& rhs) const
{
return (m_re < rhs.m_re);
}
-
diff --git a/lldb/source/Core/StreamAsynchronousIO.cpp b/lldb/source/Core/StreamAsynchronousIO.cpp
index ccfde0c9a01..6f8fcce932e 100644
--- a/lldb/source/Core/StreamAsynchronousIO.cpp
+++ b/lldb/source/Core/StreamAsynchronousIO.cpp
@@ -36,7 +36,7 @@ StreamAsynchronousIO::Flush ()
if (!m_data.empty())
{
m_debugger.PrintAsync (m_data.data(), m_data.size(), m_for_stdout);
- m_data = std::move(std::string());
+ m_data = std::string();
}
}
diff --git a/lldb/source/Expression/ClangExpressionParser.cpp b/lldb/source/Expression/ClangExpressionParser.cpp
index 2b344b0c373..d59e8e06f32 100644
--- a/lldb/source/Expression/ClangExpressionParser.cpp
+++ b/lldb/source/Expression/ClangExpressionParser.cpp
@@ -372,7 +372,7 @@ ClangExpressionParser::Parse (Stream &stream)
if (HostInfo::GetLLDBPath(lldb::ePathTypeLLDBTempSystemDir, tmpdir_file_spec))
{
tmpdir_file_spec.AppendPathComponent("lldb-%%%%%%.expr");
- temp_source_path = std::move(tmpdir_file_spec.GetPath());
+ temp_source_path = tmpdir_file_spec.GetPath();
llvm::sys::fs::createUniqueFile(temp_source_path, temp_fd, result_path);
}
else
diff --git a/lldb/source/Host/common/HostInfoBase.cpp b/lldb/source/Host/common/HostInfoBase.cpp
index e969e33190e..7a6ea0c2b84 100644
--- a/lldb/source/Host/common/HostInfoBase.cpp
+++ b/lldb/source/Host/common/HostInfoBase.cpp
@@ -102,7 +102,7 @@ HostInfoBase::GetVendorString()
{
static std::once_flag g_once_flag;
std::call_once(g_once_flag, []() {
- g_fields->m_vendor_string = std::move(HostInfo::GetArchitecture().GetTriple().getVendorName().str());
+ g_fields->m_vendor_string = HostInfo::GetArchitecture().GetTriple().getVendorName().str();
});
return g_fields->m_vendor_string;
}
diff --git a/lldb/source/Host/common/XML.cpp b/lldb/source/Host/common/XML.cpp
index 6cd9af0051a..dc9cb0bc5a3 100644
--- a/lldb/source/Host/common/XML.cpp
+++ b/lldb/source/Host/common/XML.cpp
@@ -592,7 +592,7 @@ ApplePropertyList::ExtractStringFromValueNode (const XMLNode &node, std::string
if (element_name == "true" || element_name == "false")
{
// The text value _is_ the element name itself...
- value = std::move(element_name.str());
+ value = element_name.str();
return true;
}
else if (element_name == "dict" || element_name == "array")
@@ -689,5 +689,3 @@ ApplePropertyList::GetStructuredData()
#endif
return root_sp;
}
-
-
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index 0b31b097933..a2e903f47c4 100644
--- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -2184,7 +2184,7 @@ ProcessGDBRemote::SetThreadStopInfo (StructuredData::Dictionary *thread_dict)
}
else if (key == g_key_name)
{
- thread_name = std::move(object->GetStringValue());
+ thread_name = object->GetStringValue();
}
else if (key == g_key_qaddr)
{
@@ -2193,7 +2193,7 @@ ProcessGDBRemote::SetThreadStopInfo (StructuredData::Dictionary *thread_dict)
else if (key == g_key_queue_name)
{
queue_vars_valid = true;
- queue_name = std::move(object->GetStringValue());
+ queue_name = object->GetStringValue();
}
else if (key == g_key_queue_kind)
{
@@ -2217,11 +2217,11 @@ ProcessGDBRemote::SetThreadStopInfo (StructuredData::Dictionary *thread_dict)
}
else if (key == g_key_reason)
{
- reason = std::move(object->GetStringValue());
+ reason = object->GetStringValue();
}
else if (key == g_key_description)
{
- description = std::move(object->GetStringValue());
+ description = object->GetStringValue();
}
else if (key == g_key_registers)
{
@@ -2232,7 +2232,7 @@ ProcessGDBRemote::SetThreadStopInfo (StructuredData::Dictionary *thread_dict)
registers_dict->ForEach([&expedited_register_map](ConstString key, StructuredData::Object* object) -> bool {
const uint32_t reg = StringConvert::ToUInt32 (key.GetCString(), UINT32_MAX, 10);
if (reg != UINT32_MAX)
- expedited_register_map[reg] = std::move(object->GetStringValue());
+ expedited_register_map[reg] = object->GetStringValue();
return true; // Keep iterating through all array items
});
}
@@ -2468,7 +2468,7 @@ ProcessGDBRemote::SetThreadStopInfo (StringExtractor& stop_packet)
if (mem_cache_addr != LLDB_INVALID_ADDRESS)
{
StringExtractor bytes;
- bytes.GetStringRef() = std::move(pair.second.str());
+ bytes.GetStringRef() = pair.second.str();
const size_t byte_size = bytes.GetStringRef().size()/2;
DataBufferSP data_buffer_sp(new DataBufferHeap(byte_size, 0));
const size_t bytes_copied = bytes.GetHexBytes (data_buffer_sp->GetBytes(), byte_size, 0);
OpenPOWER on IntegriCloud