aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2022-01-01 11:15:14 -0800
committerKazu Hirata <kazu@google.com>2022-01-01 11:15:14 -0800
commit95f7112be8daa521e607fb3c231012a6d5eafa96 (patch)
tree944651d50a331cfa4c4c475e46496fc0eb202077 /lldb/source/Plugins
parent913457acf07be7f22d71ac41ad1076517d7f45c6 (diff)
downloadllvm-95f7112be8daa521e607fb3c231012a6d5eafa96.tar.gz
llvm-95f7112be8daa521e607fb3c231012a6d5eafa96.tar.bz2
llvm-95f7112be8daa521e607fb3c231012a6d5eafa96.zip
Revert "[lldb] Use nullptr instead of 0 or NULL (NFC)"
This reverts commit 913457acf07be7f22d71ac41ad1076517d7f45c6. It again broke builds on Windows: lldb/source/Host/common/HostNativeThreadBase.cpp(37,14): error: assigning to 'lldb::thread_result_t' (aka 'unsigned int') from incompatible type 'std::nullptr_t'
Diffstat (limited to 'lldb/source/Plugins')
-rw-r--r--lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp10
-rw-r--r--lldb/source/Plugins/ObjectFile/Minidump/MinidumpFileBuilder.cpp5
-rw-r--r--lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.cpp4
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp11
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h4
5 files changed, 16 insertions, 18 deletions
diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
index 30d7d239834b..e72d55dd2aba 100644
--- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
+++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
@@ -768,9 +768,9 @@ public:
// Write out the EXC registers
data.PutHex32(EXCRegSet);
data.PutHex32(EXCWordCount);
- PrintRegisterValue(reg_ctx, "far", nullptr, 8, data);
- PrintRegisterValue(reg_ctx, "esr", nullptr, 4, data);
- PrintRegisterValue(reg_ctx, "exception", nullptr, 4, data);
+ PrintRegisterValue(reg_ctx, "far", NULL, 8, data);
+ PrintRegisterValue(reg_ctx, "esr", NULL, 4, data);
+ PrintRegisterValue(reg_ctx, "exception", NULL, 4, data);
return true;
}
return false;
@@ -5073,7 +5073,7 @@ void ObjectFileMachO::GetAllArchSpecs(const llvm::MachO::mach_header &header,
lldb::offset_t offset = lc_offset;
for (uint32_t i = 0; i < header.ncmds; ++i) {
const lldb::offset_t cmd_offset = offset;
- if (data.GetU32(&offset, &load_cmd, 2) == nullptr)
+ if (data.GetU32(&offset, &load_cmd, 2) == NULL)
break;
llvm::MachO::version_min_command version_min;
@@ -5123,7 +5123,7 @@ void ObjectFileMachO::GetAllArchSpecs(const llvm::MachO::mach_header &header,
offset = lc_offset;
for (uint32_t i = 0; i < header.ncmds; ++i) {
const lldb::offset_t cmd_offset = offset;
- if (data.GetU32(&offset, &load_cmd, 2) == nullptr)
+ if (data.GetU32(&offset, &load_cmd, 2) == NULL)
break;
do {
diff --git a/lldb/source/Plugins/ObjectFile/Minidump/MinidumpFileBuilder.cpp b/lldb/source/Plugins/ObjectFile/Minidump/MinidumpFileBuilder.cpp
index 516bcb21b019..ef419d9a89e8 100644
--- a/lldb/source/Plugins/ObjectFile/Minidump/MinidumpFileBuilder.cpp
+++ b/lldb/source/Plugins/ObjectFile/Minidump/MinidumpFileBuilder.cpp
@@ -272,8 +272,7 @@ Status MinidumpFileBuilder::AddModuleList(Target &target) {
mod->GetObjectFile()->GetBaseAddress().GetLoadAddress(&target));
m.SizeOfImage = static_cast<llvm::support::ulittle32_t>(mod_size);
m.Checksum = static_cast<llvm::support::ulittle32_t>(0);
- m.TimeDateStamp =
- static_cast<llvm::support::ulittle32_t>(std::time(nullptr));
+ m.TimeDateStamp = static_cast<llvm::support::ulittle32_t>(std::time(0));
m.ModuleNameRVA = static_cast<llvm::support::ulittle32_t>(
size_before + module_stream_size + helper_data.GetByteSize());
m.VersionInfo = info;
@@ -720,7 +719,7 @@ Status MinidumpFileBuilder::Dump(lldb::FileUP &core_file) const {
header.Checksum = static_cast<llvm::support::ulittle32_t>(
0u), // not used in most of the writers
header.TimeDateStamp =
- static_cast<llvm::support::ulittle32_t>(std::time(nullptr));
+ static_cast<llvm::support::ulittle32_t>(std::time(0));
header.Flags =
static_cast<llvm::support::ulittle64_t>(0u); // minidump normal flag
diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.cpp b/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.cpp
index d6c4a8687ec5..6c130be7b741 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.cpp
@@ -178,10 +178,10 @@ static const lldb_private::RegisterSet g_reg_sets_arm64[k_num_register_sets] = {
g_sve_regnums_arm64}};
static const lldb_private::RegisterSet g_reg_set_pauth_arm64 = {
- "Pointer Authentication Registers", "pauth", k_num_pauth_register, nullptr};
+ "Pointer Authentication Registers", "pauth", k_num_pauth_register, NULL};
static const lldb_private::RegisterSet g_reg_set_mte_arm64 = {
- "MTE Control Register", "mte", k_num_mte_register, nullptr};
+ "MTE Control Register", "mte", k_num_mte_register, NULL};
RegisterInfoPOSIX_arm64::RegisterInfoPOSIX_arm64(
const lldb_private::ArchSpec &target_arch, lldb_private::Flags opt_regsets)
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
index be555c130bfe..b90f104c4d21 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
@@ -933,7 +933,7 @@ TypeSP DWARFASTParserClang::ParseSubroutine(const DWARFDIE &die,
DW_TAG_value_to_name(tag), type_name_cstr);
CompilerType return_clang_type;
- Type *func_type = nullptr;
+ Type *func_type = NULL;
if (attrs.type.IsValid())
func_type = dwarf->ResolveTypeUID(attrs.type.Reference(), true);
@@ -1027,7 +1027,7 @@ TypeSP DWARFASTParserClang::ParseSubroutine(const DWARFDIE &die,
class_opaque_type, attrs.name.GetCString(), clang_type,
attrs.accessibility, attrs.is_artificial, is_variadic,
attrs.is_objc_direct_call);
- type_handled = objc_method_decl != nullptr;
+ type_handled = objc_method_decl != NULL;
if (type_handled) {
LinkDeclContextToDIE(objc_method_decl, die);
m_ast.SetMetadataAsUserID(objc_method_decl, die.GetID());
@@ -1178,7 +1178,7 @@ TypeSP DWARFASTParserClang::ParseSubroutine(const DWARFDIE &die,
is_static, attrs.is_inline, attrs.is_explicit,
is_attr_used, attrs.is_artificial);
- type_handled = cxx_method_decl != nullptr;
+ type_handled = cxx_method_decl != NULL;
// Artificial methods are always handled even when we
// don't create a new declaration for them.
type_handled |= attrs.is_artificial;
@@ -2036,7 +2036,7 @@ bool DWARFASTParserClang::ParseTemplateDIE(
if (name && name[0])
template_param_infos.names.push_back(name);
else
- template_param_infos.names.push_back(nullptr);
+ template_param_infos.names.push_back(NULL);
// Get the signed value for any integer or enumeration if available
clang_type.IsIntegerOrEnumerationType(is_signed);
@@ -3336,8 +3336,7 @@ DWARFASTParserClang::GetOwningClangModule(const DWARFDIE &die) {
auto it = m_die_to_module.find(module_die.GetDIE());
if (it != m_die_to_module.end())
return it->second;
- const char *name =
- module_die.GetAttributeValueAsString(DW_AT_name, nullptr);
+ const char *name = module_die.GetAttributeValueAsString(DW_AT_name, 0);
if (!name)
return {};
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h
index 2457e8276e20..71d4c1e6c52f 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h
@@ -269,7 +269,7 @@ protected:
ExtractUnitDIENoDwoIfNeeded();
// m_first_die_mutex is not required as m_first_die is never cleared.
if (!m_first_die)
- return nullptr;
+ return NULL;
return &m_first_die;
}
@@ -277,7 +277,7 @@ protected:
const DWARFDebugInfoEntry *DIEPtr() {
ExtractDIEsIfNeeded();
if (m_die_array.empty())
- return nullptr;
+ return NULL;
return &m_die_array[0];
}