summaryrefslogtreecommitdiffstats
path: root/lldb/source/DataFormatters
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/DataFormatters')
-rw-r--r--lldb/source/DataFormatters/FormatManager.cpp5
-rw-r--r--lldb/source/DataFormatters/TypeCategory.cpp7
-rw-r--r--lldb/source/DataFormatters/TypeFormat.cpp9
-rw-r--r--lldb/source/DataFormatters/TypeSummary.cpp4
-rw-r--r--lldb/source/DataFormatters/ValueObjectPrinter.cpp13
-rw-r--r--lldb/source/DataFormatters/VectorType.cpp2
6 files changed, 17 insertions, 23 deletions
diff --git a/lldb/source/DataFormatters/FormatManager.cpp b/lldb/source/DataFormatters/FormatManager.cpp
index 07e2b779785..6e5fdf92305 100644
--- a/lldb/source/DataFormatters/FormatManager.cpp
+++ b/lldb/source/DataFormatters/FormatManager.cpp
@@ -1,5 +1,4 @@
-//===-- FormatManager.cpp -------------------------------------------*- C++
-//-*-===//
+//===-- FormatManager.cpp ----------------------------------------*- C++-*-===//
//
// The LLVM Compiler Infrastructure
//
@@ -183,7 +182,7 @@ void FormatManager::GetPossibleMatches(
if (valobj.GetBitfieldBitSize() > 0) {
StreamString sstring;
sstring.Printf("%s:%d", type_name.AsCString(), valobj.GetBitfieldBitSize());
- ConstString bitfieldname = ConstString(sstring.GetData());
+ ConstString bitfieldname(sstring.GetString());
entries.push_back(
{bitfieldname, 0, did_strip_ptr, did_strip_ref, did_strip_typedef});
reason |= lldb_private::eFormatterChoiceCriterionStrippedBitField;
diff --git a/lldb/source/DataFormatters/TypeCategory.cpp b/lldb/source/DataFormatters/TypeCategory.cpp
index 5f4863a7c5f..db3372c5292 100644
--- a/lldb/source/DataFormatters/TypeCategory.cpp
+++ b/lldb/source/DataFormatters/TypeCategory.cpp
@@ -1,5 +1,4 @@
-//===-- TypeCategory.cpp -------------------------------------------*- C++
-//-*-===//
+//===-- TypeCategory.cpp -----------------------------------------*- C++-*-===//
//
// The LLVM Compiler Infrastructure
//
@@ -638,7 +637,7 @@ std::string TypeCategoryImpl::GetDescription() {
idx + 1 < GetNumLanguages() ? ", " : "");
}
if (print_lang)
- stream.Printf("%s", lang_stream.GetData());
+ stream.PutCString(lang_stream.GetString());
stream.PutChar(')');
- return stream.GetData();
+ return stream.GetString();
}
diff --git a/lldb/source/DataFormatters/TypeFormat.cpp b/lldb/source/DataFormatters/TypeFormat.cpp
index 1ec52083c7c..8bd369b3532 100644
--- a/lldb/source/DataFormatters/TypeFormat.cpp
+++ b/lldb/source/DataFormatters/TypeFormat.cpp
@@ -63,7 +63,7 @@ bool TypeFormatImpl_Format::FormatObject(ValueObject *valobj,
data.Dump(&reg_sstr, 0, GetFormat(), reg_info->byte_size, 1, UINT32_MAX,
LLDB_INVALID_ADDRESS, 0, 0,
exe_ctx.GetBestExecutionContextScope());
- dest.swap(reg_sstr.GetString());
+ dest = reg_sstr.GetString();
}
} else {
CompilerType compiler_type = value.GetCompilerType();
@@ -115,10 +115,7 @@ bool TypeFormatImpl_Format::FormatObject(ValueObject *valobj,
// return from here, but that's about as severe as we get
// CompilerType::DumpTypeValue() should always return
// something, even if that something is an error message
- if (sstr.GetString().empty())
- dest.clear();
- else
- dest.swap(sstr.GetString());
+ dest = sstr.GetString();
}
}
return !dest.empty();
@@ -196,7 +193,7 @@ bool TypeFormatImpl_EnumType::FormatObject(ValueObject *valobj,
data.GetByteSize(), 0, 0,
exe_ctx.GetBestExecutionContextScope());
if (!sstr.GetString().empty())
- dest.swap(sstr.GetString());
+ dest = sstr.GetString();
return !dest.empty();
}
diff --git a/lldb/source/DataFormatters/TypeSummary.cpp b/lldb/source/DataFormatters/TypeSummary.cpp
index 6a192d4369e..610d2fe7998 100644
--- a/lldb/source/DataFormatters/TypeSummary.cpp
+++ b/lldb/source/DataFormatters/TypeSummary.cpp
@@ -98,7 +98,7 @@ bool StringSummaryFormat::FormatObject(ValueObject *valobj, std::string &retval,
if (IsOneLiner()) {
ValueObjectPrinter printer(valobj, &s, DumpValueObjectOptions());
printer.PrintChildrenOneLiner(HideNames(valobj));
- retval.assign(s.GetData());
+ retval = s.GetString();
return true;
} else {
if (FormatEntity::Format(m_format, s, &sc, &exe_ctx,
@@ -141,7 +141,7 @@ bool CXXFunctionSummaryFormat::FormatObject(ValueObject *valobj,
StreamString stream;
if (!m_impl || m_impl(*valobj, stream, options) == false)
return false;
- dest.assign(stream.GetData());
+ dest = stream.GetString();
return true;
}
diff --git a/lldb/source/DataFormatters/ValueObjectPrinter.cpp b/lldb/source/DataFormatters/ValueObjectPrinter.cpp
index 9e66d8dfb2a..d6efe78e49a 100644
--- a/lldb/source/DataFormatters/ValueObjectPrinter.cpp
+++ b/lldb/source/DataFormatters/ValueObjectPrinter.cpp
@@ -1,5 +1,4 @@
-//===-- ValueObjectPrinter.cpp -------------------------------------*- C++
-//-*-===//
+//===-- ValueObjectPrinter.cpp -----------------------------------*- C++-*-===//
//
// The LLVM Compiler Infrastructure
//
@@ -302,22 +301,22 @@ void ValueObjectPrinter::PrintDecl() {
}
if (m_options.m_decl_printing_helper) {
- ConstString type_name_cstr(typeName.GetData());
- ConstString var_name_cstr(varName.GetData());
+ ConstString type_name_cstr(typeName.GetString());
+ ConstString var_name_cstr(varName.GetString());
StreamString dest_stream;
if (m_options.m_decl_printing_helper(type_name_cstr, var_name_cstr,
m_options, dest_stream)) {
decl_printed = true;
- m_stream->Printf("%s", dest_stream.GetData());
+ m_stream->PutCString(dest_stream.GetString());
}
}
// if the helper failed, or there is none, do a default thing
if (!decl_printed) {
- if (typeName.GetSize())
+ if (!typeName.Empty())
m_stream->Printf("(%s) ", typeName.GetData());
- if (varName.GetSize())
+ if (!varName.Empty())
m_stream->Printf("%s =", varName.GetData());
else if (!m_options.m_hide_name)
m_stream->Printf(" =");
diff --git a/lldb/source/DataFormatters/VectorType.cpp b/lldb/source/DataFormatters/VectorType.cpp
index 77694618ded..652bde792ab 100644
--- a/lldb/source/DataFormatters/VectorType.cpp
+++ b/lldb/source/DataFormatters/VectorType.cpp
@@ -211,7 +211,7 @@ public:
StreamString idx_name;
idx_name.Printf("[%" PRIu64 "]", (uint64_t)idx);
- child_sp->SetName(ConstString(idx_name.GetData()));
+ child_sp->SetName(ConstString(idx_name.GetString()));
child_sp->SetFormat(m_item_format);
OpenPOWER on IntegriCloud