summaryrefslogtreecommitdiffstats
path: root/lldb/source/DataFormatters
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/DataFormatters')
-rw-r--r--lldb/source/DataFormatters/DataVisualization.cpp2
-rw-r--r--lldb/source/DataFormatters/FormatManager.cpp12
-rw-r--r--lldb/source/DataFormatters/FormattersHelpers.cpp2
-rw-r--r--lldb/source/DataFormatters/StringPrinter.cpp8
-rw-r--r--lldb/source/DataFormatters/TypeFormat.cpp2
-rw-r--r--lldb/source/DataFormatters/TypeSynthetic.cpp18
-rw-r--r--lldb/source/DataFormatters/ValueObjectPrinter.cpp7
7 files changed, 26 insertions, 25 deletions
diff --git a/lldb/source/DataFormatters/DataVisualization.cpp b/lldb/source/DataFormatters/DataVisualization.cpp
index 948aa71b8ac..08b3b34447b 100644
--- a/lldb/source/DataFormatters/DataVisualization.cpp
+++ b/lldb/source/DataFormatters/DataVisualization.cpp
@@ -89,7 +89,7 @@ bool DataVisualization::Categories::GetCategory(ConstString category,
lldb::TypeCategoryImplSP &entry,
bool allow_create) {
entry = GetFormatManager().GetCategory(category, allow_create);
- return (entry.get() != NULL);
+ return (entry.get() != nullptr);
}
bool DataVisualization::Categories::GetCategory(
diff --git a/lldb/source/DataFormatters/FormatManager.cpp b/lldb/source/DataFormatters/FormatManager.cpp
index 40d6407eade..dd2808a7cf7 100644
--- a/lldb/source/DataFormatters/FormatManager.cpp
+++ b/lldb/source/DataFormatters/FormatManager.cpp
@@ -146,7 +146,7 @@ char FormatManager::GetFormatAsFormatChar(lldb::Format format) {
const char *FormatManager::GetFormatAsCString(Format format) {
if (format >= eFormatDefault && format < kNumFormats)
return g_format_infos[format].format_name;
- return NULL;
+ return nullptr;
}
void FormatManager::EnableAllCategories() {
@@ -297,7 +297,7 @@ FormatManager::GetFormatForType(lldb::TypeNameSpecifierImplSP type_sp) {
lldb::TypeFormatImplSP format_current_sp =
category_sp->GetFormatForType(type_sp);
if (format_current_sp &&
- (format_chosen_sp.get() == NULL ||
+ (format_chosen_sp.get() == nullptr ||
(prio_category > category_sp->GetEnabledPosition()))) {
prio_category = category_sp->GetEnabledPosition();
format_chosen_sp = format_current_sp;
@@ -321,7 +321,7 @@ FormatManager::GetSummaryForType(lldb::TypeNameSpecifierImplSP type_sp) {
lldb::TypeSummaryImplSP summary_current_sp =
category_sp->GetSummaryForType(type_sp);
if (summary_current_sp &&
- (summary_chosen_sp.get() == NULL ||
+ (summary_chosen_sp.get() == nullptr ||
(prio_category > category_sp->GetEnabledPosition()))) {
prio_category = category_sp->GetEnabledPosition();
summary_chosen_sp = summary_current_sp;
@@ -345,7 +345,7 @@ FormatManager::GetFilterForType(lldb::TypeNameSpecifierImplSP type_sp) {
lldb::TypeFilterImplSP filter_current_sp(
(TypeFilterImpl *)category_sp->GetFilterForType(type_sp).get());
if (filter_current_sp &&
- (filter_chosen_sp.get() == NULL ||
+ (filter_chosen_sp.get() == nullptr ||
(prio_category > category_sp->GetEnabledPosition()))) {
prio_category = category_sp->GetEnabledPosition();
filter_chosen_sp = filter_current_sp;
@@ -370,7 +370,7 @@ FormatManager::GetSyntheticForType(lldb::TypeNameSpecifierImplSP type_sp) {
(ScriptedSyntheticChildren *)category_sp->GetSyntheticForType(type_sp)
.get());
if (synth_current_sp &&
- (synth_chosen_sp.get() == NULL ||
+ (synth_chosen_sp.get() == nullptr ||
(prio_category > category_sp->GetEnabledPosition()))) {
prio_category = category_sp->GetEnabledPosition();
synth_chosen_sp = synth_current_sp;
@@ -394,7 +394,7 @@ FormatManager::GetValidatorForType(lldb::TypeNameSpecifierImplSP type_sp) {
lldb::TypeValidatorImplSP validator_current_sp(
category_sp->GetValidatorForType(type_sp).get());
if (validator_current_sp &&
- (validator_chosen_sp.get() == NULL ||
+ (validator_chosen_sp.get() == nullptr ||
(prio_category > category_sp->GetEnabledPosition()))) {
prio_category = category_sp->GetEnabledPosition();
validator_chosen_sp = validator_current_sp;
diff --git a/lldb/source/DataFormatters/FormattersHelpers.cpp b/lldb/source/DataFormatters/FormattersHelpers.cpp
index b2bd1ebdfed..8f007df03fa 100644
--- a/lldb/source/DataFormatters/FormattersHelpers.cpp
+++ b/lldb/source/DataFormatters/FormattersHelpers.cpp
@@ -123,7 +123,7 @@ size_t lldb_private::formatters::ExtractIndexFromString(const char *item_name) {
if (*item_name != '[')
return UINT32_MAX;
item_name++;
- char *endptr = NULL;
+ char *endptr = nullptr;
unsigned long int idx = ::strtoul(item_name, &endptr, 0);
if (idx == 0 && endptr == item_name)
return UINT32_MAX;
diff --git a/lldb/source/DataFormatters/StringPrinter.cpp b/lldb/source/DataFormatters/StringPrinter.cpp
index 4dfe0250c3b..27d649bfc37 100644
--- a/lldb/source/DataFormatters/StringPrinter.cpp
+++ b/lldb/source/DataFormatters/StringPrinter.cpp
@@ -271,7 +271,7 @@ static bool DumpUTFBufferToStream(
llvm::ConversionFlags),
const StringPrinter::ReadBufferAndDumpToStreamOptions &dump_options) {
Stream &stream(*dump_options.GetStream());
- if (dump_options.GetPrefixToken() != 0)
+ if (dump_options.GetPrefixToken() != nullptr)
stream.Printf("%s", dump_options.GetPrefixToken());
if (dump_options.GetQuote() != 0)
stream.Printf("%c", dump_options.GetQuote());
@@ -373,7 +373,7 @@ static bool DumpUTFBufferToStream(
}
if (dump_options.GetQuote() != 0)
stream.Printf("%c", dump_options.GetQuote());
- if (dump_options.GetSuffixToken() != 0)
+ if (dump_options.GetSuffixToken() != nullptr)
stream.Printf("%s", dump_options.GetSuffixToken());
if (dump_options.GetIsTruncated())
stream.Printf("...");
@@ -449,7 +449,7 @@ bool StringPrinter::ReadStringAndDumpToStream<
const char *prefix_token = options.GetPrefixToken();
char quote = options.GetQuote();
- if (prefix_token != 0)
+ if (prefix_token != nullptr)
options.GetStream()->Printf("%s%c", prefix_token, quote);
else if (quote != 0)
options.GetStream()->Printf("%c", quote);
@@ -497,7 +497,7 @@ bool StringPrinter::ReadStringAndDumpToStream<
const char *suffix_token = options.GetSuffixToken();
- if (suffix_token != 0)
+ if (suffix_token != nullptr)
options.GetStream()->Printf("%c%s", quote, suffix_token);
else if (quote != 0)
options.GetStream()->Printf("%c", quote);
diff --git a/lldb/source/DataFormatters/TypeFormat.cpp b/lldb/source/DataFormatters/TypeFormat.cpp
index 72008b24316..b526e9a744b 100644
--- a/lldb/source/DataFormatters/TypeFormat.cpp
+++ b/lldb/source/DataFormatters/TypeFormat.cpp
@@ -69,7 +69,7 @@ bool TypeFormatImpl_Format::FormatObject(ValueObject *valobj,
// default value logic
if (GetFormat() == eFormatCString) {
lldb_private::Flags type_flags(compiler_type.GetTypeInfo(
- NULL)); // disambiguate w.r.t. TypeFormatImpl::Flags
+ nullptr)); // disambiguate w.r.t. TypeFormatImpl::Flags
if (type_flags.Test(eTypeIsPointer) &&
!type_flags.Test(eTypeIsObjC)) {
// if we are dumping a pointer as a c-string, get the pointee data
diff --git a/lldb/source/DataFormatters/TypeSynthetic.cpp b/lldb/source/DataFormatters/TypeSynthetic.cpp
index c40aed1f792..23c80fc58d0 100644
--- a/lldb/source/DataFormatters/TypeSynthetic.cpp
+++ b/lldb/source/DataFormatters/TypeSynthetic.cpp
@@ -128,7 +128,7 @@ lldb::ValueObjectSP SyntheticChildrenFrontEnd::CreateValueObjectFromData(
ScriptedSyntheticChildren::FrontEnd::FrontEnd(std::string pclass,
ValueObject &backend)
: SyntheticChildrenFrontEnd(backend), m_python_class(pclass),
- m_wrapper_sp(), m_interpreter(NULL) {
+ m_wrapper_sp(), m_interpreter(nullptr) {
if (backend == LLDB_INVALID_UID)
return;
@@ -139,7 +139,7 @@ ScriptedSyntheticChildren::FrontEnd::FrontEnd(std::string pclass,
m_interpreter = target_sp->GetDebugger().GetScriptInterpreter();
- if (m_interpreter != NULL)
+ if (m_interpreter != nullptr)
m_wrapper_sp = m_interpreter->CreateSyntheticScriptedProvider(
m_python_class.c_str(), backend.GetSP());
}
@@ -159,26 +159,26 @@ bool ScriptedSyntheticChildren::FrontEnd::IsValid() {
}
size_t ScriptedSyntheticChildren::FrontEnd::CalculateNumChildren() {
- if (!m_wrapper_sp || m_interpreter == NULL)
+ if (!m_wrapper_sp || m_interpreter == nullptr)
return 0;
return m_interpreter->CalculateNumChildren(m_wrapper_sp, UINT32_MAX);
}
size_t ScriptedSyntheticChildren::FrontEnd::CalculateNumChildren(uint32_t max) {
- if (!m_wrapper_sp || m_interpreter == NULL)
+ if (!m_wrapper_sp || m_interpreter == nullptr)
return 0;
return m_interpreter->CalculateNumChildren(m_wrapper_sp, max);
}
bool ScriptedSyntheticChildren::FrontEnd::Update() {
- if (!m_wrapper_sp || m_interpreter == NULL)
+ if (!m_wrapper_sp || m_interpreter == nullptr)
return false;
return m_interpreter->UpdateSynthProviderInstance(m_wrapper_sp);
}
bool ScriptedSyntheticChildren::FrontEnd::MightHaveChildren() {
- if (!m_wrapper_sp || m_interpreter == NULL)
+ if (!m_wrapper_sp || m_interpreter == nullptr)
return false;
return m_interpreter->MightHaveChildrenSynthProviderInstance(m_wrapper_sp);
@@ -186,21 +186,21 @@ bool ScriptedSyntheticChildren::FrontEnd::MightHaveChildren() {
size_t ScriptedSyntheticChildren::FrontEnd::GetIndexOfChildWithName(
ConstString name) {
- if (!m_wrapper_sp || m_interpreter == NULL)
+ if (!m_wrapper_sp || m_interpreter == nullptr)
return UINT32_MAX;
return m_interpreter->GetIndexOfChildWithName(m_wrapper_sp,
name.GetCString());
}
lldb::ValueObjectSP ScriptedSyntheticChildren::FrontEnd::GetSyntheticValue() {
- if (!m_wrapper_sp || m_interpreter == NULL)
+ if (!m_wrapper_sp || m_interpreter == nullptr)
return nullptr;
return m_interpreter->GetSyntheticValue(m_wrapper_sp);
}
ConstString ScriptedSyntheticChildren::FrontEnd::GetSyntheticTypeName() {
- if (!m_wrapper_sp || m_interpreter == NULL)
+ if (!m_wrapper_sp || m_interpreter == nullptr)
return ConstString();
return m_interpreter->GetSyntheticTypeName(m_wrapper_sp);
diff --git a/lldb/source/DataFormatters/ValueObjectPrinter.cpp b/lldb/source/DataFormatters/ValueObjectPrinter.cpp
index 5fe7e20bac1..409cffed9b0 100644
--- a/lldb/source/DataFormatters/ValueObjectPrinter.cpp
+++ b/lldb/source/DataFormatters/ValueObjectPrinter.cpp
@@ -331,7 +331,7 @@ TypeSummaryImpl *ValueObjectPrinter::GetSummaryFormatter(bool null_if_omitted) {
: m_valobj->GetSummaryFormat().get();
if (m_options.m_omit_summary_depth > 0)
- entry = NULL;
+ entry = nullptr;
m_summary_formatter.first = entry;
m_summary_formatter.second = true;
}
@@ -415,8 +415,9 @@ bool ValueObjectPrinter::PrintValueAndSummaryIfNeeded(bool &value_printed,
// explicitly)
TypeSummaryImpl *entry = GetSummaryFormatter();
if (!IsNil() && !IsUninitialized() && !m_value.empty() &&
- (entry == NULL || (entry->DoesPrintValue(m_valobj) ||
- m_options.m_format != eFormatDefault) ||
+ (entry == nullptr ||
+ (entry->DoesPrintValue(m_valobj) ||
+ m_options.m_format != eFormatDefault) ||
m_summary.empty()) &&
!m_options.m_hide_value) {
if (m_options.m_hide_pointer_value &&
OpenPOWER on IntegriCloud