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/Plugins/SystemRuntime/MacOSX | |
| parent | 32d976bac194d78656974e3e05bf52997a06f509 (diff) | |
| download | bcm5719-llvm-248a13057a4adbdb8d511b1458daf39d01a4b520.tar.gz bcm5719-llvm-248a13057a4adbdb8d511b1458daf39d01a4b520.zip | |
[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/Plugins/SystemRuntime/MacOSX')
5 files changed, 15 insertions, 14 deletions
diff --git a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp index 00b2826e1f0..c97eb98557a 100644 --- a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp +++ b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp @@ -143,7 +143,7 @@ lldb::addr_t AppleGetItemInfoHandler::SetupGetItemInfoFunction( // function: if (!m_get_item_info_impl_code) { - if (g_get_item_info_function_code != NULL) { + if (g_get_item_info_function_code != nullptr) { Status error; m_get_item_info_impl_code.reset( exe_ctx.GetTargetRef().GetUtilityFunctionForLanguage( diff --git a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp index ddd3cb5d7cb..12fad7f561b 100644 --- a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp +++ b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp @@ -147,7 +147,7 @@ lldb::addr_t AppleGetPendingItemsHandler::SetupGetPendingItemsFunction( // First stage is to make the ClangUtility to hold our injected function: if (!m_get_pending_items_impl_code) { - if (g_get_pending_items_function_code != NULL) { + if (g_get_pending_items_function_code != nullptr) { Status error; m_get_pending_items_impl_code.reset( exe_ctx.GetTargetRef().GetUtilityFunctionForLanguage( @@ -347,7 +347,7 @@ AppleGetPendingItemsHandler::GetPendingItems(Thread &thread, addr_t queue, options.SetIsForUtilityExpr(true); thread.CalculateExecutionContext(exe_ctx); - if (get_pending_items_caller == NULL) { + if (get_pending_items_caller == nullptr) { error.SetErrorString("Unable to compile function to call " "__introspection_dispatch_queue_get_pending_items"); return return_value; diff --git a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.cpp b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.cpp index 2b6c553dd43..e1dabae0d58 100644 --- a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.cpp +++ b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.cpp @@ -158,7 +158,7 @@ AppleGetQueuesHandler::SetupGetQueuesFunction(Thread &thread, // First stage is to make the ClangUtility to hold our injected function: if (!m_get_queues_impl_code_up) { - if (g_get_current_queues_function_code != NULL) { + if (g_get_current_queues_function_code != nullptr) { Status error; m_get_queues_impl_code_up.reset( exe_ctx.GetTargetRef().GetUtilityFunctionForLanguage( @@ -335,7 +335,7 @@ AppleGetQueuesHandler::GetCurrentQueues(Thread &thread, addr_t page_to_free, FunctionCaller *get_queues_caller = m_get_queues_impl_code_up->GetFunctionCaller(); - if (get_queues_caller == NULL) { + if (get_queues_caller == nullptr) { error.SetErrorString( "Unable to get caller for call __introspection_dispatch_get_queues"); return return_value; diff --git a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.cpp b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.cpp index f409b674c53..7d0cbc0c100 100644 --- a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.cpp +++ b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.cpp @@ -154,7 +154,7 @@ lldb::addr_t AppleGetThreadItemInfoHandler::SetupGetThreadItemInfoFunction( if (!m_get_thread_item_info_impl_code) { Status error; - if (g_get_thread_item_info_function_code != NULL) { + if (g_get_thread_item_info_function_code != nullptr) { m_get_thread_item_info_impl_code.reset( exe_ctx.GetTargetRef().GetUtilityFunctionForLanguage( g_get_thread_item_info_function_code, eLanguageTypeC, diff --git a/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp b/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp index 82be85699b2..91a60b17fc9 100644 --- a/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp +++ b/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp @@ -70,7 +70,7 @@ SystemRuntime *SystemRuntimeMacOSX::CreateInstance(Process *process) { if (create) return new SystemRuntimeMacOSX(process); - return NULL; + return nullptr; } // Constructor @@ -106,7 +106,7 @@ void SystemRuntimeMacOSX::Clear(bool clear_process) { m_process->ClearBreakpointSiteByID(m_break_id); if (clear_process) - m_process = NULL; + m_process = nullptr; m_break_id = LLDB_INVALID_BREAK_ID; } @@ -266,7 +266,7 @@ void SystemRuntimeMacOSX::ReadLibdispatchOffsetsAddress() { static ConstString g_dispatch_queue_offsets_symbol_name( "dispatch_queue_offsets"); - const Symbol *dispatch_queue_offsets_symbol = NULL; + const Symbol *dispatch_queue_offsets_symbol = nullptr; // libdispatch symbols were in libSystem.B.dylib up through Mac OS X 10.6 // ("Snow Leopard") @@ -279,7 +279,7 @@ void SystemRuntimeMacOSX::ReadLibdispatchOffsetsAddress() { // libdispatch symbols are in their own dylib as of Mac OS X 10.7 ("Lion") // and later - if (dispatch_queue_offsets_symbol == NULL) { + if (dispatch_queue_offsets_symbol == nullptr) { ModuleSpec libdispatch_module_spec(FileSpec("libdispatch.dylib")); module_sp = m_process->GetTarget().GetImages().FindFirstModule( libdispatch_module_spec); @@ -322,7 +322,7 @@ void SystemRuntimeMacOSX::ReadLibpthreadOffsetsAddress() { static ConstString g_libpthread_layout_offsets_symbol_name( "pthread_layout_offsets"); - const Symbol *libpthread_layout_offsets_symbol = NULL; + const Symbol *libpthread_layout_offsets_symbol = nullptr; ModuleSpec libpthread_module_spec(FileSpec("libsystem_pthread.dylib")); ModuleSP module_sp(m_process->GetTarget().GetImages().FindFirstModule( @@ -370,7 +370,7 @@ void SystemRuntimeMacOSX::ReadLibdispatchTSDIndexesAddress() { static ConstString g_libdispatch_tsd_indexes_symbol_name( "dispatch_tsd_indexes"); - const Symbol *libdispatch_tsd_indexes_symbol = NULL; + const Symbol *libdispatch_tsd_indexes_symbol = nullptr; ModuleSpec libpthread_module_spec(FileSpec("libdispatch.dylib")); ModuleSP module_sp(m_process->GetTarget().GetImages().FindFirstModule( @@ -726,7 +726,8 @@ void SystemRuntimeMacOSX::PopulateQueueList( for (ThreadSP thread_sp : m_process->Threads()) { if (thread_sp->GetAssociatedWithLibdispatchQueue() != eLazyBoolNo) { if (thread_sp->GetQueueID() != LLDB_INVALID_QUEUE_ID) { - if (queue_list.FindQueueByID(thread_sp->GetQueueID()).get() == NULL) { + if (queue_list.FindQueueByID(thread_sp->GetQueueID()).get() == + nullptr) { QueueSP queue_sp(new Queue(m_process->shared_from_this(), thread_sp->GetQueueID(), thread_sp->GetQueueName())); @@ -933,7 +934,7 @@ void SystemRuntimeMacOSX::PopulateQueuesUsingLibBTR( offset = start_of_this_item + m_lib_backtrace_recording_info.queue_info_data_offset; const char *queue_label = extractor.GetCStr(&offset); - if (queue_label == NULL) + if (queue_label == nullptr) queue_label = ""; offset_t start_of_next_item = start_of_this_item + offset_to_next; |

