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
diff --git a/lldb/source/Symbol/ClangASTContext.cpp b/lldb/source/Symbol/ClangASTContext.cpp
index c395903..67e27f2 100644
--- a/lldb/source/Symbol/ClangASTContext.cpp
+++ b/lldb/source/Symbol/ClangASTContext.cpp
@@ -992,9 +992,7 @@
static inline bool QualTypeMatchesBitSize(const uint64_t bit_size,
ASTContext *ast, QualType qual_type) {
uint64_t qual_type_bit_size = ast->getTypeSize(qual_type);
- if (qual_type_bit_size == bit_size)
- return true;
- return false;
+ return qual_type_bit_size == bit_size;
}
CompilerType
@@ -1866,8 +1864,7 @@
}
static inline bool BaseSpecifierIsEmpty(const CXXBaseSpecifier *b) {
- return ClangASTContext::RecordHasFields(b->getType()->getAsCXXRecordDecl()) ==
- false;
+ return !ClangASTContext::RecordHasFields(b->getType()->getAsCXXRecordDecl());
}
uint32_t
@@ -3936,9 +3933,7 @@
return false;
clang::QualType qual_type(ClangUtil::GetCanonicalQualType(type));
- if (!qual_type.isNull() && qual_type->getAsCXXRecordDecl() != nullptr)
- return true;
- return false;
+ return !qual_type.isNull() && qual_type->getAsCXXRecordDecl() != nullptr;
}
bool ClangASTContext::IsBeingDefined(lldb::opaque_compiler_type_t type) {
@@ -5593,7 +5588,7 @@
->getDecl());
// Skip empty base classes
- if (ClangASTContext::RecordHasFields(base_class_decl) == false)
+ if (!ClangASTContext::RecordHasFields(base_class_decl))
continue;
num_children++;
@@ -6655,7 +6650,7 @@
if (omit_empty_base_classes) {
base_class_decl = llvm::cast<clang::CXXRecordDecl>(
base_class->getType()->getAs<clang::RecordType>()->getDecl());
- if (ClangASTContext::RecordHasFields(base_class_decl) == false)
+ if (!ClangASTContext::RecordHasFields(base_class_decl))
continue;
}
@@ -7450,7 +7445,7 @@
->getAs<clang::RecordType>()
->getDecl());
if (omit_empty_base_classes &&
- ClangASTContext::RecordHasFields(base_class_decl) == false)
+ !ClangASTContext::RecordHasFields(base_class_decl))
continue;
CompilerType base_class_clang_type(getASTContext(),
@@ -9105,8 +9100,7 @@
base_class->getType()->getAs<clang::RecordType>()->getDecl());
// Skip empty base classes
- if (verbose == false &&
- ClangASTContext::RecordHasFields(base_class_decl) == false)
+ if (!verbose && !ClangASTContext::RecordHasFields(base_class_decl))
continue;
if (base_class->isVirtual())