diff options
author | Eugene Zelenko <eugene.zelenko@gmail.com> | 2016-02-18 00:10:17 +0000 |
---|---|---|
committer | Eugene Zelenko <eugene.zelenko@gmail.com> | 2016-02-18 00:10:17 +0000 |
commit | 9394d772c0ef5c6a88fca777c9f1134811ce2555 (patch) | |
tree | faaea85ba98054896356a9d8541a00d04ed5d320 /lldb/source/Target/OperatingSystem.cpp | |
parent | 8e3061b8659cf3b75f766ab1f159fc73e01ed4b0 (diff) | |
download | bcm5719-llvm-9394d772c0ef5c6a88fca777c9f1134811ce2555.tar.gz bcm5719-llvm-9394d772c0ef5c6a88fca777c9f1134811ce2555.zip |
Fix Clang-tidy modernize-use-nullptr warnings; other minor fixes.
llvm-svn: 261179
Diffstat (limited to 'lldb/source/Target/OperatingSystem.cpp')
-rw-r--r-- | lldb/source/Target/OperatingSystem.cpp | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/lldb/source/Target/OperatingSystem.cpp b/lldb/source/Target/OperatingSystem.cpp index 8ba52683877..9b4f2120bef 100644 --- a/lldb/source/Target/OperatingSystem.cpp +++ b/lldb/source/Target/OperatingSystem.cpp @@ -1,4 +1,4 @@ -//===-- OperatingSystem.cpp --------------------------------------------*- C++ -*-===// +//===-- OperatingSystem.cpp -------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -7,22 +7,21 @@ // //===----------------------------------------------------------------------===// - -#include "lldb/Target/OperatingSystem.h" // C Includes // C++ Includes // Other libraries and framework includes +// Project includes +#include "lldb/Target/OperatingSystem.h" #include "lldb/Core/PluginManager.h" #include "lldb/Target/Thread.h" using namespace lldb; using namespace lldb_private; - OperatingSystem* OperatingSystem::FindPlugin (Process *process, const char *plugin_name) { - OperatingSystemCreateInstance create_callback = NULL; + OperatingSystemCreateInstance create_callback = nullptr; if (plugin_name) { ConstString const_plugin_name(plugin_name); @@ -30,20 +29,20 @@ OperatingSystem::FindPlugin (Process *process, const char *plugin_name) if (create_callback) { std::unique_ptr<OperatingSystem> instance_ap(create_callback(process, true)); - if (instance_ap.get()) + if (instance_ap) return instance_ap.release(); } } else { - for (uint32_t idx = 0; (create_callback = PluginManager::GetOperatingSystemCreateCallbackAtIndex(idx)) != NULL; ++idx) + for (uint32_t idx = 0; (create_callback = PluginManager::GetOperatingSystemCreateCallbackAtIndex(idx)) != nullptr; ++idx) { std::unique_ptr<OperatingSystem> instance_ap(create_callback(process, false)); - if (instance_ap.get()) + if (instance_ap) return instance_ap.release(); } } - return NULL; + return nullptr; } @@ -52,10 +51,7 @@ OperatingSystem::OperatingSystem (Process *process) : { } -OperatingSystem::~OperatingSystem() -{ -} - +OperatingSystem::~OperatingSystem() = default; bool OperatingSystem::IsOperatingSystemPluginThread (const lldb::ThreadSP &thread_sp) @@ -64,4 +60,3 @@ OperatingSystem::IsOperatingSystemPluginThread (const lldb::ThreadSP &thread_sp) return thread_sp->IsOperatingSystemPluginThread(); return false; } - |