summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2017-05-12 05:49:54 +0000
committerZachary Turner <zturner@google.com>2017-05-12 05:49:54 +0000
commit2833321f09efd9387257d17a3ef5128841142e6f (patch)
tree734c009de6f4895529effceec687d377434ba2d9 /lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
parent41c99364602a6965c30be674d75451ad87658d8c (diff)
downloadbcm5719-llvm-2833321f09efd9387257d17a3ef5128841142e6f.tar.gz
bcm5719-llvm-2833321f09efd9387257d17a3ef5128841142e6f.zip
Update StructuredData::String to return StringRefs.
It was returning const std::string& which was leading to unnecessary copies all over the place, and preventing people from doing things like Dict->GetValueForKeyAsString("foo", ref); llvm-svn: 302875
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp')
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
index 8d91db87b5a..550ec0ea499 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
@@ -3224,12 +3224,12 @@ ParseModuleSpec(StructuredData::Dictionary *dict) {
if (!dict)
return llvm::None;
- std::string string;
+ llvm::StringRef string;
uint64_t integer;
if (!dict->GetValueForKeyAsString("uuid", string))
return llvm::None;
- result.GetUUID().SetFromCString(string.c_str(), string.size());
+ result.GetUUID().SetFromStringRef(string, string.size());
if (!dict->GetValueForKeyAsInteger("file_offset", integer))
return llvm::None;
@@ -3241,7 +3241,7 @@ ParseModuleSpec(StructuredData::Dictionary *dict) {
if (!dict->GetValueForKeyAsString("triple", string))
return llvm::None;
- result.GetArchitecture().SetTriple(string.c_str());
+ result.GetArchitecture().SetTriple(string);
if (!dict->GetValueForKeyAsString("file_path", string))
return llvm::None;
OpenPOWER on IntegriCloud