summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2018-12-15 00:15:33 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2018-12-15 00:15:33 +0000
commita6682a413d893bc1ed6190dfadcee806155da66e (patch)
tree326b3a6e484e3a3a3a5087663e1284f9b594f2a8 /lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
parent9d1827331f3f9582fa2ed05913ae4301f2604a19 (diff)
downloadbcm5719-llvm-a6682a413d893bc1ed6190dfadcee806155da66e.tar.gz
bcm5719-llvm-a6682a413d893bc1ed6190dfadcee806155da66e.zip
Simplify Boolean expressions
This patch simplifies boolean expressions acorss LLDB. It was generated using clang-tidy with the following command: run-clang-tidy.py -checks='-*,readability-simplify-boolean-expr' -format -fix $PWD Differential revision: https://reviews.llvm.org/D55584 llvm-svn: 349215
Diffstat (limited to 'lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp')
-rw-r--r--lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp20
1 files changed, 7 insertions, 13 deletions
diff --git a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
index 551f038fa20..024f82800f6 100644
--- a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
+++ b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
@@ -387,8 +387,8 @@ DynamicLoaderDarwinKernel::ReadMachHeader(addr_t addr, Process *process, llvm::M
if (::memcmp (&header.magic, &magicks[i], sizeof (uint32_t)) == 0)
found_matching_pattern = true;
- if (found_matching_pattern == false)
- return false;
+ if (!found_matching_pattern)
+ return false;
if (header.magic == llvm::MachO::MH_CIGAM ||
header.magic == llvm::MachO::MH_CIGAM_64) {
@@ -424,7 +424,7 @@ DynamicLoaderDarwinKernel::CheckForKernelImageAtAddress(lldb::addr_t addr,
llvm::MachO::mach_header header;
- if (ReadMachHeader (addr, process, header) == false)
+ if (!ReadMachHeader(addr, process, header))
return UUID();
// First try a quick test -- read the first 4 bytes and see if there is a
@@ -604,16 +604,10 @@ void DynamicLoaderDarwinKernel::KextImageInfo::SetProcessStopId(
bool DynamicLoaderDarwinKernel::KextImageInfo::
operator==(const KextImageInfo &rhs) {
if (m_uuid.IsValid() || rhs.GetUUID().IsValid()) {
- if (m_uuid == rhs.GetUUID()) {
- return true;
- }
- return false;
+ return m_uuid == rhs.GetUUID();
}
- if (m_name == rhs.GetName() && m_load_address == rhs.GetLoadAddress())
- return true;
-
- return false;
+ return m_name == rhs.GetName() && m_load_address == rhs.GetLoadAddress();
}
void DynamicLoaderDarwinKernel::KextImageInfo::SetName(const char *name) {
@@ -731,7 +725,7 @@ bool DynamicLoaderDarwinKernel::KextImageInfo::ReadMemoryModule(
}
bool DynamicLoaderDarwinKernel::KextImageInfo::IsKernel() const {
- return m_kernel_image == true;
+ return m_kernel_image;
}
void DynamicLoaderDarwinKernel::KextImageInfo::SetIsKernel(bool is_kernel) {
@@ -1280,7 +1274,7 @@ bool DynamicLoaderDarwinKernel::ParseKextSummaries(
const uint32_t num_of_new_kexts = kext_summaries.size();
for (uint32_t new_kext = 0; new_kext < num_of_new_kexts; new_kext++) {
- if (to_be_added[new_kext] == true) {
+ if (to_be_added[new_kext]) {
KextImageInfo &image_info = kext_summaries[new_kext];
if (load_kexts) {
if (!image_info.LoadImageUsingMemoryModule(m_process)) {
OpenPOWER on IntegriCloud