summaryrefslogtreecommitdiff
path: root/lldb/source/Symbol/ClangASTContext.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
commit5b261d732b6b0b1e29be26ad80254f1544dcff61 (patch)
treeb9da1c886f65e0d2eb4a53ea21da2419f1534a08 /lldb/source/Symbol/ClangASTContext.cpp
parentfbf6864d1a804d6db312c6f22670caa5fe14564e (diff)
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
Diffstat (limited to 'lldb/source/Symbol/ClangASTContext.cpp')
-rw-r--r--lldb/source/Symbol/ClangASTContext.cpp20
1 files changed, 7 insertions, 13 deletions
diff --git a/lldb/source/Symbol/ClangASTContext.cpp b/lldb/source/Symbol/ClangASTContext.cpp
index c39590351c9..67e27f26e5b 100644
--- a/lldb/source/Symbol/ClangASTContext.cpp
+++ b/lldb/source/Symbol/ClangASTContext.cpp
@@ -992,9 +992,7 @@ TargetInfo *ClangASTContext::getTargetInfo() {
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 @@ CompilerType ClangASTContext::CreateObjCClass(const char *name,
}
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 @@ bool ClangASTContext::IsCXXClassType(const CompilerType &type) {
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 @@ uint32_t ClangASTContext::GetNumChildren(lldb::opaque_compiler_type_t type,
->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 @@ CompilerType ClangASTContext::GetChildCompilerTypeAtIndex(
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 @@ ClangASTContext::GetIndexOfChildWithName(lldb::opaque_compiler_type_t type,
->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 @@ void ClangASTContext::DumpValue(
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())