diff options
| author | Konrad Kleine <kkleine@redhat.com> | 2019-05-23 11:14:47 +0000 |
|---|---|---|
| committer | Konrad Kleine <kkleine@redhat.com> | 2019-05-23 11:14:47 +0000 |
| commit | 248a13057a4adbdb8d511b1458daf39d01a4b520 (patch) | |
| tree | 1209fb0822f0c14237eb9935e30da465014a6eda /lldb/source/API/SBThread.cpp | |
| parent | 32d976bac194d78656974e3e05bf52997a06f509 (diff) | |
| download | llvm-248a13057a4adbdb8d511b1458daf39d01a4b520.zip llvm-248a13057a4adbdb8d511b1458daf39d01a4b520.tar.gz llvm-248a13057a4adbdb8d511b1458daf39d01a4b520.tar.bz2 | |
[lldb] NFC modernize codebase with modernize-use-nullptr
Summary:
NFC = [[ https://llvm.org/docs/Lexicon.html#nfc | Non functional change ]]
This commit is the result of modernizing the LLDB codebase by using
`nullptr` instread of `0` or `NULL`. See
https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-nullptr.html
for more information.
This is the command I ran and I to fix and format the code base:
```
run-clang-tidy.py \
-header-filter='.*' \
-checks='-*,modernize-use-nullptr' \
-fix ~/dev/llvm-project/lldb/.* \
-format \
-style LLVM \
-p ~/llvm-builds/debug-ninja-gcc
```
NOTE: There were also changes to `llvm/utils/unittest` but I did not
include them because I felt that maybe this library shall be updated in
isolation somehow.
NOTE: I know this is a rather large commit but it is a nobrainer in most
parts.
Reviewers: martong, espindola, shafik, #lldb, JDevlieghere
Reviewed By: JDevlieghere
Subscribers: arsenm, jvesely, nhaehnle, hiraditya, JDevlieghere, teemperor, rnkovacs, emaste, kubamracek, nemanjai, ki.stfu, javed.absar, arichardson, kbarton, jrtc27, MaskRay, atanasyan, dexonsmith, arphaman, jfb, jsji, jdoerfert, lldb-commits, llvm-commits
Tags: #lldb, #llvm
Differential Revision: https://reviews.llvm.org/D61847
llvm-svn: 361484
Diffstat (limited to 'lldb/source/API/SBThread.cpp')
| -rw-r--r-- | lldb/source/API/SBThread.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/lldb/source/API/SBThread.cpp b/lldb/source/API/SBThread.cpp index 5f4f69f..85e9a6b 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) { |
