summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/Utility
diff options
context:
space:
mode:
authorPavel Labath <pavel@labath.sk>2019-07-01 11:09:15 +0000
committerPavel Labath <pavel@labath.sk>2019-07-01 11:09:15 +0000
commit0f73709cb7166c74c491a4dbdb32ec81c1990a3a (patch)
tree8270fe9fc3fbbe0260a5c87ca6fdefd7f0452e2a /lldb/source/Plugins/Process/Utility
parented13fef47741d0a8fcaefeedbe6dc47a8552b928 (diff)
downloadbcm5719-llvm-0f73709cb7166c74c491a4dbdb32ec81c1990a3a.tar.gz
bcm5719-llvm-0f73709cb7166c74c491a4dbdb32ec81c1990a3a.zip
Remove null checks of results of new expressions
operator new doesn't return a null pointer, even if one turns off exceptions (it calls std::terminate instead). Therefore, all of this is dead code. llvm-svn: 364744
Diffstat (limited to 'lldb/source/Plugins/Process/Utility')
-rw-r--r--lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp4
-rw-r--r--lldb/source/Plugins/Process/Utility/RegisterContextDarwin_i386.cpp3
-rw-r--r--lldb/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp3
3 files changed, 4 insertions, 6 deletions
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp
index e0d67d12d49..85d518a487b 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp
@@ -646,8 +646,8 @@ bool RegisterContextDarwin_arm64::WriteRegister(const RegisterInfo *reg_info,
bool RegisterContextDarwin_arm64::ReadAllRegisterValues(
lldb::DataBufferSP &data_sp) {
data_sp = std::make_shared<DataBufferHeap>(REG_CONTEXT_SIZE, 0);
- if (data_sp && ReadGPR(false) == KERN_SUCCESS &&
- ReadFPU(false) == KERN_SUCCESS && ReadEXC(false) == KERN_SUCCESS) {
+ if (ReadGPR(false) == KERN_SUCCESS && ReadFPU(false) == KERN_SUCCESS &&
+ ReadEXC(false) == KERN_SUCCESS) {
uint8_t *dst = data_sp->GetBytes();
::memcpy(dst, &gpr, sizeof(gpr));
dst += sizeof(gpr);
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_i386.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_i386.cpp
index 69b56242c86..820d280c37f 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_i386.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_i386.cpp
@@ -830,8 +830,7 @@ bool RegisterContextDarwin_i386::WriteRegister(const RegisterInfo *reg_info,
bool RegisterContextDarwin_i386::ReadAllRegisterValues(
lldb::DataBufferSP &data_sp) {
data_sp = std::make_shared<DataBufferHeap>(REG_CONTEXT_SIZE, 0);
- if (data_sp && ReadGPR(false) == 0 && ReadFPU(false) == 0 &&
- ReadEXC(false) == 0) {
+ if (ReadGPR(false) == 0 && ReadFPU(false) == 0 && ReadEXC(false) == 0) {
uint8_t *dst = data_sp->GetBytes();
::memcpy(dst, &gpr, sizeof(gpr));
dst += sizeof(gpr);
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp
index e908c6dffaf..62e512adc9f 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp
@@ -910,8 +910,7 @@ bool RegisterContextDarwin_x86_64::WriteRegister(const RegisterInfo *reg_info,
bool RegisterContextDarwin_x86_64::ReadAllRegisterValues(
lldb::DataBufferSP &data_sp) {
data_sp = std::make_shared<DataBufferHeap>(REG_CONTEXT_SIZE, 0);
- if (data_sp && ReadGPR(false) == 0 && ReadFPU(false) == 0 &&
- ReadEXC(false) == 0) {
+ if (ReadGPR(false) == 0 && ReadFPU(false) == 0 && ReadEXC(false) == 0) {
uint8_t *dst = data_sp->GetBytes();
::memcpy(dst, &gpr, sizeof(gpr));
dst += sizeof(gpr);
OpenPOWER on IntegriCloud