diff options
| author | Zachary Turner <zturner@google.com> | 2017-05-12 05:49:54 +0000 |
|---|---|---|
| committer | Zachary Turner <zturner@google.com> | 2017-05-12 05:49:54 +0000 |
| commit | 2833321f09efd9387257d17a3ef5128841142e6f (patch) | |
| tree | 734c009de6f4895529effceec687d377434ba2d9 /lldb/source/Target/Thread.cpp | |
| parent | 41c99364602a6965c30be674d75451ad87658d8c (diff) | |
| download | bcm5719-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/Target/Thread.cpp')
| -rw-r--r-- | lldb/source/Target/Thread.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/lldb/source/Target/Thread.cpp b/lldb/source/Target/Thread.cpp index 1759928c904..43ae7b5413b 100644 --- a/lldb/source/Target/Thread.cpp +++ b/lldb/source/Target/Thread.cpp @@ -2001,8 +2001,8 @@ bool Thread::GetDescription(Stream &strm, lldb::DescriptionLevel level, StructuredData::ObjectSP name = activity_dict->GetValueForKey("name"); if (name && name->GetType() == StructuredData::Type::eTypeString && id && id->GetType() == StructuredData::Type::eTypeInteger) { - strm.Printf(" Activity '%s', 0x%" PRIx64 "\n", - name->GetAsString()->GetValue().c_str(), + strm.Format(" Activity '{0}', {1:x}\n", + name->GetAsString()->GetValue(), id->GetAsInteger()->GetValue()); } printed_activity = true; @@ -2018,8 +2018,8 @@ bool Thread::GetDescription(Stream &strm, lldb::DescriptionLevel level, breadcrumb_dict->GetValueForKey("name"); if (breadcrumb_text && breadcrumb_text->GetType() == StructuredData::Type::eTypeString) { - strm.Printf(" Current Breadcrumb: %s\n", - breadcrumb_text->GetAsString()->GetValue().c_str()); + strm.Format(" Current Breadcrumb: {0}\n", + breadcrumb_text->GetAsString()->GetValue()); } printed_breadcrumb = true; } @@ -2040,8 +2040,7 @@ bool Thread::GetDescription(Stream &strm, lldb::DescriptionLevel level, message_dict->GetValueForKey("message"); if (message_text && message_text->GetType() == StructuredData::Type::eTypeString) { - strm.Printf(" %s\n", - message_text->GetAsString()->GetValue().c_str()); + strm.Format(" {0}\n", message_text->GetAsString()->GetValue()); } } } |

