diff options
Diffstat (limited to 'lldb/source/API')
43 files changed, 227 insertions, 225 deletions
diff --git a/lldb/source/API/SBAddress.cpp b/lldb/source/API/SBAddress.cpp index cb67690544b..358cb400a76 100644 --- a/lldb/source/API/SBAddress.cpp +++ b/lldb/source/API/SBAddress.cpp @@ -83,7 +83,7 @@ bool SBAddress::IsValid() const { SBAddress::operator bool() const { LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBAddress, operator bool); - return m_opaque_up != NULL && m_opaque_up->IsValid(); + return m_opaque_up != nullptr && m_opaque_up->IsValid(); } void SBAddress::Clear() { @@ -186,7 +186,7 @@ Address *SBAddress::operator->() { return m_opaque_up.get(); } const Address *SBAddress::operator->() const { return m_opaque_up.get(); } Address &SBAddress::ref() { - if (m_opaque_up == NULL) + if (m_opaque_up == nullptr) m_opaque_up.reset(new Address()); return *m_opaque_up; } @@ -208,7 +208,7 @@ bool SBAddress::GetDescription(SBStream &description) { // case there isn't one already... Stream &strm = description.ref(); if (m_opaque_up->IsValid()) { - m_opaque_up->Dump(&strm, NULL, Address::DumpStyleResolvedDescription, + m_opaque_up->Dump(&strm, nullptr, Address::DumpStyleResolvedDescription, Address::DumpStyleModuleWithFileAddress, 4); StreamString sstrm; // m_opaque_up->Dump (&sstrm, NULL, diff --git a/lldb/source/API/SBBlock.cpp b/lldb/source/API/SBBlock.cpp index b8ca473894f..f333d1d7b5f 100644 --- a/lldb/source/API/SBBlock.cpp +++ b/lldb/source/API/SBBlock.cpp @@ -25,7 +25,7 @@ using namespace lldb; using namespace lldb_private; -SBBlock::SBBlock() : m_opaque_ptr(NULL) { +SBBlock::SBBlock() : m_opaque_ptr(nullptr) { LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBBlock); } @@ -44,7 +44,7 @@ const SBBlock &SBBlock::operator=(const SBBlock &rhs) { return LLDB_RECORD_RESULT(*this); } -SBBlock::~SBBlock() { m_opaque_ptr = NULL; } +SBBlock::~SBBlock() { m_opaque_ptr = nullptr; } bool SBBlock::IsValid() const { LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBBlock, IsValid); @@ -53,14 +53,14 @@ bool SBBlock::IsValid() const { SBBlock::operator bool() const { LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBBlock, operator bool); - return m_opaque_ptr != NULL; + return m_opaque_ptr != nullptr; } bool SBBlock::IsInlined() const { LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBBlock, IsInlined); if (m_opaque_ptr) - return m_opaque_ptr->GetInlinedFunctionInfo() != NULL; + return m_opaque_ptr->GetInlinedFunctionInfo() != nullptr; return false; } @@ -77,10 +77,10 @@ const char *SBBlock::GetInlinedName() const { language = function->GetLanguage(); else language = lldb::eLanguageTypeUnknown; - return inlined_info->GetName(language).AsCString(NULL); + return inlined_info->GetName(language).AsCString(nullptr); } } - return NULL; + return nullptr; } SBFileSpec SBBlock::GetInlinedCallSiteFile() const { diff --git a/lldb/source/API/SBBreakpointLocation.cpp b/lldb/source/API/SBBreakpointLocation.cpp index 56068750709..640545f55ef 100644 --- a/lldb/source/API/SBBreakpointLocation.cpp +++ b/lldb/source/API/SBBreakpointLocation.cpp @@ -179,7 +179,7 @@ const char *SBBreakpointLocation::GetCondition() { loc_sp->GetTarget().GetAPIMutex()); return loc_sp->GetConditionText(); } - return NULL; + return nullptr; } void SBBreakpointLocation::SetAutoContinue(bool auto_continue) { @@ -357,7 +357,7 @@ const char *SBBreakpointLocation::GetThreadName() const { loc_sp->GetTarget().GetAPIMutex()); return loc_sp->GetThreadName(); } - return NULL; + return nullptr; } void SBBreakpointLocation::SetQueueName(const char *queue_name) { @@ -382,7 +382,7 @@ const char *SBBreakpointLocation::GetQueueName() const { loc_sp->GetTarget().GetAPIMutex()); loc_sp->GetQueueName(); } - return NULL; + return nullptr; } bool SBBreakpointLocation::IsResolved() { diff --git a/lldb/source/API/SBBroadcaster.cpp b/lldb/source/API/SBBroadcaster.cpp index 4119fb2c134..e1efdf7baf6 100644 --- a/lldb/source/API/SBBroadcaster.cpp +++ b/lldb/source/API/SBBroadcaster.cpp @@ -16,20 +16,19 @@ using namespace lldb; using namespace lldb_private; -SBBroadcaster::SBBroadcaster() : m_opaque_sp(), m_opaque_ptr(NULL) { +SBBroadcaster::SBBroadcaster() : m_opaque_sp(), m_opaque_ptr(nullptr) { LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBBroadcaster); } SBBroadcaster::SBBroadcaster(const char *name) - : m_opaque_sp(new Broadcaster(NULL, name)), m_opaque_ptr(NULL) { + : m_opaque_sp(new Broadcaster(nullptr, name)), m_opaque_ptr(nullptr) { LLDB_RECORD_CONSTRUCTOR(SBBroadcaster, (const char *), name); m_opaque_ptr = m_opaque_sp.get(); } SBBroadcaster::SBBroadcaster(lldb_private::Broadcaster *broadcaster, bool owns) - : m_opaque_sp(owns ? broadcaster : NULL), m_opaque_ptr(broadcaster) { -} + : m_opaque_sp(owns ? broadcaster : nullptr), m_opaque_ptr(broadcaster) {} SBBroadcaster::SBBroadcaster(const SBBroadcaster &rhs) : m_opaque_sp(rhs.m_opaque_sp), m_opaque_ptr(rhs.m_opaque_ptr) { @@ -48,13 +47,13 @@ const SBBroadcaster &SBBroadcaster::operator=(const SBBroadcaster &rhs) { return LLDB_RECORD_RESULT(*this); } -SBBroadcaster::~SBBroadcaster() { reset(NULL, false); } +SBBroadcaster::~SBBroadcaster() { reset(nullptr, false); } void SBBroadcaster::BroadcastEventByType(uint32_t event_type, bool unique) { LLDB_RECORD_METHOD(void, SBBroadcaster, BroadcastEventByType, (uint32_t, bool), event_type, unique); - if (m_opaque_ptr == NULL) + if (m_opaque_ptr == nullptr) return; if (unique) @@ -67,7 +66,7 @@ void SBBroadcaster::BroadcastEvent(const SBEvent &event, bool unique) { LLDB_RECORD_METHOD(void, SBBroadcaster, BroadcastEvent, (const lldb::SBEvent &, bool), event, unique); - if (m_opaque_ptr == NULL) + if (m_opaque_ptr == nullptr) return; EventSP event_sp = event.GetSP(); @@ -104,7 +103,7 @@ const char *SBBroadcaster::GetName() const { if (m_opaque_ptr) return m_opaque_ptr->GetBroadcasterName().GetCString(); - return NULL; + return nullptr; } bool SBBroadcaster::EventTypeHasListeners(uint32_t event_type) { @@ -144,14 +143,14 @@ bool SBBroadcaster::IsValid() const { SBBroadcaster::operator bool() const { LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBBroadcaster, operator bool); - return m_opaque_ptr != NULL; + return m_opaque_ptr != nullptr; } void SBBroadcaster::Clear() { LLDB_RECORD_METHOD_NO_ARGS(void, SBBroadcaster, Clear); m_opaque_sp.reset(); - m_opaque_ptr = NULL; + m_opaque_ptr = nullptr; } bool SBBroadcaster::operator==(const SBBroadcaster &rhs) const { diff --git a/lldb/source/API/SBCommunication.cpp b/lldb/source/API/SBCommunication.cpp index 21bcde12cb3..90df70bde72 100644 --- a/lldb/source/API/SBCommunication.cpp +++ b/lldb/source/API/SBCommunication.cpp @@ -16,7 +16,7 @@ using namespace lldb; using namespace lldb_private; -SBCommunication::SBCommunication() : m_opaque(NULL), m_opaque_owned(false) { +SBCommunication::SBCommunication() : m_opaque(nullptr), m_opaque_owned(false) { LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBCommunication); } @@ -28,7 +28,7 @@ SBCommunication::SBCommunication(const char *broadcaster_name) SBCommunication::~SBCommunication() { if (m_opaque && m_opaque_owned) delete m_opaque; - m_opaque = NULL; + m_opaque = nullptr; m_opaque_owned = false; } @@ -39,7 +39,7 @@ bool SBCommunication::IsValid() const { SBCommunication::operator bool() const { LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBCommunication, operator bool); - return m_opaque != NULL; + return m_opaque != nullptr; } bool SBCommunication::GetCloseOnEOF() { @@ -64,7 +64,7 @@ ConnectionStatus SBCommunication::Connect(const char *url) { if (m_opaque) { if (!m_opaque->HasConnection()) m_opaque->SetConnection(Host::CreateDefaultConnection(url).release()); - return m_opaque->Connect(url, NULL); + return m_opaque->Connect(url, nullptr); } return eConnectionStatusNoConnection; } @@ -115,7 +115,7 @@ size_t SBCommunication::Read(void *dst, size_t dst_len, uint32_t timeout_usec, ? Timeout<std::micro>(llvm::None) : std::chrono::microseconds(timeout_usec); if (m_opaque) - bytes_read = m_opaque->Read(dst, dst_len, timeout, status, NULL); + bytes_read = m_opaque->Read(dst, dst_len, timeout, status, nullptr); else status = eConnectionStatusNoConnection; @@ -130,7 +130,7 @@ size_t SBCommunication::Write(const void *src, size_t src_len, size_t bytes_written = 0; if (m_opaque) - bytes_written = m_opaque->Write(src, src_len, status, NULL); + bytes_written = m_opaque->Write(src, src_len, status, nullptr); else status = eConnectionStatusNoConnection; diff --git a/lldb/source/API/SBCompileUnit.cpp b/lldb/source/API/SBCompileUnit.cpp index b5bac6bf7d1..48b501043e1 100644 --- a/lldb/source/API/SBCompileUnit.cpp +++ b/lldb/source/API/SBCompileUnit.cpp @@ -20,7 +20,7 @@ using namespace lldb; using namespace lldb_private; -SBCompileUnit::SBCompileUnit() : m_opaque_ptr(NULL) { +SBCompileUnit::SBCompileUnit() : m_opaque_ptr(nullptr) { LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBCompileUnit); } @@ -41,7 +41,7 @@ const SBCompileUnit &SBCompileUnit::operator=(const SBCompileUnit &rhs) { return LLDB_RECORD_RESULT(*this); } -SBCompileUnit::~SBCompileUnit() { m_opaque_ptr = NULL; } +SBCompileUnit::~SBCompileUnit() { m_opaque_ptr = nullptr; } SBFileSpec SBCompileUnit::GetFileSpec() const { LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::SBFileSpec, SBCompileUnit, @@ -108,8 +108,8 @@ uint32_t SBCompileUnit::FindLineEntryIndex(uint32_t start_idx, uint32_t line, file_spec = *m_opaque_ptr; index = m_opaque_ptr->FindLineEntry( - start_idx, line, inline_file_spec ? inline_file_spec->get() : NULL, - exact, NULL); + start_idx, line, inline_file_spec ? inline_file_spec->get() : nullptr, + exact, nullptr); } return index; @@ -193,7 +193,7 @@ bool SBCompileUnit::IsValid() const { SBCompileUnit::operator bool() const { LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBCompileUnit, operator bool); - return m_opaque_ptr != NULL; + return m_opaque_ptr != nullptr; } bool SBCompileUnit::operator==(const SBCompileUnit &rhs) const { diff --git a/lldb/source/API/SBData.cpp b/lldb/source/API/SBData.cpp index d9e54d54a18..528cd8d43ec 100644 --- a/lldb/source/API/SBData.cpp +++ b/lldb/source/API/SBData.cpp @@ -64,7 +64,7 @@ bool SBData::IsValid() { SBData::operator bool() const { LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBData, operator bool); - return m_opaque_sp.get() != NULL; + return m_opaque_sp.get() != nullptr; } uint8_t SBData::GetAddressByteSize() { @@ -312,13 +312,13 @@ const char *SBData::GetString(lldb::SBError &error, lldb::offset_t offset) { LLDB_RECORD_METHOD(const char *, SBData, GetString, (lldb::SBError &, lldb::offset_t), error, offset); - const char *value = 0; + const char *value = nullptr; if (!m_opaque_sp.get()) { error.SetErrorString("no value to read from"); } else { uint32_t old_offset = offset; value = m_opaque_sp->GetCStr(&offset); - if (offset == old_offset || (value == NULL)) + if (offset == old_offset || (value == nullptr)) error.SetErrorString("unable to read data"); } return value; @@ -346,13 +346,13 @@ size_t SBData::ReadRawData(lldb::SBError &error, lldb::offset_t offset, (lldb::SBError &, lldb::offset_t, void *, size_t), error, offset, buf, size); - void *ok = NULL; + void *ok = nullptr; if (!m_opaque_sp.get()) { error.SetErrorString("no value to read from"); } else { uint32_t old_offset = offset; ok = m_opaque_sp->GetU8(&offset, buf, size); - if ((offset == old_offset) || (ok == NULL)) + if ((offset == old_offset) || (ok == nullptr)) error.SetErrorString("unable to read data"); } return ok ? size : 0; diff --git a/lldb/source/API/SBDeclaration.cpp b/lldb/source/API/SBDeclaration.cpp index f14ca3993f4..a7790b29398 100644 --- a/lldb/source/API/SBDeclaration.cpp +++ b/lldb/source/API/SBDeclaration.cpp @@ -147,7 +147,7 @@ const lldb_private::Declaration *SBDeclaration::operator->() const { } lldb_private::Declaration &SBDeclaration::ref() { - if (m_opaque_up == NULL) + if (m_opaque_up == nullptr) m_opaque_up.reset(new lldb_private::Declaration()); return *m_opaque_up; } diff --git a/lldb/source/API/SBError.cpp b/lldb/source/API/SBError.cpp index c4627898282..7256e8e55de 100644 --- a/lldb/source/API/SBError.cpp +++ b/lldb/source/API/SBError.cpp @@ -41,7 +41,7 @@ const char *SBError::GetCString() const { if (m_opaque_up) return m_opaque_up->AsCString(); - return NULL; + return nullptr; } void SBError::Clear() { @@ -144,11 +144,11 @@ bool SBError::IsValid() const { SBError::operator bool() const { LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBError, operator bool); - return m_opaque_up != NULL; + return m_opaque_up != nullptr; } void SBError::CreateIfNeeded() { - if (m_opaque_up == NULL) + if (m_opaque_up == nullptr) m_opaque_up.reset(new Status()); } @@ -175,7 +175,8 @@ bool SBError::GetDescription(SBStream &description) { description.Printf("success"); else { const char *err_string = GetCString(); - description.Printf("error: %s", (err_string != NULL ? err_string : "")); + description.Printf("error: %s", + (err_string != nullptr ? err_string : "")); } } else description.Printf("error: <NULL>"); diff --git a/lldb/source/API/SBEvent.cpp b/lldb/source/API/SBEvent.cpp index b63108ec1fc..75ca2830df9 100644 --- a/lldb/source/API/SBEvent.cpp +++ b/lldb/source/API/SBEvent.cpp @@ -22,7 +22,7 @@ using namespace lldb; using namespace lldb_private; -SBEvent::SBEvent() : m_event_sp(), m_opaque_ptr(NULL) { +SBEvent::SBEvent() : m_event_sp(), m_opaque_ptr(nullptr) { LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBEvent); } @@ -69,7 +69,7 @@ const char *SBEvent::GetDataFlavor() { if (event_data) return lldb_event->GetData()->GetFlavor().AsCString(); } - return NULL; + return nullptr; } uint32_t SBEvent::GetType() const { @@ -168,7 +168,7 @@ SBEvent::operator bool() const { // Do NOT use m_opaque_ptr directly!!! Must use the SBEvent::get() accessor. // See comments in SBEvent::get().... - return SBEvent::get() != NULL; + return SBEvent::get() != nullptr; } const char *SBEvent::GetCStringFromEvent(const SBEvent &event) { diff --git a/lldb/source/API/SBFunction.cpp b/lldb/source/API/SBFunction.cpp index 35ddb1c7cd6..1770bede2f4 100644 --- a/lldb/source/API/SBFunction.cpp +++ b/lldb/source/API/SBFunction.cpp @@ -22,7 +22,7 @@ using namespace lldb; using namespace lldb_private; -SBFunction::SBFunction() : m_opaque_ptr(NULL) { +SBFunction::SBFunction() : m_opaque_ptr(nullptr) { LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBFunction); } @@ -42,7 +42,7 @@ const SBFunction &SBFunction::operator=(const SBFunction &rhs) { return LLDB_RECORD_RESULT(*this); } -SBFunction::~SBFunction() { m_opaque_ptr = NULL; } +SBFunction::~SBFunction() { m_opaque_ptr = nullptr; } bool SBFunction::IsValid() const { LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBFunction, IsValid); @@ -51,13 +51,13 @@ bool SBFunction::IsValid() const { SBFunction::operator bool() const { LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBFunction, operator bool); - return m_opaque_ptr != NULL; + return m_opaque_ptr != nullptr; } const char *SBFunction::GetName() const { LLDB_RECORD_METHOD_CONST_NO_ARGS(const char *, SBFunction, GetName); - const char *cstr = NULL; + const char *cstr = nullptr; if (m_opaque_ptr) cstr = m_opaque_ptr->GetName().AsCString(); @@ -67,7 +67,7 @@ const char *SBFunction::GetName() const { const char *SBFunction::GetDisplayName() const { LLDB_RECORD_METHOD_CONST_NO_ARGS(const char *, SBFunction, GetDisplayName); - const char *cstr = NULL; + const char *cstr = nullptr; if (m_opaque_ptr) cstr = m_opaque_ptr->GetMangled() .GetDisplayDemangledName(m_opaque_ptr->GetLanguage()) @@ -79,7 +79,7 @@ const char *SBFunction::GetDisplayName() const { const char *SBFunction::GetMangledName() const { LLDB_RECORD_METHOD_CONST_NO_ARGS(const char *, SBFunction, GetMangledName); - const char *cstr = NULL; + const char *cstr = nullptr; if (m_opaque_ptr) cstr = m_opaque_ptr->GetMangled().GetMangledName().AsCString(); return cstr; @@ -118,7 +118,7 @@ SBInstructionList SBFunction::GetInstructions(SBTarget target) { LLDB_RECORD_METHOD(lldb::SBInstructionList, SBFunction, GetInstructions, (lldb::SBTarget), target); - return LLDB_RECORD_RESULT(GetInstructions(target, NULL)); + return LLDB_RECORD_RESULT(GetInstructions(target, nullptr)); } SBInstructionList SBFunction::GetInstructions(SBTarget target, @@ -141,7 +141,7 @@ SBInstructionList SBFunction::GetInstructions(SBTarget target, if (module_sp) { const bool prefer_file_cache = false; sb_instructions.SetDisassembler(Disassembler::DisassembleRange( - module_sp->GetArchitecture(), NULL, flavor, exe_ctx, + module_sp->GetArchitecture(), nullptr, flavor, exe_ctx, m_opaque_ptr->GetAddressRange(), prefer_file_cache)); } } diff --git a/lldb/source/API/SBHostOS.cpp b/lldb/source/API/SBHostOS.cpp index b8aa94d97a1..b5464c4e7df 100644 --- a/lldb/source/API/SBHostOS.cpp +++ b/lldb/source/API/SBHostOS.cpp @@ -107,8 +107,9 @@ lldb::thread_t SBHostOS::ThreadCreate(const char *name, LLDB_RECORD_DUMMY(lldb::thread_t, SBHostOS, ThreadCreate, (lldb::thread_func_t, void *, SBError *), name, thread_function, thread_arg, error_ptr); - HostThread thread(ThreadLauncher::LaunchThread( - name, thread_function, thread_arg, error_ptr ? error_ptr->get() : NULL)); + HostThread thread( + ThreadLauncher::LaunchThread(name, thread_function, thread_arg, + error_ptr ? error_ptr->get() : nullptr)); return thread.Release(); } diff --git a/lldb/source/API/SBInstruction.cpp b/lldb/source/API/SBInstruction.cpp index 8502aad9dbb..fcf66fd2582 100644 --- a/lldb/source/API/SBInstruction.cpp +++ b/lldb/source/API/SBInstruction.cpp @@ -127,7 +127,7 @@ const char *SBInstruction::GetMnemonic(SBTarget target) { } return inst_sp->GetMnemonic(&exe_ctx); } - return NULL; + return nullptr; } const char *SBInstruction::GetOperands(SBTarget target) { @@ -147,7 +147,7 @@ const char *SBInstruction::GetOperands(SBTarget target) { } return inst_sp->GetOperands(&exe_ctx); } - return NULL; + return nullptr; } const char *SBInstruction::GetComment(SBTarget target) { @@ -167,7 +167,7 @@ const char *SBInstruction::GetComment(SBTarget target) { } return inst_sp->GetComment(&exe_ctx); } - return NULL; + return nullptr; } size_t SBInstruction::GetByteSize() { @@ -249,7 +249,7 @@ bool SBInstruction::GetDescription(lldb::SBStream &s) { // didn't have a stream already created, one will get created... FormatEntity::Entry format; FormatEntity::Parse("${addr}: ", format); - inst_sp->Dump(&s.ref(), 0, true, false, NULL, &sc, NULL, &format, 0); + inst_sp->Dump(&s.ref(), 0, true, false, nullptr, &sc, nullptr, &format, 0); return true; } return false; @@ -258,7 +258,7 @@ bool SBInstruction::GetDescription(lldb::SBStream &s) { void SBInstruction::Print(FILE *out) { LLDB_RECORD_METHOD(void, SBInstruction, Print, (FILE *), out); - if (out == NULL) + if (out == nullptr) return; lldb::InstructionSP inst_sp(GetOpaque()); @@ -272,7 +272,8 @@ void SBInstruction::Print(FILE *out) { StreamFile out_stream(out, false); FormatEntity::Entry format; FormatEntity::Parse("${addr}: ", format); - inst_sp->Dump(&out_stream, 0, true, false, NULL, &sc, NULL, &format, 0); + inst_sp->Dump(&out_stream, 0, true, false, nullptr, &sc, nullptr, &format, + 0); } } diff --git a/lldb/source/API/SBInstructionList.cpp b/lldb/source/API/SBInstructionList.cpp index 390ad475061..cce923bf04a 100644 --- a/lldb/source/API/SBInstructionList.cpp +++ b/lldb/source/API/SBInstructionList.cpp @@ -49,7 +49,7 @@ bool SBInstructionList::IsValid() const { SBInstructionList::operator bool() const { LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBInstructionList, operator bool); - return m_opaque_sp.get() != NULL; + return m_opaque_sp.get() != nullptr; } size_t SBInstructionList::GetSize() { @@ -119,7 +119,7 @@ void SBInstructionList::SetDisassembler(const lldb::DisassemblerSP &opaque_sp) { void SBInstructionList::Print(FILE *out) { LLDB_RECORD_METHOD(void, SBInstructionList, Print, (FILE *), out); - if (out == NULL) + if (out == nullptr) return; } @@ -142,7 +142,7 @@ bool SBInstructionList::GetDescription(lldb::SBStream &description) { for (size_t i = 0; i < num_instructions; ++i) { Instruction *inst = m_opaque_sp->GetInstructionList().GetInstructionAtIndex(i).get(); - if (inst == NULL) + if (inst == nullptr) break; const Address &addr = inst->GetAddress(); @@ -153,7 +153,7 @@ bool SBInstructionList::GetDescription(lldb::SBStream &description) { addr, eSymbolContextEverything, sc); } - inst->Dump(&sref, max_opcode_byte_size, true, false, NULL, &sc, + inst->Dump(&sref, max_opcode_byte_size, true, false, nullptr, &sc, &prev_sc, &format, 0); sref.EOL(); } diff --git a/lldb/source/API/SBLineEntry.cpp b/lldb/source/API/SBLineEntry.cpp index b7aac0be935..010a6057cd3 100644 --- a/lldb/source/API/SBLineEntry.cpp +++ b/lldb/source/API/SBLineEntry.cpp @@ -162,7 +162,7 @@ const lldb_private::LineEntry *SBLineEntry::operator->() const { } lldb_private::LineEntry &SBLineEntry::ref() { - if (m_opaque_up == NULL) + if (m_opaque_up == nullptr) m_opaque_up.reset(new lldb_private::LineEntry()); return *m_opaque_up; } diff --git a/lldb/source/API/SBListener.cpp b/lldb/source/API/SBListener.cpp index 5eb5abd8028..4fe90f6f686 100644 --- a/lldb/source/API/SBListener.cpp +++ b/lldb/source/API/SBListener.cpp @@ -20,7 +20,7 @@ using namespace lldb; using namespace lldb_private; -SBListener::SBListener() : m_opaque_sp(), m_unused_ptr(NULL) { +SBListener::SBListener() : m_opaque_sp(), m_unused_ptr(nullptr) { LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBListener); } @@ -160,7 +160,7 @@ bool SBListener::WaitForEvent(uint32_t timeout_secs, SBEvent &event) { } if (!success) - event.reset(NULL); + event.reset(nullptr); return success; } @@ -182,7 +182,7 @@ bool SBListener::WaitForEventForBroadcaster(uint32_t num_seconds, return true; } } - event.reset(NULL); + event.reset(nullptr); return false; } @@ -205,7 +205,7 @@ bool SBListener::WaitForEventForBroadcasterWithType( return true; } } - event.reset(NULL); + event.reset(nullptr); return false; } @@ -217,7 +217,7 @@ bool SBListener::PeekAtNextEvent(SBEvent &event) { event.reset(m_opaque_sp->PeekAtNextEvent()); return event.IsValid(); } - event.reset(NULL); + event.reset(nullptr); return false; } @@ -231,7 +231,7 @@ bool SBListener::PeekAtNextEventForBroadcaster(const SBBroadcaster &broadcaster, event.reset(m_opaque_sp->PeekAtNextEventForBroadcaster(broadcaster.get())); return event.IsValid(); } - event.reset(NULL); + event.reset(nullptr); return false; } @@ -247,7 +247,7 @@ bool SBListener::PeekAtNextEventForBroadcasterWithType( broadcaster.get(), event_type_mask)); return event.IsValid(); } - event.reset(NULL); + event.reset(nullptr); return false; } @@ -261,7 +261,7 @@ bool SBListener::GetNextEvent(SBEvent &event) { return true; } } - event.reset(NULL); + event.reset(nullptr); return false; } @@ -279,7 +279,7 @@ bool SBListener::GetNextEventForBroadcaster(const SBBroadcaster &broadcaster, return true; } } - event.reset(NULL); + event.reset(nullptr); return false; } @@ -299,7 +299,7 @@ bool SBListener::GetNextEventForBroadcasterWithType( return true; } } - event.reset(NULL); + event.reset(nullptr); return false; } diff --git a/lldb/source/API/SBModule.cpp b/lldb/source/API/SBModule.cpp index a22d7ca2989..4bd32bce1c5 100644 --- a/lldb/source/API/SBModule.cpp +++ b/lldb/source/API/SBModule.cpp @@ -40,8 +40,8 @@ SBModule::SBModule(const SBModuleSpec &module_spec) : m_opaque_sp() { LLDB_RECORD_CONSTRUCTOR(SBModule, (const lldb::SBModuleSpec &), module_spec); ModuleSP module_sp; - Status error = ModuleList::GetSharedModule(*module_spec.m_opaque_up, - module_sp, NULL, NULL, NULL); + Status error = ModuleList::GetSharedModule( + *module_spec.m_opaque_up, module_sp, nullptr, nullptr, nullptr); if (module_sp) SetSP(module_sp); } @@ -85,7 +85,7 @@ bool SBModule::IsValid() const { SBModule::operator bool() const { LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBModule, operator bool); - return m_opaque_sp.get() != NULL; + return m_opaque_sp.get() != nullptr; } void SBModule::Clear() { @@ -159,7 +159,7 @@ bool SBModule::SetRemoteInstallFileSpec(lldb::SBFileSpec &file) { const uint8_t *SBModule::GetUUIDBytes() const { LLDB_RECORD_METHOD_CONST_NO_ARGS(const uint8_t *, SBModule, GetUUIDBytes); - const uint8_t *uuid_bytes = NULL; + const uint8_t *uuid_bytes = nullptr; ModuleSP module_sp(GetSP()); if (module_sp) uuid_bytes = module_sp->GetUUID().GetBytes().data(); @@ -170,8 +170,7 @@ const uint8_t *SBModule::GetUUIDBytes() const { const char *SBModule::GetUUIDString() const { LLDB_RECORD_METHOD_CONST_NO_ARGS(const char *, SBModule, GetUUIDString); - - const char *uuid_cstr = NULL; + const char *uuid_cstr = nullptr; ModuleSP module_sp(GetSP()); if (module_sp) { // We are going to return a "const char *" value through the public API, so @@ -185,7 +184,7 @@ const char *SBModule::GetUUIDString() const { return uuid_cstr; } - return NULL; + return nullptr; } bool SBModule::operator==(const SBModule &rhs) const { @@ -296,7 +295,7 @@ static Symtab *GetUnifiedSymbolTable(const lldb::ModuleSP &module_sp) { if (symbols) return symbols->GetSymtab(); } - return NULL; + return nullptr; } size_t SBModule::GetNumSymbols() { @@ -410,7 +409,7 @@ lldb::SBSymbolContextList SBModule::FindFunctions(const char *name, const bool symbols_ok = true; const bool inlines_ok = true; FunctionNameType type = static_cast<FunctionNameType>(name_type_mask); - module_sp->FindFunctions(ConstString(name), NULL, type, symbols_ok, + module_sp->FindFunctions(ConstString(name), nullptr, type, symbols_ok, inlines_ok, append, *sb_sc_list); } return LLDB_RECORD_RESULT(sb_sc_list); @@ -427,7 +426,7 @@ SBValueList SBModule::FindGlobalVariables(SBTarget &target, const char *name, if (name && module_sp) { VariableList variable_list; const uint32_t match_count = module_sp->FindGlobalVariables( - ConstString(name), NULL, max_matches, variable_list); + ConstString(name), nullptr, max_matches, variable_list); if (match_count > 0) { for (uint32_t i = 0; i < match_count; ++i) { @@ -558,7 +557,7 @@ lldb::SBTypeList SBModule::GetTypes(uint32_t type_mask) { TypeClass type_class = static_cast<TypeClass>(type_mask); TypeList type_list; - vendor->GetTypes(NULL, type_class, type_list); + vendor->GetTypes(nullptr, type_class, type_list); sb_type_list.m_opaque_up->Append(type_list); return LLDB_RECORD_RESULT(sb_type_list); } @@ -606,7 +605,7 @@ const char *SBModule::GetTriple() { ConstString const_triple(triple.c_str()); return const_triple.GetCString(); } - return NULL; + return nullptr; } uint32_t SBModule::GetAddressByteSize() { diff --git a/lldb/source/API/SBPlatform.cpp b/lldb/source/API/SBPlatform.cpp index 235c37a8101..f3708d8e084 100644 --- a/lldb/source/API/SBPlatform.cpp +++ b/lldb/source/API/SBPlatform.cpp @@ -28,7 +28,7 @@ using namespace lldb_private; // PlatformConnectOptions struct PlatformConnectOptions { - PlatformConnectOptions(const char *url = NULL) + PlatformConnectOptions(const char *url = nullptr) : m_url(), m_rsync_options(), m_rsync_remote_path_prefix(), m_rsync_enabled(false), m_rsync_omit_hostname_from_remote_path(false), m_local_cache_directory() { @@ -48,7 +48,7 @@ struct PlatformConnectOptions { // PlatformShellCommand struct PlatformShellCommand { - PlatformShellCommand(const char *shell_command = NULL) + PlatformShellCommand(const char *shell_command = nullptr) : m_command(), m_working_dir(), m_status(0), m_signo(0) { if (shell_command && shell_command[0]) m_command = shell_command; @@ -94,7 +94,7 @@ const char *SBPlatformConnectOptions::GetURL() { LLDB_RECORD_METHOD_NO_ARGS(const char *, SBPlatformConnectOptions, GetURL); if (m_opaque_ptr->m_url.empty()) - return NULL; + return nullptr; return m_opaque_ptr->m_url.c_str(); } @@ -188,7 +188,7 @@ const char *SBPlatformShellCommand::GetCommand() { LLDB_RECORD_METHOD_NO_ARGS(const char *, SBPlatformShellCommand, GetCommand); if (m_opaque_ptr->m_command.empty()) - return NULL; + return nullptr; return m_opaque_ptr->m_command.c_str(); } @@ -207,7 +207,7 @@ const char *SBPlatformShellCommand::GetWorkingDirectory() { GetWorkingDirectory); if (m_opaque_ptr->m_working_dir.empty()) - return NULL; + return nullptr; return m_opaque_ptr->m_working_dir.c_str(); } @@ -256,7 +256,7 @@ const char *SBPlatformShellCommand::GetOutput() { LLDB_RECORD_METHOD_NO_ARGS(const char *, SBPlatformShellCommand, GetOutput); if (m_opaque_ptr->m_output.empty()) - return NULL; + return nullptr; return m_opaque_ptr->m_output.c_str(); } @@ -282,7 +282,7 @@ bool SBPlatform::IsValid() const { SBPlatform::operator bool() const { LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBPlatform, operator bool); - return m_opaque_sp.get() != NULL; + return m_opaque_sp.get() != nullptr; } void SBPlatform::Clear() { @@ -297,7 +297,7 @@ const char *SBPlatform::GetName() { PlatformSP platform_sp(GetSP()); if (platform_sp) return platform_sp->GetName().GetCString(); - return NULL; + return nullptr; } lldb::PlatformSP SBPlatform::GetSP() const { return m_opaque_sp; } @@ -312,7 +312,7 @@ const char *SBPlatform::GetWorkingDirectory() { PlatformSP platform_sp(GetSP()); if (platform_sp) return platform_sp->GetWorkingDirectory().GetCString(); - return NULL; + return nullptr; } bool SBPlatform::SetWorkingDirectory(const char *path) { @@ -376,7 +376,7 @@ const char *SBPlatform::GetTriple() { return ConstString(arch.GetTriple().getTriple().c_str()).GetCString(); } } - return NULL; + return nullptr; } const char *SBPlatform::GetOSBuild() { @@ -393,7 +393,7 @@ const char *SBPlatform::GetOSBuild() { } } } - return NULL; + return nullptr; } const char *SBPlatform::GetOSDescription() { @@ -410,7 +410,7 @@ const char *SBPlatform::GetOSDescription() { } } } - return NULL; + return nullptr; } const char *SBPlatform::GetHostname() { @@ -419,7 +419,7 @@ const char *SBPlatform::GetHostname() { PlatformSP platform_sp(GetSP()); if (platform_sp) return platform_sp->GetHostname(); - return NULL; + return nullptr; } uint32_t SBPlatform::GetOSMajorVersion() { @@ -513,7 +513,7 @@ SBError SBPlatform::Run(SBPlatformShellCommand &shell_command) { return Status("invalid shell command (empty)"); const char *working_dir = shell_command.GetWorkingDirectory(); - if (working_dir == NULL) { + if (working_dir == nullptr) { working_dir = platform_sp->GetWorkingDirectory().GetCString(); if (working_dir) shell_command.SetWorkingDirectory(working_dir); diff --git a/lldb/source/API/SBProcess.cpp b/lldb/source/API/SBProcess.cpp index d97494b38c7..4226ff77ecd 100644 --- a/lldb/source/API/SBProcess.cpp +++ b/lldb/source/API/SBProcess.cpp @@ -335,7 +335,7 @@ void SBProcess::ReportEventState(const SBEvent &event, FILE *out) const { LLDB_RECORD_METHOD_CONST(void, SBProcess, ReportEventState, (const lldb::SBEvent &, FILE *), event, out); - if (out == NULL) + if (out == nullptr) return; ProcessSP process_sp(GetSP()); @@ -534,7 +534,7 @@ int SBProcess::GetExitStatus() { const char *SBProcess::GetExitDescription() { LLDB_RECORD_METHOD_NO_ARGS(const char *, SBProcess, GetExitDescription); - const char *exit_desc = NULL; + const char *exit_desc = nullptr; ProcessSP process_sp(GetSP()); if (process_sp) { std::lock_guard<std::recursive_mutex> guard( @@ -602,7 +602,7 @@ SBError SBProcess::Continue() { if (process_sp->GetTarget().GetDebugger().GetAsyncExecution()) sb_error.ref() = process_sp->Resume(); else - sb_error.ref() = process_sp->ResumeSynchronous(NULL); + sb_error.ref() = process_sp->ResumeSynchronous(nullptr); } else sb_error.SetErrorString("SBProcess is invalid"); @@ -985,7 +985,7 @@ bool SBProcess::GetDescription(SBStream &description) { char path[PATH_MAX]; GetTarget().GetExecutable().GetPath(path, sizeof(path)); Module *exe_module = process_sp->GetTarget().GetExecutableModulePointer(); - const char *exe_name = NULL; + const char *exe_name = nullptr; if (exe_module) exe_name = exe_module->GetFileSpec().GetFilename().AsCString(); @@ -1156,7 +1156,7 @@ const char *SBProcess::GetExtendedBacktraceTypeAtIndex(uint32_t idx) { return names[idx].AsCString(); } } - return NULL; + return nullptr; } SBThreadCollection SBProcess::GetHistoryThreads(addr_t addr) { diff --git a/lldb/source/API/SBQueue.cpp b/lldb/source/API/SBQueue.cpp index 465bbac9387..7d1581c42f6 100644 --- a/lldb/source/API/SBQueue.cpp +++ b/lldb/source/API/SBQueue.cpp @@ -49,7 +49,7 @@ public: ~QueueImpl() {} - bool IsValid() { return m_queue_wp.lock() != NULL; } + bool IsValid() { return m_queue_wp.lock() != nullptr; } void Clear() { m_queue_wp.reset(); @@ -83,7 +83,7 @@ public: } const char *GetName() const { - const char *name = NULL; + const char *name = nullptr; lldb::QueueSP queue_sp = m_queue_wp.lock(); if (queue_sp.get()) { name = queue_sp->GetName(); diff --git a/lldb/source/API/SBQueueItem.cpp b/lldb/source/API/SBQueueItem.cpp index edb258029d1..5f2cbd1bdbf 100644 --- a/lldb/source/API/SBQueueItem.cpp +++ b/lldb/source/API/SBQueueItem.cpp @@ -41,7 +41,7 @@ bool SBQueueItem::IsValid() const { SBQueueItem::operator bool() const { LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBQueueItem, operator bool); - return m_queue_item_sp.get() != NULL; + return m_queue_item_sp.get() != nullptr; } void SBQueueItem::Clear() { diff --git a/lldb/source/API/SBSection.cpp b/lldb/source/API/SBSection.cpp index f47a799697d..14e1e14f59a 100644 --- a/lldb/source/API/SBSection.cpp +++ b/lldb/source/API/SBSection.cpp @@ -54,7 +54,7 @@ SBSection::operator bool() const { LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBSection, operator bool); SectionSP section_sp(GetSP()); - return section_sp && section_sp->GetModule().get() != NULL; + return section_sp && section_sp->GetModule().get() != nullptr; } const char *SBSection::GetName() { @@ -63,7 +63,7 @@ const char *SBSection::GetName() { SectionSP section_sp(GetSP()); if (section_sp) return section_sp->GetName().GetCString(); - return NULL; + return nullptr; } lldb::SBSection SBSection::GetParent() { diff --git a/lldb/source/API/SBSourceManager.cpp b/lldb/source/API/SBSourceManager.cpp index 785f3090777..9c4ce3c7f4e 100644 --- a/lldb/source/API/SBSourceManager.cpp +++ b/lldb/source/API/SBSourceManager.cpp @@ -131,7 +131,7 @@ size_t SBSourceManager::DisplaySourceLinesWithLineNumbersAndColumn( const char *, lldb::SBStream &), file, line, column, context_before, context_after, current_line_cstr, s); - if (m_opaque_up == NULL) + if (m_opaque_up == nullptr) return 0; return m_opaque_up->DisplaySourceLinesWithLineNumbers( diff --git a/lldb/source/API/SBStream.cpp b/lldb/source/API/SBStream.cpp index 2f149a24d13..ae652338e1e 100644 --- a/lldb/source/API/SBStream.cpp +++ b/lldb/source/API/SBStream.cpp @@ -34,7 +34,7 @@ bool SBStream::IsValid() const { SBStream::operator bool() const { LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBStream, operator bool); - return (m_opaque_up != NULL); + return (m_opaque_up != nullptr); } // If this stream is not redirected to a file, it will maintain a local cache @@ -42,8 +42,8 @@ SBStream::operator bool() const { const char *SBStream::GetData() { LLDB_RECORD_METHOD_NO_ARGS(const char *, SBStream, GetData); - if (m_is_file || m_opaque_up == NULL) - return NULL; + if (m_is_file || m_opaque_up == nullptr) + return nullptr; return static_cast<StreamString *>(m_opaque_up.get())->GetData(); } @@ -53,7 +53,7 @@ const char *SBStream::GetData() { size_t SBStream::GetSize() { LLDB_RECORD_METHOD_NO_ARGS(size_t, SBStream, GetSize); - if (m_is_file || m_opaque_up == NULL) + if (m_is_file || m_opaque_up == nullptr) return 0; return static_cast<StreamString *>(m_opaque_up.get())->GetSize(); @@ -160,7 +160,7 @@ lldb_private::Stream *SBStream::operator->() { return m_opaque_up.get(); } lldb_private::Stream *SBStream::get() { return m_opaque_up.get(); } lldb_private::Stream &SBStream::ref() { - if (m_opaque_up == NULL) + if (m_opaque_up == nullptr) m_opaque_up.reset(new StreamString()); return *m_opaque_up; } diff --git a/lldb/source/API/SBStringList.cpp b/lldb/source/API/SBStringList.cpp index b08f232389c..2f8bd55855a 100644 --- a/lldb/source/API/SBStringList.cpp +++ b/lldb/source/API/SBStringList.cpp @@ -56,13 +56,13 @@ bool SBStringList::IsValid() const { SBStringList::operator bool() const { LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBStringList, operator bool); - return (m_opaque_up != NULL); + return (m_opaque_up != nullptr); } void SBStringList::AppendString(const char *str) { LLDB_RECORD_METHOD(void, SBStringList, AppendString, (const char *), str); - if (str != NULL) { + if (str != nullptr) { if (IsValid()) m_opaque_up->AppendString(str); else @@ -74,7 +74,7 @@ void SBStringList::AppendList(const char **strv, int strc) { LLDB_RECORD_METHOD(void, SBStringList, AppendList, (const char **, int), strv, strc); - if ((strv != NULL) && (strc > 0)) { + if ((strv != nullptr) && (strc > 0)) { if (IsValid()) m_opaque_up->AppendList(strv, strc); else @@ -115,7 +115,7 @@ const char *SBStringList::GetStringAtIndex(size_t idx) { if (IsValid()) { return m_opaque_up->GetStringAtIndex(idx); } - return NULL; + return nullptr; } const char *SBStringList::GetStringAtIndex(size_t idx) const { @@ -125,7 +125,7 @@ const char *SBStringList::GetStringAtIndex(size_t idx) const { if (IsValid()) { return m_opaque_up->GetStringAtIndex(idx); } - return NULL; + return nullptr; } void SBStringList::Clear() { diff --git a/lldb/source/API/SBSymbol.cpp b/lldb/source/API/SBSymbol.cpp index a3c5acf3941..6cc90e0ee36 100644 --- a/lldb/source/API/SBSymbol.cpp +++ b/lldb/source/API/SBSymbol.cpp @@ -18,7 +18,7 @@ using namespace lldb; using namespace lldb_private; -SBSymbol::SBSymbol() : m_opaque_ptr(NULL) { +SBSymbol::SBSymbol() : m_opaque_ptr(nullptr) { LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBSymbol); } @@ -37,7 +37,7 @@ const SBSymbol &SBSymbol::operator=(const SBSymbol &rhs) { return LLDB_RECORD_RESULT(*this); } -SBSymbol::~SBSymbol() { m_opaque_ptr = NULL; } +SBSymbol::~SBSymbol() { m_opaque_ptr = nullptr; } void SBSymbol::SetSymbol(lldb_private::Symbol *lldb_object_ptr) { m_opaque_ptr = lldb_object_ptr; @@ -50,13 +50,13 @@ bool SBSymbol::IsValid() const { SBSymbol::operator bool() const { LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBSymbol, operator bool); - return m_opaque_ptr != NULL; + return m_opaque_ptr != nullptr; } const char *SBSymbol::GetName() const { LLDB_RECORD_METHOD_CONST_NO_ARGS(const char *, SBSymbol, GetName); - const char *name = NULL; + const char *name = nullptr; if (m_opaque_ptr) name = m_opaque_ptr->GetName().AsCString(); @@ -66,7 +66,7 @@ const char *SBSymbol::GetName() const { const char *SBSymbol::GetDisplayName() const { LLDB_RECORD_METHOD_CONST_NO_ARGS(const char *, SBSymbol, GetDisplayName); - const char *name = NULL; + const char *name = nullptr; if (m_opaque_ptr) name = m_opaque_ptr->GetMangled() .GetDisplayDemangledName(m_opaque_ptr->GetLanguage()) @@ -78,7 +78,7 @@ const char *SBSymbol::GetDisplayName() const { const char *SBSymbol::GetMangledName() const { LLDB_RECORD_METHOD_CONST_NO_ARGS(const char *, SBSymbol, GetMangledName); - const char *name = NULL; + const char *name = nullptr; if (m_opaque_ptr) name = m_opaque_ptr->GetMangled().GetMangledName().AsCString(); return name; @@ -105,7 +105,7 @@ bool SBSymbol::GetDescription(SBStream &description) { Stream &strm = description.ref(); if (m_opaque_ptr) { - m_opaque_ptr->GetDescription(&strm, lldb::eDescriptionLevelFull, NULL); + m_opaque_ptr->GetDescription(&strm, lldb::eDescriptionLevelFull, nullptr); } else strm.PutCString("No value"); @@ -116,7 +116,7 @@ SBInstructionList SBSymbol::GetInstructions(SBTarget target) { LLDB_RECORD_METHOD(lldb::SBInstructionList, SBSymbol, GetInstructions, (lldb::SBTarget), target); - return LLDB_RECORD_RESULT(GetInstructions(target, NULL)); + return LLDB_RECORD_RESULT(GetInstructions(target, nullptr)); } SBInstructionList SBSymbol::GetInstructions(SBTarget target, @@ -141,7 +141,7 @@ SBInstructionList SBSymbol::GetInstructions(SBTarget target, AddressRange symbol_range(symbol_addr, m_opaque_ptr->GetByteSize()); const bool prefer_file_cache = false; sb_instructions.SetDisassembler(Disassembler::DisassembleRange( - module_sp->GetArchitecture(), NULL, flavor_string, exe_ctx, + module_sp->GetArchitecture(), nullptr, flavor_string, exe_ctx, symbol_range, prefer_file_cache)); } } diff --git a/lldb/source/API/SBSymbolContext.cpp b/lldb/source/API/SBSymbolContext.cpp index f8f446ba574..365f0ccc2fb 100644 --- a/lldb/source/API/SBSymbolContext.cpp +++ b/lldb/source/API/SBSymbolContext.cpp @@ -63,7 +63,7 @@ bool SBSymbolContext::IsValid() const { SBSymbolContext::operator bool() const { LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBSymbolContext, operator bool); - return m_opaque_up != NULL; + return m_opaque_up != nullptr; } SBModule SBSymbolContext::GetModule() { @@ -84,13 +84,13 @@ SBCompileUnit SBSymbolContext::GetCompileUnit() { GetCompileUnit); return LLDB_RECORD_RESULT( - SBCompileUnit(m_opaque_up ? m_opaque_up->comp_unit : NULL)); + SBCompileUnit(m_opaque_up ? m_opaque_up->comp_unit : nullptr)); } SBFunction SBSymbolContext::GetFunction() { LLDB_RECORD_METHOD_NO_ARGS(lldb::SBFunction, SBSymbolContext, GetFunction); - Function *function = NULL; + Function *function = nullptr; if (m_opaque_up) function = m_opaque_up->function; @@ -103,7 +103,8 @@ SBFunction SBSymbolContext::GetFunction() { SBBlock SBSymbolContext::GetBlock() { LLDB_RECORD_METHOD_NO_ARGS(lldb::SBBlock, SBSymbolContext, GetBlock); - return LLDB_RECORD_RESULT(SBBlock(m_opaque_up ? m_opaque_up->block : NULL)); + return LLDB_RECORD_RESULT( + SBBlock(m_opaque_up ? m_opaque_up->block : nullptr)); } SBLineEntry SBSymbolContext::GetLineEntry() { @@ -119,7 +120,7 @@ SBLineEntry SBSymbolContext::GetLineEntry() { SBSymbol SBSymbolContext::GetSymbol() { LLDB_RECORD_METHOD_NO_ARGS(lldb::SBSymbol, SBSymbolContext, GetSymbol); - Symbol *symbol = NULL; + Symbol *symbol = nullptr; if (m_opaque_up) symbol = m_opaque_up->symbol; @@ -183,13 +184,13 @@ const lldb_private::SymbolContext &SBSymbolContext::operator*() const { } lldb_private::SymbolContext &SBSymbolContext::operator*() { - if (m_opaque_up == NULL) + if (m_opaque_up == nullptr) m_opaque_up.reset(new SymbolContext); return *m_opaque_up; } lldb_private::SymbolContext &SBSymbolContext::ref() { - if (m_opaque_up == NULL) + if (m_opaque_up == nullptr) m_opaque_up.reset(new SymbolContext); return *m_opaque_up; } @@ -205,7 +206,7 @@ bool SBSymbolContext::GetDescription(SBStream &description) { Stream &strm = description.ref(); if (m_opaque_up) { - m_opaque_up->GetDescription(&strm, lldb::eDescriptionLevelFull, NULL); + m_opaque_up->GetDescription(&strm, lldb::eDescriptionLevelFull, nullptr); } else strm.PutCString("No value"); diff --git a/lldb/source/API/SBSymbolContextList.cpp b/lldb/source/API/SBSymbolContextList.cpp index 7c9a9dbb871..915d04a0282 100644 --- a/lldb/source/API/SBSymbolContextList.cpp +++ b/lldb/source/API/SBSymbolContextList.cpp @@ -93,7 +93,7 @@ bool SBSymbolContextList::IsValid() const { SBSymbolContextList::operator bool() const { LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBSymbolContextList, operator bool); - return m_opaque_up != NULL; + return m_opaque_up != nullptr; } lldb_private::SymbolContextList *SBSymbolContextList::operator->() const { @@ -111,7 +111,7 @@ bool SBSymbolContextList::GetDescription(lldb::SBStream &description) { Stream &strm = description.ref(); if (m_opaque_up) - m_opaque_up->GetDescription(&strm, lldb::eDescriptionLevelFull, NULL); + m_opaque_up->GetDescription(&strm, lldb::eDescriptionLevelFull, nullptr); return true; } diff --git a/lldb/source/API/SBTarget.cpp b/lldb/source/API/SBTarget.cpp index ee0897e5950..56d258187ea 100644 --- a/lldb/source/API/SBTarget.cpp +++ b/lldb/source/API/SBTarget.cpp @@ -126,7 +126,7 @@ bool SBTarget::EventIsTargetEvent(const SBEvent &event) { LLDB_RECORD_STATIC_METHOD(bool, SBTarget, EventIsTargetEvent, (const lldb::SBEvent &), event); - return Target::TargetEventData::GetEventDataFromEvent(event.get()) != NULL; + return Target::TargetEventData::GetEventDataFromEvent(event.get()) != nullptr; } SBTarget SBTarget::GetTargetFromEvent(const SBEvent &event) { @@ -171,7 +171,7 @@ bool SBTarget::IsValid() const { SBTarget::operator bool() const { LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBTarget, operator bool); - return m_opaque_sp.get() != NULL && m_opaque_sp->IsValid(); + return m_opaque_sp.get() != nullptr && m_opaque_sp->IsValid(); } SBProcess SBTarget::GetProcess() { @@ -288,9 +288,9 @@ SBProcess SBTarget::LaunchSimple(char const **argv, char const **envp, (const char **, const char **, const char *), argv, envp, working_directory); - char *stdin_path = NULL; - char *stdout_path = NULL; - char *stderr_path = NULL; + char *stdin_path = nullptr; + char *stdout_path = nullptr; + char *stderr_path = nullptr; uint32_t launch_flags = 0; bool stop_at_entry = false; SBError error; @@ -307,7 +307,7 @@ SBError SBTarget::Install() { TargetSP target_sp(GetSP()); if (target_sp) { std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex()); - sb_error.ref() = target_sp->Install(NULL); + sb_error.ref() = target_sp->Install(nullptr); } return LLDB_RECORD_RESULT(sb_error); } @@ -381,7 +381,7 @@ SBProcess SBTarget::Launch(SBListener &listener, char const **argv, if (listener.IsValid()) launch_info.SetListener(listener.GetSP()); - error.SetError(target_sp->Launch(launch_info, NULL)); + error.SetError(target_sp->Launch(launch_info, nullptr)); sb_process.SetSP(target_sp->GetProcessSP()); } else { @@ -430,7 +430,7 @@ SBProcess SBTarget::Launch(SBLaunchInfo &sb_launch_info, SBError &error) { if (arch_spec.IsValid()) launch_info.GetArchitecture() = arch_spec; - error.SetError(target_sp->Launch(launch_info, NULL)); + error.SetError(target_sp->Launch(launch_info, nullptr)); sb_launch_info.set_ref(launch_info); sb_process.SetSP(target_sp->GetProcessSP()); } else { @@ -551,14 +551,14 @@ lldb::SBProcess SBTarget::ConnectRemote(SBListener &listener, const char *url, std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex()); if (listener.IsValid()) process_sp = - target_sp->CreateProcess(listener.m_opaque_sp, plugin_name, NULL); + target_sp->CreateProcess(listener.m_opaque_sp, plugin_name, nullptr); else process_sp = target_sp->CreateProcess( - target_sp->GetDebugger().GetListener(), plugin_name, NULL); + target_sp->GetDebugger().GetListener(), plugin_name, nullptr); if (process_sp) { sb_process.SetSP(process_sp); - error.SetError(process_sp->ConnectRemote(NULL, url)); + error.SetError(process_sp->ConnectRemote(nullptr, url)); } else { error.SetErrorString("unable to create lldb_private::Process"); } @@ -788,12 +788,12 @@ SBBreakpoint SBTarget::BreakpointCreateByName(const char *symbol_name, FileSpecList module_spec_list; module_spec_list.Append(FileSpec(module_name)); sb_bp = target_sp->CreateBreakpoint( - &module_spec_list, NULL, symbol_name, eFunctionNameTypeAuto, + &module_spec_list, nullptr, symbol_name, eFunctionNameTypeAuto, eLanguageTypeUnknown, offset, skip_prologue, internal, hardware); } else { sb_bp = target_sp->CreateBreakpoint( - NULL, NULL, symbol_name, eFunctionNameTypeAuto, eLanguageTypeUnknown, - offset, skip_prologue, internal, hardware); + nullptr, nullptr, symbol_name, eFunctionNameTypeAuto, + eLanguageTypeUnknown, offset, skip_prologue, internal, hardware); } } @@ -1425,7 +1425,7 @@ lldb::SBWatchpoint SBTarget::WatchAddress(lldb::addr_t addr, size_t size, // Target::CreateWatchpoint() is thread safe. Status cw_error; // This API doesn't take in a type, so we can't figure out what it is. - CompilerType *type = NULL; + CompilerType *type = nullptr; watchpoint_sp = target_sp->CreateWatchpoint(addr, size, type, watch_type, cw_error); error.SetError(cw_error); @@ -1559,7 +1559,7 @@ lldb::SBModule SBTarget::AddModule(const char *path, const char *triple, (const char *, const char *, const char *), path, triple, uuid_cstr); - return LLDB_RECORD_RESULT(AddModule(path, triple, uuid_cstr, NULL)); + return LLDB_RECORD_RESULT(AddModule(path, triple, uuid_cstr, nullptr)); } lldb::SBModule SBTarget::AddModule(const char *path, const char *triple, @@ -1683,7 +1683,7 @@ const char *SBTarget::GetTriple() { ConstString const_triple(triple.c_str()); return const_triple.GetCString(); } - return NULL; + return nullptr; } uint32_t SBTarget::GetDataByteSize() { @@ -1969,7 +1969,7 @@ SBValueList SBTarget::FindGlobalVariables(const char *name, if (match_count > 0) { ExecutionContextScope *exe_scope = target_sp->GetProcessSP().get(); - if (exe_scope == NULL) + if (exe_scope == nullptr) exe_scope = target_sp.get(); for (uint32_t i = 0; i < match_count; ++i) { lldb::ValueObjectSP valobj_sp(ValueObjectVariable::Create( @@ -2017,7 +2017,7 @@ SBValueList SBTarget::FindGlobalVariables(const char *name, if (match_count > 0) { ExecutionContextScope *exe_scope = target_sp->GetProcessSP().get(); - if (exe_scope == NULL) + if (exe_scope == nullptr) exe_scope = target_sp.get(); for (uint32_t i = 0; i < match_count; ++i) { lldb::ValueObjectSP valobj_sp(ValueObjectVariable::Create( @@ -2053,7 +2053,7 @@ lldb::SBInstructionList SBTarget::ReadInstructions(lldb::SBAddress base_addr, LLDB_RECORD_METHOD(lldb::SBInstructionList, SBTarget, ReadInstructions, (lldb::SBAddress, uint32_t), base_addr, count); - return LLDB_RECORD_RESULT(ReadInstructions(base_addr, count, NULL)); + return LLDB_RECORD_RESULT(ReadInstructions(base_addr, count, nullptr)); } lldb::SBInstructionList SBTarget::ReadInstructions(lldb::SBAddress base_addr, @@ -2080,7 +2080,7 @@ lldb::SBInstructionList SBTarget::ReadInstructions(lldb::SBAddress base_addr, data.GetByteSize(), error, &load_addr); const bool data_from_file = load_addr == LLDB_INVALID_ADDRESS; sb_instructions.SetDisassembler(Disassembler::DisassembleBytes( - target_sp->GetArchitecture(), NULL, flavor_string, *addr_ptr, + target_sp->GetArchitecture(), nullptr, flavor_string, *addr_ptr, data.GetBytes(), bytes_read, count, data_from_file)); } } @@ -2095,7 +2095,7 @@ lldb::SBInstructionList SBTarget::GetInstructions(lldb::SBAddress base_addr, (lldb::SBAddress, const void *, size_t), base_addr, buf, size); - return GetInstructionsWithFlavor(base_addr, NULL, buf, size); + return GetInstructionsWithFlavor(base_addr, nullptr, buf, size); } lldb::SBInstructionList @@ -2119,7 +2119,7 @@ SBTarget::GetInstructionsWithFlavor(lldb::SBAddress base_addr, const bool data_from_file = true; sb_instructions.SetDisassembler(Disassembler::DisassembleBytes( - target_sp->GetArchitecture(), NULL, flavor_string, addr, buf, size, + target_sp->GetArchitecture(), nullptr, flavor_string, addr, buf, size, UINT32_MAX, data_from_file)); } @@ -2132,7 +2132,7 @@ lldb::SBInstructionList SBTarget::GetInstructions(lldb::addr_t base_addr, LLDB_RECORD_DUMMY(lldb::SBInstructionList, SBTarget, GetInstructions, (lldb::addr_t, const void *, size_t), base_addr, buf, size); - return GetInstructionsWithFlavor(ResolveLoadAddress(base_addr), NULL, buf, + return GetInstructionsWithFlavor(ResolveLoadAddress(base_addr), nullptr, buf, size); } @@ -2353,9 +2353,9 @@ lldb::SBValue SBTarget::EvaluateExpression(const char *expr, SBValue expr_result; ValueObjectSP expr_value_sp; TargetSP target_sp(GetSP()); - StackFrame *frame = NULL; + StackFrame *frame = nullptr; if (target_sp) { - if (expr == NULL || expr[0] == '\0') { + if (expr == nullptr || expr[0] == '\0') { return LLDB_RECORD_RESULT(expr_result); } @@ -2409,7 +2409,7 @@ lldb::addr_t SBTarget::GetStackRedZoneSize() { lldb::SBLaunchInfo SBTarget::GetLaunchInfo() const { LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::SBLaunchInfo, SBTarget, GetLaunchInfo); - lldb::SBLaunchInfo launch_info(NULL); + lldb::SBLaunchInfo launch_info(nullptr); TargetSP target_sp(GetSP()); if (target_sp) launch_info.set_ref(m_opaque_sp->GetProcessLaunchInfo()); diff --git a/lldb/source/API/SBThread.cpp b/lldb/source/API/SBThread.cpp index 5f4f69f0213..85e9a6b4795 100644 --- a/lldb/source/API/SBThread.cpp +++ b/lldb/source/API/SBThread.cpp @@ -122,7 +122,7 @@ SBThread::operator bool() const { if (target && process) { Process::StopLocker stop_locker; if (stop_locker.TryLock(&process->GetRunLock())) - return m_opaque_sp->GetThreadSP().get() != NULL; + return m_opaque_sp->GetThreadSP().get() != nullptr; } // Without a valid target & process, this thread can't be valid. return false; @@ -359,7 +359,7 @@ size_t SBThread::GetStopDescription(char *dst, size_t dst_len) { stop_desc = exe_ctx.GetProcessPtr()->GetUnixSignals()->GetSignalAsCString( stop_info_sp->GetValue()); - if (stop_desc == NULL || stop_desc[0] == '\0') { + if (stop_desc == nullptr || stop_desc[0] == '\0') { static char signal_desc[] = "signal"; stop_desc = signal_desc; stop_desc_len = @@ -452,7 +452,7 @@ uint32_t SBThread::GetIndexID() const { const char *SBThread::GetName() const { LLDB_RECORD_METHOD_CONST_NO_ARGS(const char *, SBThread, GetName); - const char *name = NULL; + const char *name = nullptr; std::unique_lock<std::recursive_mutex> lock; ExecutionContext exe_ctx(m_opaque_sp.get(), lock); @@ -469,7 +469,7 @@ const char *SBThread::GetName() const { const char *SBThread::GetQueueName() const { LLDB_RECORD_METHOD_CONST_NO_ARGS(const char *, SBThread, GetQueueName); - const char *name = NULL; + const char *name = nullptr; std::unique_lock<std::recursive_mutex> lock; ExecutionContext exe_ctx(m_opaque_sp.get(), lock); @@ -566,7 +566,7 @@ SBError SBThread::ResumeNewPlan(ExecutionContext &exe_ctx, // User level plans should be Master Plans so they can be interrupted, other // plans executed, and then a "continue" will resume the plan. - if (new_plan != NULL) { + if (new_plan != nullptr) { new_plan->SetIsMasterPlan(true); new_plan->SetOkayToDiscard(false); } @@ -577,7 +577,7 @@ SBError SBThread::ResumeNewPlan(ExecutionContext &exe_ctx, if (process->GetTarget().GetDebugger().GetAsyncExecution()) sb_error.ref() = process->Resume(); else - sb_error.ref() = process->ResumeSynchronous(NULL); + sb_error.ref() = process->ResumeSynchronous(nullptr); return sb_error; } @@ -627,7 +627,7 @@ void SBThread::StepInto(lldb::RunMode stop_other_threads) { LLDB_RECORD_METHOD(void, SBThread, StepInto, (lldb::RunMode), stop_other_threads); - StepInto(NULL, stop_other_threads); + StepInto(nullptr, stop_other_threads); } void SBThread::StepInto(const char *target_name, @@ -716,7 +716,7 @@ void SBThread::StepOut(SBError &error) { const LazyBool avoid_no_debug = eLazyBoolCalculate; Status new_plan_status; ThreadPlanSP new_plan_sp(thread->QueueThreadPlanForStepOut( - abort_other_plans, NULL, false, stop_other_threads, eVoteYes, + abort_other_plans, nullptr, false, stop_other_threads, eVoteYes, eVoteNoOpinion, 0, new_plan_status, avoid_no_debug)); if (new_plan_status.Success()) @@ -763,7 +763,7 @@ void SBThread::StepOutOfFrame(SBFrame &sb_frame, SBError &error) { Status new_plan_status; ThreadPlanSP new_plan_sp(thread->QueueThreadPlanForStepOut( - abort_other_plans, NULL, false, stop_other_threads, eVoteYes, + abort_other_plans, nullptr, false, stop_other_threads, eVoteYes, eVoteNoOpinion, frame_sp->GetFrameIndex(), new_plan_status)); if (new_plan_status.Success()) @@ -878,7 +878,7 @@ SBError SBThread::StepOverUntil(lldb::SBFrame &sb_frame, eSymbolContextCompUnit | eSymbolContextFunction | eSymbolContextLineEntry | eSymbolContextSymbol); - if (frame_sc.comp_unit == NULL) { + if (frame_sc.comp_unit == nullptr) { sb_error.SetErrorStringWithFormat( "frame %u doesn't have debug information", frame_sp->GetFrameIndex()); return LLDB_RECORD_RESULT(sb_error); @@ -1235,7 +1235,7 @@ bool SBThread::EventIsThreadEvent(const SBEvent &event) { LLDB_RECORD_STATIC_METHOD(bool, SBThread, EventIsThreadEvent, (const lldb::SBEvent &), event); - return Thread::ThreadEventData::GetEventDataFromEvent(event.get()) != NULL; + return Thread::ThreadEventData::GetEventDataFromEvent(event.get()) != nullptr; } SBFrame SBThread::GetStackFrameFromEvent(const SBEvent &event) { diff --git a/lldb/source/API/SBThreadCollection.cpp b/lldb/source/API/SBThreadCollection.cpp index 766fe8f5516..3c1cf986506 100644 --- a/lldb/source/API/SBThreadCollection.cpp +++ b/lldb/source/API/SBThreadCollection.cpp @@ -67,7 +67,7 @@ bool SBThreadCollection::IsValid() const { SBThreadCollection::operator bool() const { LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBThreadCollection, operator bool); - return m_opaque_sp.get() != NULL; + return m_opaque_sp.get() != nullptr; } size_t SBThreadCollection::GetSize() { diff --git a/lldb/source/API/SBThreadPlan.cpp b/lldb/source/API/SBThreadPlan.cpp index ecb1a4fd1d9..8f6802fe9ce 100644 --- a/lldb/source/API/SBThreadPlan.cpp +++ b/lldb/source/API/SBThreadPlan.cpp @@ -92,7 +92,7 @@ bool SBThreadPlan::IsValid() const { SBThreadPlan::operator bool() const { LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBThreadPlan, operator bool); - return m_opaque_sp.get() != NULL; + return m_opaque_sp.get() != nullptr; } void SBThreadPlan::Clear() { @@ -262,7 +262,7 @@ SBThreadPlan::QueueThreadPlanForStepInRange(SBAddress &sb_start_address, Status plan_status; SBThreadPlan plan = SBThreadPlan(m_opaque_sp->GetThread().QueueThreadPlanForStepInRange( - false, range, sc, NULL, eAllThreads, plan_status)); + false, range, sc, nullptr, eAllThreads, plan_status)); if (plan_status.Fail()) error.SetErrorString(plan_status.AsCString()); diff --git a/lldb/source/API/SBType.cpp b/lldb/source/API/SBType.cpp index e016ee46f23..5402128b3fa 100644 --- a/lldb/source/API/SBType.cpp +++ b/lldb/source/API/SBType.cpp @@ -92,7 +92,7 @@ SBType &SBType::operator=(const SBType &rhs) { SBType::~SBType() {} TypeImpl &SBType::ref() { - if (m_opaque_sp.get() == NULL) + if (m_opaque_sp.get() == nullptr) m_opaque_sp = std::make_shared<TypeImpl>(); return *m_opaque_sp; } @@ -112,7 +112,7 @@ bool SBType::IsValid() const { SBType::operator bool() const { LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBType, operator bool); - if (m_opaque_sp.get() == NULL) + if (m_opaque_sp.get() == nullptr) return false; return m_opaque_sp->IsValid(); @@ -579,7 +579,7 @@ bool SBTypeList::IsValid() { SBTypeList::operator bool() const { LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBTypeList, operator bool); - return (m_opaque_up != NULL); + return (m_opaque_up != nullptr); } SBTypeList &SBTypeList::operator=(const SBTypeList &rhs) { @@ -660,7 +660,7 @@ const char *SBTypeMember::GetName() { if (m_opaque_up) return m_opaque_up->GetName().GetCString(); - return NULL; + return nullptr; } SBType SBTypeMember::GetType() { @@ -743,7 +743,7 @@ void SBTypeMember::reset(TypeMemberImpl *type_member_impl) { } TypeMemberImpl &SBTypeMember::ref() { - if (m_opaque_up == NULL) + if (m_opaque_up == nullptr) m_opaque_up.reset(new TypeMemberImpl()); return *m_opaque_up; } @@ -789,7 +789,7 @@ const char *SBTypeMemberFunction::GetName() { if (m_opaque_sp) return m_opaque_sp->GetName().GetCString(); - return NULL; + return nullptr; } const char *SBTypeMemberFunction::GetDemangledName() { @@ -803,7 +803,7 @@ const char *SBTypeMemberFunction::GetDemangledName() { return mangled.GetDemangledName(mangled.GuessLanguage()).GetCString(); } } - return NULL; + return nullptr; } const char *SBTypeMemberFunction::GetMangledName() { @@ -812,7 +812,7 @@ const char *SBTypeMemberFunction::GetMangledName() { if (m_opaque_sp) return m_opaque_sp->GetMangledName().GetCString(); - return NULL; + return nullptr; } SBType SBTypeMemberFunction::GetType() { diff --git a/lldb/source/API/SBTypeCategory.cpp b/lldb/source/API/SBTypeCategory.cpp index c2ec8cf8522..43d5a3ab140 100644 --- a/lldb/source/API/SBTypeCategory.cpp +++ b/lldb/source/API/SBTypeCategory.cpp @@ -49,7 +49,7 @@ bool SBTypeCategory::IsValid() const { SBTypeCategory::operator bool() const { LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBTypeCategory, operator bool); - return (m_opaque_sp.get() != NULL); + return (m_opaque_sp.get() != nullptr); } bool SBTypeCategory::GetEnabled() { @@ -75,7 +75,7 @@ const char *SBTypeCategory::GetName() { LLDB_RECORD_METHOD_NO_ARGS(const char *, SBTypeCategory, GetName); if (!IsValid()) - return NULL; + return nullptr; return m_opaque_sp->GetName(); } diff --git a/lldb/source/API/SBTypeEnumMember.cpp b/lldb/source/API/SBTypeEnumMember.cpp index c0e1c7942db..bd0755a140c 100644 --- a/lldb/source/API/SBTypeEnumMember.cpp +++ b/lldb/source/API/SBTypeEnumMember.cpp @@ -64,7 +64,7 @@ const char *SBTypeEnumMember::GetName() { if (m_opaque_sp.get()) return m_opaque_sp->GetName().GetCString(); - return NULL; + return nullptr; } int64_t SBTypeEnumMember::GetValueAsSigned() { @@ -98,7 +98,7 @@ void SBTypeEnumMember::reset(TypeEnumMemberImpl *type_member_impl) { } TypeEnumMemberImpl &SBTypeEnumMember::ref() { - if (m_opaque_sp.get() == NULL) + if (m_opaque_sp.get() == nullptr) m_opaque_sp = std::make_shared<TypeEnumMemberImpl>(); return *m_opaque_sp.get(); } @@ -130,7 +130,7 @@ bool SBTypeEnumMemberList::IsValid() { SBTypeEnumMemberList::operator bool() const { LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBTypeEnumMemberList, operator bool); - return (m_opaque_up != NULL); + return (m_opaque_up != nullptr); } SBTypeEnumMemberList &SBTypeEnumMemberList:: diff --git a/lldb/source/API/SBTypeFilter.cpp b/lldb/source/API/SBTypeFilter.cpp index 104ef95650f..d40301b4c15 100644 --- a/lldb/source/API/SBTypeFilter.cpp +++ b/lldb/source/API/SBTypeFilter.cpp @@ -40,7 +40,7 @@ bool SBTypeFilter::IsValid() const { SBTypeFilter::operator bool() const { LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBTypeFilter, operator bool); - return m_opaque_sp.get() != NULL; + return m_opaque_sp.get() != nullptr; } uint32_t SBTypeFilter::GetOptions() { @@ -98,7 +98,7 @@ const char *SBTypeFilter::GetExpressionPathAtIndex(uint32_t i) { item++; return item; } - return NULL; + return nullptr; } bool SBTypeFilter::ReplaceExpressionPathAtIndex(uint32_t i, const char *item) { diff --git a/lldb/source/API/SBTypeFormat.cpp b/lldb/source/API/SBTypeFormat.cpp index 12729aaf982..6024631e705 100644 --- a/lldb/source/API/SBTypeFormat.cpp +++ b/lldb/source/API/SBTypeFormat.cpp @@ -49,7 +49,7 @@ bool SBTypeFormat::IsValid() const { SBTypeFormat::operator bool() const { LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBTypeFormat, operator bool); - return m_opaque_sp.get() != NULL; + return m_opaque_sp.get() != nullptr; } lldb::Format SBTypeFormat::GetFormat() { diff --git a/lldb/source/API/SBTypeNameSpecifier.cpp b/lldb/source/API/SBTypeNameSpecifier.cpp index cccd0ee449e..895f6977565 100644 --- a/lldb/source/API/SBTypeNameSpecifier.cpp +++ b/lldb/source/API/SBTypeNameSpecifier.cpp @@ -27,7 +27,7 @@ SBTypeNameSpecifier::SBTypeNameSpecifier(const char *name, bool is_regex) LLDB_RECORD_CONSTRUCTOR(SBTypeNameSpecifier, (const char *, bool), name, is_regex); - if (name == NULL || (*name) == 0) + if (name == nullptr || (*name) == 0) m_opaque_sp.reset(); } @@ -54,14 +54,14 @@ bool SBTypeNameSpecifier::IsValid() const { SBTypeNameSpecifier::operator bool() const { LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBTypeNameSpecifier, operator bool); - return m_opaque_sp.get() != NULL; + return m_opaque_sp.get() != nullptr; } const char *SBTypeNameSpecifier::GetName() { LLDB_RECORD_METHOD_NO_ARGS(const char *, SBTypeNameSpecifier, GetName); if (!IsValid()) - return NULL; + return nullptr; return m_opaque_sp->GetName(); } @@ -129,7 +129,7 @@ bool SBTypeNameSpecifier::IsEqualTo(lldb::SBTypeNameSpecifier &rhs) { if (IsRegex() != rhs.IsRegex()) return false; - if (GetName() == NULL || rhs.GetName() == NULL) + if (GetName() == nullptr || rhs.GetName() == nullptr) return false; return (strcmp(GetName(), rhs.GetName()) == 0); diff --git a/lldb/source/API/SBTypeSummary.cpp b/lldb/source/API/SBTypeSummary.cpp index 8ffb114470b..8ffb2343575 100644 --- a/lldb/source/API/SBTypeSummary.cpp +++ b/lldb/source/API/SBTypeSummary.cpp @@ -202,7 +202,7 @@ bool SBTypeSummary::IsValid() const { SBTypeSummary::operator bool() const { LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBTypeSummary, operator bool); - return m_opaque_sp.get() != NULL; + return m_opaque_sp.get() != nullptr; } bool SBTypeSummary::IsFunctionCode() { @@ -244,7 +244,7 @@ const char *SBTypeSummary::GetData() { LLDB_RECORD_METHOD_NO_ARGS(const char *, SBTypeSummary, GetData); if (!IsValid()) - return NULL; + return nullptr; if (ScriptSummaryFormat *script_summary_ptr = llvm::dyn_cast<ScriptSummaryFormat>(m_opaque_sp.get())) { const char *fname = script_summary_ptr->GetFunctionName(); diff --git a/lldb/source/API/SBTypeSynthetic.cpp b/lldb/source/API/SBTypeSynthetic.cpp index f1e15525a08..df6fce1269f 100644 --- a/lldb/source/API/SBTypeSynthetic.cpp +++ b/lldb/source/API/SBTypeSynthetic.cpp @@ -60,7 +60,7 @@ bool SBTypeSynthetic::IsValid() const { SBTypeSynthetic::operator bool() const { LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBTypeSynthetic, operator bool); - return m_opaque_sp.get() != NULL; + return m_opaque_sp.get() != nullptr; } bool SBTypeSynthetic::IsClassCode() { @@ -84,7 +84,7 @@ const char *SBTypeSynthetic::GetData() { LLDB_RECORD_METHOD_NO_ARGS(const char *, SBTypeSynthetic, GetData); if (!IsValid()) - return NULL; + return nullptr; if (IsClassCode()) return m_opaque_sp->GetPythonCode(); else diff --git a/lldb/source/API/SBValue.cpp b/lldb/source/API/SBValue.cpp index 3db84fa2980..83830076352 100644 --- a/lldb/source/API/SBValue.cpp +++ b/lldb/source/API/SBValue.cpp @@ -57,7 +57,7 @@ public: ValueImpl(lldb::ValueObjectSP in_valobj_sp, lldb::DynamicValueType use_dynamic, bool use_synthetic, - const char *name = NULL) + const char *name = nullptr) : m_valobj_sp(), m_use_dynamic(use_dynamic), m_use_synthetic(use_synthetic), m_name(name) { if (in_valobj_sp) { @@ -84,7 +84,7 @@ public: } bool IsValid() { - if (m_valobj_sp.get() == NULL) + if (m_valobj_sp.get() == nullptr) return false; else { // FIXME: This check is necessary but not sufficient. We for sure don't @@ -251,8 +251,8 @@ SBValue::operator bool() const { // If this function ever changes to anything that does more than just check // if the opaque shared pointer is non NULL, then we need to update all "if // (m_opaque_sp)" code in this file. - return m_opaque_sp.get() != NULL && m_opaque_sp->IsValid() && - m_opaque_sp->GetRootSP().get() != NULL; + return m_opaque_sp.get() != nullptr && m_opaque_sp->IsValid() && + m_opaque_sp->GetRootSP().get() != nullptr; } void SBValue::Clear() { @@ -290,7 +290,7 @@ user_id_t SBValue::GetID() { const char *SBValue::GetName() { LLDB_RECORD_METHOD_NO_ARGS(const char *, SBValue, GetName); - const char *name = NULL; + const char *name = nullptr; ValueLocker locker; lldb::ValueObjectSP value_sp(GetSP(locker)); if (value_sp) @@ -302,7 +302,7 @@ const char *SBValue::GetName() { const char *SBValue::GetTypeName() { LLDB_RECORD_METHOD_NO_ARGS(const char *, SBValue, GetTypeName); - const char *name = NULL; + const char *name = nullptr; ValueLocker locker; lldb::ValueObjectSP value_sp(GetSP(locker)); if (value_sp) { @@ -315,7 +315,7 @@ const char *SBValue::GetTypeName() { const char *SBValue::GetDisplayTypeName() { LLDB_RECORD_METHOD_NO_ARGS(const char *, SBValue, GetDisplayTypeName); - const char *name = NULL; + const char *name = nullptr; ValueLocker locker; lldb::ValueObjectSP value_sp(GetSP(locker)); if (value_sp) { @@ -356,7 +356,7 @@ bool SBValue::IsInScope() { const char *SBValue::GetValue() { LLDB_RECORD_METHOD_NO_ARGS(const char *, SBValue, GetValue); - const char *cstr = NULL; + const char *cstr = nullptr; ValueLocker locker; lldb::ValueObjectSP value_sp(GetSP(locker)); if (value_sp) { @@ -381,7 +381,7 @@ ValueType SBValue::GetValueType() { const char *SBValue::GetObjectDescription() { LLDB_RECORD_METHOD_NO_ARGS(const char *, SBValue, GetObjectDescription); - const char *cstr = NULL; + const char *cstr = nullptr; ValueLocker locker; lldb::ValueObjectSP value_sp(GetSP(locker)); if (value_sp) { @@ -394,7 +394,7 @@ const char *SBValue::GetObjectDescription() { const char *SBValue::GetTypeValidatorResult() { LLDB_RECORD_METHOD_NO_ARGS(const char *, SBValue, GetTypeValidatorResult); - const char *cstr = NULL; + const char *cstr = nullptr; ValueLocker locker; lldb::ValueObjectSP value_sp(GetSP(locker)); if (value_sp) { @@ -442,7 +442,7 @@ bool SBValue::GetValueDidChange() { const char *SBValue::GetSummary() { LLDB_RECORD_METHOD_NO_ARGS(const char *, SBValue, GetSummary); - const char *cstr = NULL; + const char *cstr = nullptr; ValueLocker locker; lldb::ValueObjectSP value_sp(GetSP(locker)); if (value_sp) { @@ -472,7 +472,7 @@ const char *SBValue::GetSummary(lldb::SBStream &stream, const char *SBValue::GetLocation() { LLDB_RECORD_METHOD_NO_ARGS(const char *, SBValue, GetLocation); - const char *cstr = NULL; + const char *cstr = nullptr; ValueLocker locker; lldb::ValueObjectSP value_sp(GetSP(locker)); if (value_sp) { @@ -1042,7 +1042,7 @@ void *SBValue::GetOpaqueType() { lldb::ValueObjectSP value_sp(GetSP(locker)); if (value_sp) return value_sp->GetCompilerType().GetOpaqueQualType(); - return NULL; + return nullptr; } lldb::SBTarget SBValue::GetTarget() { diff --git a/lldb/source/API/SBValueList.cpp b/lldb/source/API/SBValueList.cpp index 2f74c992252..7e909df260d 100644 --- a/lldb/source/API/SBValueList.cpp +++ b/lldb/source/API/SBValueList.cpp @@ -92,7 +92,7 @@ bool SBValueList::IsValid() const { SBValueList::operator bool() const { LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBValueList, operator bool); - return (m_opaque_up != NULL); + return (m_opaque_up != nullptr); } void SBValueList::Clear() { @@ -172,7 +172,7 @@ uint32_t SBValueList::GetSize() const { } void SBValueList::CreateIfNeeded() { - if (m_opaque_up == NULL) + if (m_opaque_up == nullptr) m_opaque_up.reset(new ValueListImpl()); } diff --git a/lldb/source/API/SBWatchpoint.cpp b/lldb/source/API/SBWatchpoint.cpp index 0f35c3eda87..d0a36b71e5c 100644 --- a/lldb/source/API/SBWatchpoint.cpp +++ b/lldb/source/API/SBWatchpoint.cpp @@ -218,7 +218,7 @@ const char *SBWatchpoint::GetCondition() { watchpoint_sp->GetTarget().GetAPIMutex()); return watchpoint_sp->GetConditionText(); } - return NULL; + return nullptr; } void SBWatchpoint::SetCondition(const char *condition) { @@ -277,7 +277,7 @@ bool SBWatchpoint::EventIsWatchpointEvent(const lldb::SBEvent &event) { (const lldb::SBEvent &), event); return Watchpoint::WatchpointEventData::GetEventDataFromEvent(event.get()) != - NULL; + nullptr; } WatchpointEventType |