mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-27 15:14:31 +00:00
Fix Clang-tidy modernize-use-nullptr warnings; other minor fixes.
llvm-svn: 261179
This commit is contained in:
1 parent
8e3061b865
commit
9394d772c0
12 files changed
+183
-265
No files matched your search
@@ -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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user