Index: include/lldb/Core/ModuleSpec.h =================================================================== --- include/lldb/Core/ModuleSpec.h +++ include/lldb/Core/ModuleSpec.h @@ -255,20 +255,20 @@ if (match_module_spec.GetFileSpecPtr()) { const FileSpec &fspec = match_module_spec.GetFileSpec(); if (!FileSpec::Equal(fspec, GetFileSpec(), - fspec.GetDirectory().IsEmpty() == false)) + !fspec.GetDirectory().IsEmpty())) return false; } if (GetPlatformFileSpec() && match_module_spec.GetPlatformFileSpecPtr()) { const FileSpec &fspec = match_module_spec.GetPlatformFileSpec(); if (!FileSpec::Equal(fspec, GetPlatformFileSpec(), - fspec.GetDirectory().IsEmpty() == false)) + !fspec.GetDirectory().IsEmpty())) return false; } // Only match the symbol file spec if there is one in this ModuleSpec if (GetSymbolFileSpec() && match_module_spec.GetSymbolFileSpecPtr()) { const FileSpec &fspec = match_module_spec.GetSymbolFileSpec(); if (!FileSpec::Equal(fspec, GetSymbolFileSpec(), - fspec.GetDirectory().IsEmpty() == false)) + !fspec.GetDirectory().IsEmpty())) return false; } if (match_module_spec.GetArchitecturePtr()) { Index: include/lldb/DataFormatters/TypeCategory.h =================================================================== --- include/lldb/DataFormatters/TypeCategory.h +++ include/lldb/DataFormatters/TypeCategory.h @@ -344,7 +344,7 @@ bool IsEnabled() const { return m_enabled; } uint32_t GetEnabledPosition() { - if (m_enabled == false) + if (!m_enabled) return UINT32_MAX; else return m_enabled_position; Index: include/lldb/Symbol/Symtab.h =================================================================== --- include/lldb/Symbol/Symtab.h +++ include/lldb/Symbol/Symtab.h @@ -168,12 +168,12 @@ Visibility symbol_visibility) const { switch (symbol_debug_type) { case eDebugNo: - if (m_symbols[idx].IsDebug() == true) + if (m_symbols[idx].IsDebug()) return false; break; case eDebugYes: - if (m_symbols[idx].IsDebug() == false) + if (!m_symbols[idx].IsDebug()) return false; break; Index: include/lldb/Target/Thread.h =================================================================== --- include/lldb/Target/Thread.h +++ include/lldb/Target/Thread.h @@ -280,7 +280,7 @@ /// message). //------------------------------------------------------------------ StructuredData::ObjectSP GetExtendedInfo() { - if (m_extended_info_fetched == false) { + if (!m_extended_info_fetched) { m_extended_info = FetchThreadExtendedInfo(); m_extended_info_fetched = true; } Index: include/lldb/Utility/StructuredData.h =================================================================== --- include/lldb/Utility/StructuredData.h +++ include/lldb/Utility/StructuredData.h @@ -170,7 +170,7 @@ bool ForEach(std::function const &foreach_callback) const { for (const auto &object_sp : m_items) { - if (foreach_callback(object_sp.get()) == false) + if (!foreach_callback(object_sp.get())) return false; } return true; @@ -359,7 +359,7 @@ void ForEach(std::function const &callback) const { for (const auto &pair : m_dict) { - if (callback(pair.first, pair.second.get()) == false) + if (!callback(pair.first, pair.second.get())) break; } } Index: source/API/SBQueue.cpp =================================================================== --- source/API/SBQueue.cpp +++ source/API/SBQueue.cpp @@ -107,7 +107,7 @@ } void FetchThreads() { - if (m_thread_list_fetched == false) { + if (!m_thread_list_fetched) { lldb::QueueSP queue_sp = m_queue_wp.lock(); if (queue_sp) { Process::StopLocker stop_locker; @@ -127,7 +127,7 @@ } void FetchItems() { - if (m_pending_items_fetched == false) { + if (!m_pending_items_fetched) { QueueSP queue_sp = m_queue_wp.lock(); if (queue_sp) { Process::StopLocker stop_locker; @@ -178,7 +178,7 @@ uint32_t result = 0; QueueSP queue_sp = m_queue_wp.lock(); - if (m_pending_items_fetched == false && queue_sp) { + if (!m_pending_items_fetched && queue_sp) { result = queue_sp->GetNumPendingWorkItems(); } else { result = m_pending_items.size(); Index: source/API/SBThread.cpp =================================================================== --- source/API/SBThread.cpp +++ source/API/SBThread.cpp @@ -571,7 +571,7 @@ success = true; } if (node->GetType() == eStructuredDataTypeBoolean) { - if (node->GetAsBoolean()->GetValue() == true) + if (node->GetAsBoolean()->GetValue()) strm.Printf("true"); else strm.Printf("false"); @@ -1470,7 +1470,7 @@ } } - if (log && sb_origin_thread.IsValid() == false) + if (log && !sb_origin_thread.IsValid()) log->Printf("SBThread(%p)::GetExtendedBacktraceThread() is not returning a " "Valid thread", static_cast(exe_ctx.GetThreadPtr())); Index: source/API/SBType.cpp =================================================================== --- source/API/SBType.cpp +++ source/API/SBType.cpp @@ -47,20 +47,20 @@ //{} // bool SBType::operator==(SBType &rhs) { - if (IsValid() == false) + if (!IsValid()) return !rhs.IsValid(); - if (rhs.IsValid() == false) + if (!rhs.IsValid()) return false; return *m_opaque_sp.get() == *rhs.m_opaque_sp.get(); } bool SBType::operator!=(SBType &rhs) { - if (IsValid() == false) + if (!IsValid()) return rhs.IsValid(); - if (rhs.IsValid() == false) + if (!rhs.IsValid()) return true; return *m_opaque_sp.get() != *rhs.m_opaque_sp.get(); Index: source/API/SBTypeCategory.cpp =================================================================== --- source/API/SBTypeCategory.cpp +++ source/API/SBTypeCategory.cpp @@ -529,14 +529,14 @@ } bool SBTypeCategory::operator==(lldb::SBTypeCategory &rhs) { - if (IsValid() == false) + if (!IsValid()) return !rhs.IsValid(); return m_opaque_sp.get() == rhs.m_opaque_sp.get(); } bool SBTypeCategory::operator!=(lldb::SBTypeCategory &rhs) { - if (IsValid() == false) + if (!IsValid()) return rhs.IsValid(); return m_opaque_sp.get() != rhs.m_opaque_sp.get(); Index: source/API/SBTypeFilter.cpp =================================================================== --- source/API/SBTypeFilter.cpp +++ source/API/SBTypeFilter.cpp @@ -91,14 +91,14 @@ } bool SBTypeFilter::operator==(lldb::SBTypeFilter &rhs) { - if (IsValid() == false) + if (!IsValid()) return !rhs.IsValid(); return m_opaque_sp == rhs.m_opaque_sp; } bool SBTypeFilter::IsEqualTo(lldb::SBTypeFilter &rhs) { - if (IsValid() == false) + if (!IsValid()) return !rhs.IsValid(); if (GetNumberOfExpressionPaths() != rhs.GetNumberOfExpressionPaths()) @@ -113,7 +113,7 @@ } bool SBTypeFilter::operator!=(lldb::SBTypeFilter &rhs) { - if (IsValid() == false) + if (!IsValid()) return !rhs.IsValid(); return m_opaque_sp != rhs.m_opaque_sp; Index: source/API/SBTypeFormat.cpp =================================================================== --- source/API/SBTypeFormat.cpp +++ source/API/SBTypeFormat.cpp @@ -88,13 +88,13 @@ } bool SBTypeFormat::operator==(lldb::SBTypeFormat &rhs) { - if (IsValid() == false) + if (!IsValid()) return !rhs.IsValid(); return m_opaque_sp == rhs.m_opaque_sp; } bool SBTypeFormat::IsEqualTo(lldb::SBTypeFormat &rhs) { - if (IsValid() == false) + if (!IsValid()) return !rhs.IsValid(); if (GetFormat() == rhs.GetFormat()) @@ -104,7 +104,7 @@ } bool SBTypeFormat::operator!=(lldb::SBTypeFormat &rhs) { - if (IsValid() == false) + if (!IsValid()) return !rhs.IsValid(); return m_opaque_sp != rhs.m_opaque_sp; } Index: source/API/SBTypeNameSpecifier.cpp =================================================================== --- source/API/SBTypeNameSpecifier.cpp +++ source/API/SBTypeNameSpecifier.cpp @@ -80,13 +80,13 @@ } bool SBTypeNameSpecifier::operator==(lldb::SBTypeNameSpecifier &rhs) { - if (IsValid() == false) + if (!IsValid()) return !rhs.IsValid(); return m_opaque_sp == rhs.m_opaque_sp; } bool SBTypeNameSpecifier::IsEqualTo(lldb::SBTypeNameSpecifier &rhs) { - if (IsValid() == false) + if (!IsValid()) return !rhs.IsValid(); if (IsRegex() != rhs.IsRegex()) @@ -98,7 +98,7 @@ } bool SBTypeNameSpecifier::operator!=(lldb::SBTypeNameSpecifier &rhs) { - if (IsValid() == false) + if (!IsValid()) return !rhs.IsValid(); return m_opaque_sp != rhs.m_opaque_sp; } Index: source/API/SBTypeSummary.cpp =================================================================== --- source/API/SBTypeSummary.cpp +++ source/API/SBTypeSummary.cpp @@ -261,7 +261,7 @@ } bool SBTypeSummary::operator==(lldb::SBTypeSummary &rhs) { - if (IsValid() == false) + if (!IsValid()) return !rhs.IsValid(); return m_opaque_sp == rhs.m_opaque_sp; } @@ -305,7 +305,7 @@ } bool SBTypeSummary::operator!=(lldb::SBTypeSummary &rhs) { - if (IsValid() == false) + if (!IsValid()) return !rhs.IsValid(); return m_opaque_sp != rhs.m_opaque_sp; } Index: source/API/SBTypeSynthetic.cpp =================================================================== --- source/API/SBTypeSynthetic.cpp +++ source/API/SBTypeSynthetic.cpp @@ -106,13 +106,13 @@ } bool SBTypeSynthetic::operator==(lldb::SBTypeSynthetic &rhs) { - if (IsValid() == false) + if (!IsValid()) return !rhs.IsValid(); return m_opaque_sp == rhs.m_opaque_sp; } bool SBTypeSynthetic::IsEqualTo(lldb::SBTypeSynthetic &rhs) { - if (IsValid() == false) + if (!IsValid()) return !rhs.IsValid(); if (m_opaque_sp->IsScripted() != rhs.m_opaque_sp->IsScripted()) @@ -128,7 +128,7 @@ } bool SBTypeSynthetic::operator!=(lldb::SBTypeSynthetic &rhs) { - if (IsValid() == false) + if (!IsValid()) return !rhs.IsValid(); return m_opaque_sp != rhs.m_opaque_sp; } Index: source/API/SBValue.cpp =================================================================== --- source/API/SBValue.cpp +++ source/API/SBValue.cpp @@ -98,10 +98,7 @@ // they depend on. So I have no good way to make that check without // tracking that in all the ValueObject subclasses. TargetSP target_sp = m_valobj_sp->GetTargetSP(); - if (target_sp && target_sp->IsValid()) - return true; - else - return false; + return target_sp && target_sp->IsValid(); } } Index: source/Breakpoint/Watchpoint.cpp =================================================================== --- source/Breakpoint/Watchpoint.cpp +++ source/Breakpoint/Watchpoint.cpp @@ -131,10 +131,7 @@ bool Watchpoint::ShouldStop(StoppointCallbackContext *context) { IncrementHitCount(); - if (!IsEnabled()) - return false; - - return true; + return IsEnabled(); } void Watchpoint::GetDescription(Stream *s, lldb::DescriptionLevel level) { Index: source/Commands/CommandObjectExpression.cpp =================================================================== --- source/Commands/CommandObjectExpression.cpp +++ source/Commands/CommandObjectExpression.cpp @@ -420,8 +420,7 @@ if (m_command_options.auto_apply_fixits == eLazyBoolCalculate) auto_apply_fixits = target->GetEnableAutoApplyFixIts(); else - auto_apply_fixits = - m_command_options.auto_apply_fixits == eLazyBoolYes ? true : false; + auto_apply_fixits = m_command_options.auto_apply_fixits == eLazyBoolYes; options.SetAutoApplyFixIts(auto_apply_fixits); Index: source/Commands/CommandObjectQuit.cpp =================================================================== --- source/Commands/CommandObjectQuit.cpp +++ source/Commands/CommandObjectQuit.cpp @@ -31,7 +31,7 @@ // if all alive processes will be detached when you quit and false if at least // one process will be killed instead bool CommandObjectQuit::ShouldAskForConfirmation(bool &is_a_detach) { - if (m_interpreter.GetPromptOnQuit() == false) + if (!m_interpreter.GetPromptOnQuit()) return false; bool should_prompt = false; is_a_detach = true; @@ -51,7 +51,7 @@ if (process_sp && process_sp->IsValid() && process_sp->IsAlive() && process_sp->WarnBeforeDetach()) { should_prompt = true; - if (process_sp->GetShouldDetach() == false) { + if (!process_sp->GetShouldDetach()) { // if we need to kill at least one process, just say so and return is_a_detach = false; return should_prompt; Index: source/Commands/CommandObjectWatchpoint.cpp =================================================================== --- source/Commands/CommandObjectWatchpoint.cpp +++ source/Commands/CommandObjectWatchpoint.cpp @@ -138,11 +138,9 @@ return false; wp_ids.push_back(beg); } - // It is an error if after the loop, we're still in_range. - if (in_range) - return false; - return true; // Success! + // It is an error if after the loop, we're still in_range. + return !in_range; } //------------------------------------------------------------------------- Index: source/Core/Disassembler.cpp =================================================================== --- source/Core/Disassembler.cpp +++ source/Core/Disassembler.cpp @@ -452,8 +452,7 @@ if (mixed_source_and_assembly && sc.line_entry.IsValid()) { if (sc.symbol != previous_symbol) { SourceLine decl_line = GetFunctionDeclLineEntry(sc); - if (ElideMixedSourceAndDisassemblyLine(exe_ctx, sc, decl_line) == - false) + if (!ElideMixedSourceAndDisassemblyLine(exe_ctx, sc, decl_line)) AddLineToSourceLineTables(decl_line, source_lines_seen); } if (sc.line_entry.IsValid()) { @@ -461,8 +460,7 @@ this_line.file = sc.line_entry.file; this_line.line = sc.line_entry.line; this_line.column = sc.line_entry.column; - if (ElideMixedSourceAndDisassemblyLine(exe_ctx, sc, this_line) == - false) + if (!ElideMixedSourceAndDisassemblyLine(exe_ctx, sc, this_line)) AddLineToSourceLineTables(this_line, source_lines_seen); } } @@ -506,8 +504,8 @@ previous_symbol = sc.symbol; if (sc.function && sc.line_entry.IsValid()) { LineEntry prologue_end_line = sc.line_entry; - if (ElideMixedSourceAndDisassemblyLine( - exe_ctx, sc, prologue_end_line) == false) { + if (!ElideMixedSourceAndDisassemblyLine(exe_ctx, sc, + prologue_end_line)) { FileSpec func_decl_file; uint32_t func_decl_line; sc.function->GetStartLineSourceInfo(func_decl_file, @@ -547,8 +545,8 @@ this_line.file = sc.line_entry.file; this_line.line = sc.line_entry.line; - if (ElideMixedSourceAndDisassemblyLine(exe_ctx, sc, - this_line) == false) { + if (!ElideMixedSourceAndDisassemblyLine(exe_ctx, sc, + this_line)) { // Only print this source line if it is different from the // last source line we printed. There may have been inlined // functions between these lines that we elided, resulting in Index: source/Core/Listener.cpp =================================================================== --- source/Core/Listener.cpp +++ source/Core/Listener.cpp @@ -251,9 +251,7 @@ return false; } - if (m_event_type_mask == 0 || m_event_type_mask & event_sp->GetType()) - return true; - return false; + return m_event_type_mask == 0 || m_event_type_mask & event_sp->GetType(); } private: Index: source/Core/Mangled.cpp =================================================================== --- source/Core/Mangled.cpp +++ source/Core/Mangled.cpp @@ -419,9 +419,7 @@ return true; ConstString demangled = GetDemangledName(language); - if (demangled && regex.Execute(demangled.AsCString())) - return true; - return false; + return demangled && regex.Execute(demangled.AsCString()); } //---------------------------------------------------------------------- Index: source/Core/SearchFilter.cpp =================================================================== --- source/Core/SearchFilter.cpp +++ source/Core/SearchFilter.cpp @@ -388,10 +388,7 @@ bool SearchFilterForUnconstrainedSearches::ModulePasses( const FileSpec &module_spec) { - if (m_target_sp->ModuleIsExcludedForUnconstrainedSearches(module_spec)) - return false; - else - return true; + return !m_target_sp->ModuleIsExcludedForUnconstrainedSearches(module_spec); } bool SearchFilterForUnconstrainedSearches::ModulePasses( @@ -570,22 +567,15 @@ if (m_module_spec_list.GetSize() == 0) return true; - if (module_sp && - m_module_spec_list.FindFileIndex(0, module_sp->GetFileSpec(), false) != - UINT32_MAX) - return true; - else - return false; + return module_sp && m_module_spec_list.FindFileIndex( + 0, module_sp->GetFileSpec(), false) != UINT32_MAX; } bool SearchFilterByModuleList::ModulePasses(const FileSpec &spec) { if (m_module_spec_list.GetSize() == 0) return true; - if (m_module_spec_list.FindFileIndex(0, spec, true) != UINT32_MAX) - return true; - else - return false; + return m_module_spec_list.FindFileIndex(0, spec, true) != UINT32_MAX; } bool SearchFilterByModuleList::AddressPasses(Address &address) { Index: source/Core/SourceManager.cpp =================================================================== --- source/Core/SourceManager.cpp +++ source/Core/SourceManager.cpp @@ -486,7 +486,7 @@ if (end_offset > start_offset) { uint32_t length = end_offset - start_offset; - if (include_newline_chars == false) { + if (!include_newline_chars) { const char *line_start = (const char *)m_data_sp->GetBytes() + start_offset; while (length > 0) { Index: source/Core/ValueObject.cpp =================================================================== --- source/Core/ValueObject.cpp +++ source/Core/ValueObject.cpp @@ -214,7 +214,7 @@ if (first_update) SetValueDidChange(false); - else if (!m_value_did_change && success == false) { + else if (!m_value_did_change && !success) { // The value wasn't gotten successfully, so we mark this as changed if // the value used to be valid and now isn't SetValueDidChange(value_was_valid); @@ -442,10 +442,7 @@ } bool ret; - if (scalar_value.ULongLong(1) == 0) - ret = false; - else - ret = true; + ret = scalar_value.ULongLong(1) != 0; error.Clear(); return ret; } @@ -639,7 +636,7 @@ bool child_is_deref_of_parent = false; uint64_t language_flags = 0; - const bool transparent_pointers = synthetic_array_member == false; + const bool transparent_pointers = !synthetic_array_member; CompilerType child_compiler_type; ExecutionContext exe_ctx(GetExecutionContextRef()); @@ -1921,11 +1918,11 @@ } void ValueObject::CalculateSyntheticValue(bool use_synthetic) { - if (use_synthetic == false) + if (!use_synthetic) return; TargetSP target_sp(GetTargetSP()); - if (target_sp && target_sp->GetEnableSyntheticValue() == false) { + if (target_sp && !target_sp->GetEnableSyntheticValue()) { m_synthetic_value = NULL; return; } @@ -1976,7 +1973,7 @@ lldb::ValueObjectSP ValueObject::GetNonSyntheticValue() { return GetSP(); } ValueObjectSP ValueObject::GetSyntheticValue(bool use_synthetic) { - if (use_synthetic == false) + if (!use_synthetic) return ValueObjectSP(); CalculateSyntheticValue(use_synthetic); @@ -1995,10 +1992,7 @@ CalculateSyntheticValue(true); - if (m_synthetic_value) - return true; - else - return false; + return m_synthetic_value != nullptr; } bool ValueObject::GetBaseClassPath(Stream &s) { @@ -3195,7 +3189,7 @@ ValueObject::FollowParentChain(std::function f) { ValueObject *vo = this; while (vo) { - if (f(vo) == false) + if (!f(vo)) break; vo = vo->m_parent; } @@ -3264,8 +3258,7 @@ // board debugging scenarios have no notion of types, but still manage to // have raw numeric values for things like registers. sigh. const CompilerType &type(GetCompilerType()); - return (false == type.IsValid()) || - (0 != (type.GetTypeInfo() & eTypeHasValue)); + return (!type.IsValid()) || (0 != (type.GetTypeInfo() & eTypeHasValue)); } bool ValueObject::IsChecksumEmpty() { return m_value_checksum.empty(); } Index: source/Core/ValueObjectChild.cpp =================================================================== --- source/Core/ValueObjectChild.cpp +++ source/Core/ValueObjectChild.cpp @@ -124,7 +124,7 @@ Flags parent_type_flags(parent_type.GetTypeInfo()); const bool is_instance_ptr_base = - ((m_is_base_class == true) && + ((m_is_base_class) && (parent_type_flags.AnySet(lldb::eTypeInstanceIsPointer))); if (parent->GetCompilerType().ShouldTreatScalarValueAsAddress()) { @@ -142,7 +142,7 @@ switch (addr_type) { case eAddressTypeFile: { lldb::ProcessSP process_sp(GetProcessSP()); - if (process_sp && process_sp->IsAlive() == true) + if (process_sp && process_sp->IsAlive()) m_value.SetValueType(Value::eValueTypeLoadAddress); else m_value.SetValueType(Value::eValueTypeFileAddress); Index: source/Core/ValueObjectConstResultImpl.cpp =================================================================== --- source/Core/ValueObjectConstResultImpl.cpp +++ source/Core/ValueObjectConstResultImpl.cpp @@ -66,7 +66,7 @@ bool child_is_deref_of_parent = false; uint64_t language_flags; - const bool transparent_pointers = synthetic_array_member == false; + const bool transparent_pointers = !synthetic_array_member; CompilerType compiler_type = m_impl_backend->GetCompilerType(); CompilerType child_compiler_type; Index: source/Core/ValueObjectSyntheticFilter.cpp =================================================================== --- source/Core/ValueObjectSyntheticFilter.cpp +++ source/Core/ValueObjectSyntheticFilter.cpp @@ -119,7 +119,7 @@ if (m_might_have_children == eLazyBoolCalculate) m_might_have_children = (m_synth_filter_ap->MightHaveChildren() ? eLazyBoolYes : eLazyBoolNo); - return (m_might_have_children == eLazyBoolNo ? false : true); + return (m_might_have_children != eLazyBoolNo); } uint64_t ValueObjectSynthetic::GetByteSize() { return m_parent->GetByteSize(); } @@ -174,7 +174,7 @@ } // let our backend do its update - if (m_synth_filter_ap->Update() == false) { + if (!m_synth_filter_ap->Update()) { if (log) log->Printf("[ValueObjectSynthetic::UpdateValue] name=%s, synthetic " "filter said caches are stale - clearing", @@ -235,7 +235,7 @@ UpdateValueIfNeeded(); ValueObject *valobj; - if (m_children_byindex.GetValueForKey(idx, valobj) == false) { + if (!m_children_byindex.GetValueForKey(idx, valobj)) { if (can_create && m_synth_filter_ap.get() != nullptr) { if (log) log->Printf("[ValueObjectSynthetic::GetChildAtIndex] name=%s, child at " Index: source/DataFormatters/CXXFunctionPointer.cpp =================================================================== --- source/DataFormatters/CXXFunctionPointer.cpp +++ source/DataFormatters/CXXFunctionPointer.cpp @@ -38,7 +38,7 @@ Address so_addr; Target *target = exe_ctx.GetTargetPtr(); - if (target && target->GetSectionLoadList().IsEmpty() == false) { + if (target && !target->GetSectionLoadList().IsEmpty()) { if (target->GetSectionLoadList().ResolveLoadAddress(func_ptr_address, so_addr)) { so_addr.Dump(&sstr, exe_ctx.GetBestExecutionContextScope(), Index: source/DataFormatters/DataVisualization.cpp =================================================================== --- source/DataFormatters/DataVisualization.cpp +++ source/DataFormatters/DataVisualization.cpp @@ -145,7 +145,7 @@ } void DataVisualization::Categories::Disable(const ConstString &category) { - if (GetFormatManager().GetCategory(category)->IsEnabled() == true) + if (GetFormatManager().GetCategory(category)->IsEnabled()) GetFormatManager().DisableCategory(category); } @@ -166,7 +166,7 @@ void DataVisualization::Categories::Disable( const lldb::TypeCategoryImplSP &category) { - if (category.get() && category->IsEnabled() == true) + if (category.get() && category->IsEnabled()) GetFormatManager().DisableCategory(category); } Index: source/DataFormatters/DumpValueObjectOptions.cpp =================================================================== --- source/DataFormatters/DumpValueObjectOptions.cpp +++ source/DataFormatters/DumpValueObjectOptions.cpp @@ -67,7 +67,7 @@ } DumpValueObjectOptions &DumpValueObjectOptions::SetShowSummary(bool show) { - if (show == false) + if (!show) SetOmitSummaryDepth(UINT32_MAX); else SetOmitSummaryDepth(0); Index: source/DataFormatters/FormatManager.cpp =================================================================== --- source/DataFormatters/FormatManager.cpp +++ source/DataFormatters/FormatManager.cpp @@ -293,7 +293,7 @@ uint32_t prio_category = UINT32_MAX; for (uint32_t category_id = 0; category_id < num_categories; category_id++) { category_sp = GetCategoryAtIndex(category_id); - if (category_sp->IsEnabled() == false) + if (!category_sp->IsEnabled()) continue; lldb::TypeFormatImplSP format_current_sp = category_sp->GetFormatForType(type_sp); @@ -317,7 +317,7 @@ uint32_t prio_category = UINT32_MAX; for (uint32_t category_id = 0; category_id < num_categories; category_id++) { category_sp = GetCategoryAtIndex(category_id); - if (category_sp->IsEnabled() == false) + if (!category_sp->IsEnabled()) continue; lldb::TypeSummaryImplSP summary_current_sp = category_sp->GetSummaryForType(type_sp); @@ -341,7 +341,7 @@ uint32_t prio_category = UINT32_MAX; for (uint32_t category_id = 0; category_id < num_categories; category_id++) { category_sp = GetCategoryAtIndex(category_id); - if (category_sp->IsEnabled() == false) + if (!category_sp->IsEnabled()) continue; lldb::TypeFilterImplSP filter_current_sp( (TypeFilterImpl *)category_sp->GetFilterForType(type_sp).get()); @@ -366,7 +366,7 @@ uint32_t prio_category = UINT32_MAX; for (uint32_t category_id = 0; category_id < num_categories; category_id++) { category_sp = GetCategoryAtIndex(category_id); - if (category_sp->IsEnabled() == false) + if (!category_sp->IsEnabled()) continue; lldb::ScriptedSyntheticChildrenSP synth_current_sp( (ScriptedSyntheticChildren *)category_sp->GetSyntheticForType(type_sp) @@ -406,7 +406,7 @@ uint32_t prio_category = UINT32_MAX; for (uint32_t category_id = 0; category_id < num_categories; category_id++) { category_sp = GetCategoryAtIndex(category_id); - if (category_sp->IsEnabled() == false) + if (!category_sp->IsEnabled()) continue; lldb::TypeValidatorImplSP validator_current_sp( category_sp->GetValidatorForType(type_sp).get()); @@ -479,7 +479,7 @@ bool FormatManager::ShouldPrintAsOneLiner(ValueObject &valobj) { // if settings say no oneline whatsoever if (valobj.GetTargetSP().get() && - valobj.GetTargetSP()->GetDebugger().GetAutoOneLineSummaries() == false) + !valobj.GetTargetSP()->GetDebugger().GetAutoOneLineSummaries()) return false; // then don't oneline // if this object has a summary, then ask the summary @@ -535,7 +535,7 @@ if (!synth_sp) return false; // but if we only have them to provide a value, keep going - if (synth_sp->MightHaveChildren() == false && + if (!synth_sp->MightHaveChildren() && synth_sp->DoesProvideSyntheticValue()) is_synth_val = true; else Index: source/DataFormatters/StringPrinter.cpp =================================================================== --- source/DataFormatters/StringPrinter.cpp +++ source/DataFormatters/StringPrinter.cpp @@ -312,7 +312,7 @@ utf8_data_end_ptr = utf8_data_ptr + utf8_data_buffer_sp->GetByteSize(); ConvertFunction(&data_ptr, data_end_ptr, &utf8_data_ptr, utf8_data_end_ptr, llvm::lenientConversion); - if (false == zero_is_terminator) + if (!zero_is_terminator) utf8_data_end_ptr = utf8_data_ptr; // needed because the ConvertFunction will change the value of the // data_ptr. Index: source/DataFormatters/TypeCategory.cpp =================================================================== --- source/DataFormatters/TypeCategory.cpp +++ source/DataFormatters/TypeCategory.cpp @@ -157,10 +157,7 @@ else /*if (filter_sp.get() && synth.get())*/ { - if (filter_sp->GetRevision() > synth->GetRevision()) - pick_synth = false; - else - pick_synth = true; + pick_synth = filter_sp->GetRevision() <= synth->GetRevision(); } if (pick_synth) { if (regex_synth && reason) Index: source/DataFormatters/TypeCategoryMap.cpp =================================================================== --- source/DataFormatters/TypeCategoryMap.cpp +++ source/DataFormatters/TypeCategoryMap.cpp @@ -118,8 +118,7 @@ void TypeCategoryMap::DisableAllCategories() { std::lock_guard guard(m_map_mutex); - Position p = First; - for (; false == m_active_categories.empty(); p++) { + for (Position p = First; !m_active_categories.empty(); p++) { m_active_categories.front()->SetEnabledPosition(p); Disable(m_active_categories.front()); } Index: source/DataFormatters/TypeFormat.cpp =================================================================== --- source/DataFormatters/TypeFormat.cpp +++ source/DataFormatters/TypeFormat.cpp @@ -178,7 +178,7 @@ } } else valobj_enum_type = iter->second; - if (valobj_enum_type.IsValid() == false) + if (!valobj_enum_type.IsValid()) return false; DataExtractor data; Status error; Index: source/DataFormatters/TypeSummary.cpp =================================================================== --- source/DataFormatters/TypeSummary.cpp +++ source/DataFormatters/TypeSummary.cpp @@ -135,7 +135,7 @@ const TypeSummaryOptions &options) { dest.clear(); StreamString stream; - if (!m_impl || m_impl(*valobj, stream, options) == false) + if (!m_impl || !m_impl(*valobj, stream, options)) return false; dest = stream.GetString(); return true; Index: source/DataFormatters/ValueObjectPrinter.cpp =================================================================== --- source/DataFormatters/ValueObjectPrinter.cpp +++ source/DataFormatters/ValueObjectPrinter.cpp @@ -129,13 +129,13 @@ } if (m_valobj->IsSynthetic()) { - if (m_options.m_use_synthetic == false) { + if (!m_options.m_use_synthetic) { ValueObject *non_synthetic = m_valobj->GetNonSyntheticValue().get(); if (non_synthetic) m_valobj = non_synthetic; } } else { - if (m_options.m_use_synthetic == true) { + if (m_options.m_use_synthetic) { ValueObject *synthetic = m_valobj->GetSyntheticValue().get(); if (synthetic) m_valobj = synthetic; @@ -166,7 +166,7 @@ bool ValueObjectPrinter::ShouldPrintValueObject() { if (m_should_print == eLazyBoolCalculate) m_should_print = - (m_options.m_flat_output == false || m_type_flags.Test(eTypeHasValue)) + (!m_options.m_flat_output || m_type_flags.Test(eTypeHasValue)) ? eLazyBoolYes : eLazyBoolNo; return m_should_print == eLazyBoolYes; @@ -326,7 +326,7 @@ } TypeSummaryImpl *ValueObjectPrinter::GetSummaryFormatter(bool null_if_omitted) { - if (m_summary_formatter.second == false) { + if (!m_summary_formatter.second) { TypeSummaryImpl *entry = m_options.m_summary_sp ? m_options.m_summary_sp.get() : m_valobj->GetSummaryFormat().get(); @@ -458,7 +458,7 @@ else m_stream->Printf("%s\n", object_desc); return true; - } else if (value_printed == false && summary_printed == false) + } else if (!value_printed && !summary_printed) return true; else return false; @@ -625,7 +625,7 @@ if (!IsAggregate()) return false; - if (m_options.m_reveal_empty_aggregates == false) { + if (!m_options.m_reveal_empty_aggregates) { if (value_printed || summary_printed) return false; } Index: source/Expression/DWARFExpression.cpp =================================================================== --- source/Expression/DWARFExpression.cpp +++ source/Expression/DWARFExpression.cpp @@ -1839,7 +1839,7 @@ error_ptr->SetErrorString( "Expression stack needs at least 1 item for DW_OP_abs."); return false; - } else if (stack.back().ResolveValue(exe_ctx).AbsoluteValue() == false) { + } else if (!stack.back().ResolveValue(exe_ctx).AbsoluteValue()) { if (error_ptr) error_ptr->SetErrorString( "Failed to take the absolute value of the first stack item."); @@ -1972,7 +1972,7 @@ "Expression stack needs at least 1 item for DW_OP_neg."); return false; } else { - if (stack.back().ResolveValue(exe_ctx).UnaryNegate() == false) { + if (!stack.back().ResolveValue(exe_ctx).UnaryNegate()) { if (error_ptr) error_ptr->SetErrorString("Unary negate failed."); return false; @@ -1993,7 +1993,7 @@ "Expression stack needs at least 1 item for DW_OP_not."); return false; } else { - if (stack.back().ResolveValue(exe_ctx).OnesComplement() == false) { + if (!stack.back().ResolveValue(exe_ctx).OnesComplement()) { if (error_ptr) error_ptr->SetErrorString("Logical NOT failed."); return false; @@ -2100,8 +2100,8 @@ } else { tmp = stack.back(); stack.pop_back(); - if (stack.back().ResolveValue(exe_ctx).ShiftRightLogical( - tmp.ResolveValue(exe_ctx)) == false) { + if (!stack.back().ResolveValue(exe_ctx).ShiftRightLogical( + tmp.ResolveValue(exe_ctx))) { if (error_ptr) error_ptr->SetErrorString("DW_OP_shr failed."); return false; Index: source/Expression/ExpressionSourceCode.cpp =================================================================== --- source/Expression/ExpressionSourceCode.cpp +++ source/Expression/ExpressionSourceCode.cpp @@ -105,10 +105,7 @@ if (m_file_stack.back() != m_current_file) return true; - if (line >= m_current_file_line) - return false; - else - return true; + return line < m_current_file_line; default: return false; } @@ -378,7 +375,5 @@ return false; start_loc += strlen(start_marker); end_loc = transformed_text.find(end_marker); - if (end_loc == std::string::npos) - return false; - return true; + return end_loc != std::string::npos; } Index: source/Expression/Materializer.cpp =================================================================== --- source/Expression/Materializer.cpp +++ source/Expression/Materializer.cpp @@ -528,7 +528,7 @@ if (data.GetByteSize() < m_variable_sp->GetType()->GetByteSize()) { if (data.GetByteSize() == 0 && - m_variable_sp->LocationExpression().IsValid() == false) { + !m_variable_sp->LocationExpression().IsValid()) { err.SetErrorStringWithFormat("the variable '%s' has no location, " "it may have been optimized out", m_variable_sp->GetName().AsCString()); Index: source/Host/common/Editline.cpp =================================================================== --- source/Host/common/Editline.cpp +++ source/Host/common/Editline.cpp @@ -430,7 +430,7 @@ // Treat moving from the "live" entry differently if (!m_in_history) { - if (earlier == false) + if (!earlier) return CC_ERROR; // Can't go newer than the "live" entry if (history_w(pHistory, &history_event, H_FIRST) == -1) return CC_ERROR; Index: source/Host/common/FileCache.cpp =================================================================== --- source/Host/common/FileCache.cpp +++ source/Host/common/FileCache.cpp @@ -32,7 +32,7 @@ } FileSP file_sp(new File()); error = FileSystem::Instance().Open(*file_sp, file_spec, flags, mode); - if (file_sp->IsValid() == false) + if (!file_sp->IsValid()) return UINT64_MAX; lldb::user_id_t fd = file_sp->GetDescriptor(); m_cache[fd] = file_sp; Index: source/Host/common/ProcessRunLock.cpp =================================================================== --- source/Host/common/ProcessRunLock.cpp +++ source/Host/common/ProcessRunLock.cpp @@ -30,7 +30,7 @@ bool ProcessRunLock::ReadTryLock() { ::pthread_rwlock_rdlock(&m_rwlock); - if (m_running == false) { + if (!m_running) { return true; } ::pthread_rwlock_unlock(&m_rwlock); Index: source/Host/common/Symbols.cpp =================================================================== --- source/Host/common/Symbols.cpp +++ source/Host/common/Symbols.cpp @@ -215,7 +215,7 @@ ModuleSpec dsym_module_spec; // First try and find the dSYM in the same directory as the executable or in // an appropriate parent directory - if (LocateDSYMInVincinityOfExecutable(module_spec, symbol_fspec) == false) { + if (!LocateDSYMInVincinityOfExecutable(module_spec, symbol_fspec)) { // We failed to easily find the dSYM above, so use DebugSymbols LocateMacOSXFilesUsingDebugSymbols(module_spec, dsym_module_spec); } else { Index: source/Host/common/XML.cpp =================================================================== --- source/Host/common/XML.cpp +++ source/Host/common/XML.cpp @@ -201,8 +201,7 @@ llvm::StringRef attr_value; if (child->content) attr_value = llvm::StringRef((const char *)child->content); - if (callback(llvm::StringRef((const char *)attr->name), attr_value) == - false) + if (!callback(llvm::StringRef((const char *)attr->name), attr_value)) return; } } @@ -217,7 +216,7 @@ if (IsValid()) { // iterate through all siblings for (xmlNodePtr node = m_node; node; node = node->next) { - if (callback(XMLNode(node)) == false) + if (!callback(XMLNode(node))) return; } } @@ -234,7 +233,7 @@ if (node->type != XML_ELEMENT_NODE) continue; - if (callback(XMLNode(node)) == false) + if (!callback(XMLNode(node))) return; } } @@ -263,7 +262,7 @@ // ignore this one } - if (callback(XMLNode(node)) == false) + if (!callback(XMLNode(node))) return; } } Index: source/Host/macosx/Symbols.cpp =================================================================== --- source/Host/macosx/Symbols.cpp +++ source/Host/macosx/Symbols.cpp @@ -399,7 +399,7 @@ // DBGSourcePath values (the "values" half of key-value path pairs) // were wrong. Ignore them and use the universal DBGSourcePath // string from earlier. - if (new_style_source_remapping_dictionary == true && + if (new_style_source_remapping_dictionary && !original_DBGSourcePath_value.empty()) { DBGSourcePath = original_DBGSourcePath_value; } @@ -475,7 +475,7 @@ // it once per lldb run and cache the result. static bool g_have_checked_for_dbgshell_command = false; static const char *g_dbgshell_command = NULL; - if (g_have_checked_for_dbgshell_command == false) { + if (!g_have_checked_for_dbgshell_command) { g_have_checked_for_dbgshell_command = true; CFTypeRef defaults_setting = CFPreferencesCopyAppValue( CFSTR("DBGShellCommands"), CFSTR("com.apple.DebugSymbols")); @@ -495,7 +495,7 @@ // When g_dbgshell_command is NULL, the user has not enabled the use of an // external program to find the symbols, don't run it for them. - if (force_lookup == false && g_dbgshell_command == NULL) { + if (!force_lookup && g_dbgshell_command == NULL) { return false; } Index: source/Host/macosx/cfcpp/CFCMutableArray.cpp =================================================================== --- source/Host/macosx/cfcpp/CFCMutableArray.cpp +++ source/Host/macosx/cfcpp/CFCMutableArray.cpp @@ -88,7 +88,7 @@ bool CFCMutableArray::AppendValue(const void *value, bool can_create) { CFMutableArrayRef array = get(); if (array == NULL) { - if (can_create == false) + if (!can_create) return false; array = ::CFArrayCreateMutable(kCFAllocatorDefault, 0, &kCFTypeArrayCallBacks); @@ -106,7 +106,7 @@ bool can_create) { CFMutableArrayRef array = get(); if (array == NULL) { - if (can_create == false) + if (!can_create) return false; array = ::CFArrayCreateMutable(kCFAllocatorDefault, 0, &kCFTypeArrayCallBacks); @@ -124,7 +124,7 @@ const char *s, bool can_create) { CFMutableArrayRef array = get(); if (array == NULL) { - if (can_create == false) + if (!can_create) return false; array = ::CFArrayCreateMutable(kCFAllocatorDefault, 0, &kCFTypeArrayCallBacks); Index: source/Host/macosx/cfcpp/CFCMutableSet.cpp =================================================================== --- source/Host/macosx/cfcpp/CFCMutableSet.cpp +++ source/Host/macosx/cfcpp/CFCMutableSet.cpp @@ -60,7 +60,7 @@ const void *CFCMutableSet::AddValue(const void *value, bool can_create) { CFMutableSetRef set = get(); if (set == NULL) { - if (can_create == false) + if (!can_create) return NULL; set = ::CFSetCreateMutable(kCFAllocatorDefault, 0, &kCFTypeSetCallBacks); reset(set); Index: source/Host/macosx/objcxx/Host.mm =================================================================== --- source/Host/macosx/objcxx/Host.mm +++ source/Host/macosx/objcxx/Host.mm @@ -486,11 +486,9 @@ bool host_cpu_is_64bit; uint32_t is64bit_capable; size_t is64bit_capable_len = sizeof(is64bit_capable); - if (sysctlbyname("hw.cpu64bit_capable", &is64bit_capable, - &is64bit_capable_len, NULL, 0) == 0) - host_cpu_is_64bit = true; - else - host_cpu_is_64bit = false; + host_cpu_is_64bit = + sysctlbyname("hw.cpu64bit_capable", &is64bit_capable, + &is64bit_capable_len, NULL, 0) == 0; // if the host is an armv8 device, its cpusubtype will be in // CPU_SUBTYPE_ARM64 numbering @@ -660,7 +658,7 @@ if (our_uid == 0) kinfo_user_matches = true; - if (kinfo_user_matches == false || // Make sure the user is acceptable + if (!kinfo_user_matches || // Make sure the user is acceptable static_cast(kinfo.kp_proc.p_pid) == our_pid || // Skip this process kinfo.kp_proc.p_pid == 0 || // Skip kernel (kernel pid is zero) Index: source/Interpreter/CommandInterpreter.cpp =================================================================== --- source/Interpreter/CommandInterpreter.cpp +++ source/Interpreter/CommandInterpreter.cpp @@ -987,16 +987,16 @@ if (!name.empty()) { // do not allow replacement of internal commands if (CommandExists(name)) { - if (can_replace == false) + if (!can_replace) return false; - if (m_command_dict[name]->IsRemovable() == false) + if (!m_command_dict[name]->IsRemovable()) return false; } if (UserCommandExists(name)) { - if (can_replace == false) + if (!can_replace) return false; - if (m_user_dict[name]->IsRemovable() == false) + if (!m_user_dict[name]->IsRemovable()) return false; } @@ -2131,7 +2131,7 @@ profilePath.AppendPathComponent(".lldbinit"); std::string init_file_path = profilePath.GetPath(); - if (m_skip_app_init_files == false) { + if (!m_skip_app_init_files) { FileSpec program_file_spec(HostInfo::GetProgramFileSpec()); const char *program_name = program_file_spec.GetFilename().AsCString(); @@ -2769,7 +2769,7 @@ return; const bool is_interactive = io_handler.GetIsInteractive(); - if (is_interactive == false) { + if (!is_interactive) { // When we are not interactive, don't execute blank lines. This will happen // sourcing a commands file. We don't want blank lines to repeat the // previous command and cause any errors to occur (like redefining an @@ -3018,8 +3018,7 @@ bool is_alias = GetAliasFullName(next_word, full_name); cmd_obj = GetCommandObject(next_word, &matches); bool is_real_command = - (is_alias == false) || - (cmd_obj != nullptr && cmd_obj->IsAlias() == false); + (!is_alias) || (cmd_obj != nullptr && !cmd_obj->IsAlias()); if (!is_real_command) { matches.Clear(); std::string alias_result; Index: source/Interpreter/CommandObject.cpp =================================================================== --- source/Interpreter/CommandObject.cpp +++ source/Interpreter/CommandObject.cpp @@ -409,15 +409,12 @@ } bool CommandObject::IsPairType(ArgumentRepetitionType arg_repeat_type) { - if ((arg_repeat_type == eArgRepeatPairPlain) || - (arg_repeat_type == eArgRepeatPairOptional) || - (arg_repeat_type == eArgRepeatPairPlus) || - (arg_repeat_type == eArgRepeatPairStar) || - (arg_repeat_type == eArgRepeatPairRange) || - (arg_repeat_type == eArgRepeatPairRangeOptional)) - return true; - - return false; + return (arg_repeat_type == eArgRepeatPairPlain) || + (arg_repeat_type == eArgRepeatPairOptional) || + (arg_repeat_type == eArgRepeatPairPlus) || + (arg_repeat_type == eArgRepeatPairStar) || + (arg_repeat_type == eArgRepeatPairRange) || + (arg_repeat_type == eArgRepeatPairRangeOptional); } static CommandObject::CommandArgumentEntry Index: source/Interpreter/OptionGroupVariable.cpp =================================================================== --- source/Interpreter/OptionGroupVariable.cpp +++ source/Interpreter/OptionGroupVariable.cpp @@ -55,8 +55,8 @@ if (!str || !str[0]) return Status("must specify a valid named summary"); TypeSummaryImplSP summary_sp; - if (DataVisualization::NamedSummaryFormats::GetSummaryFormat( - ConstString(str), summary_sp) == false) + if (!DataVisualization::NamedSummaryFormats::GetSummaryFormat( + ConstString(str), summary_sp)) return Status("must specify a valid named summary"); return Status(); } Index: source/Interpreter/OptionValueProperties.cpp =================================================================== --- source/Interpreter/OptionValueProperties.cpp +++ source/Interpreter/OptionValueProperties.cpp @@ -38,7 +38,7 @@ for (size_t i = 0; i < num_properties; ++i) { // Duplicate any values that are not global when constructing properties // from a global copy - if (m_properties[i].IsGlobal() == false) { + if (!m_properties[i].IsGlobal()) { lldb::OptionValueSP new_value_sp(m_properties[i].GetValue()->DeepCopy()); m_properties[i].SetOptionValue(new_value_sp); } @@ -212,7 +212,7 @@ else { // Don't set an error if the path contained .experimental. - those are // allowed to be missing and should silently fail. - if (name_contains_experimental == false && error.AsCString() == nullptr) { + if (!name_contains_experimental && error.AsCString() == nullptr) { error.SetErrorStringWithFormat("invalid value path '%s'", name.str().c_str()); } } Index: source/Interpreter/Options.cpp =================================================================== --- source/Interpreter/Options.cpp +++ source/Interpreter/Options.cpp @@ -457,7 +457,7 @@ } } - if (options.empty() == false) { + if (!options.empty()) { // We have some required options with no arguments strm.PutCString(" -"); for (i = 0; i < 2; ++i) @@ -476,14 +476,14 @@ if (def.usage_mask & opt_set_mask && isprint8(def.short_option)) { // Add current option to the end of out_stream. - if (def.required == false && + if (!def.required && def.option_has_arg == OptionParser::eNoArgument) { options.insert(def.short_option); } } } - if (options.empty() == false) { + if (!options.empty()) { // We have some required options with no arguments strm.PutCString(" [-"); for (i = 0; i < 2; ++i) Index: source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp =================================================================== --- source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp +++ source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp @@ -1440,10 +1440,7 @@ ~1ull; // clear bit zero since the CPSR will take care of the mode for us // Set "pc" to the address requested - if (!reg_ctx->WriteRegisterFromUnsigned(pc_reg_num, function_addr)) - return false; - - return true; + return reg_ctx->WriteRegisterFromUnsigned(pc_reg_num, function_addr); } bool ABISysV_arm::GetArgumentValues(Thread &thread, ValueList &values) const { Index: source/Plugins/ABI/SysV-s390x/ABISysV_s390x.h =================================================================== --- source/Plugins/ABI/SysV-s390x/ABISysV_s390x.h +++ source/Plugins/ABI/SysV-s390x/ABISysV_s390x.h @@ -57,9 +57,7 @@ bool CodeAddressIsValid(lldb::addr_t pc) override { // Code addressed must be 2 byte aligned - if (pc & 1ull) - return false; - return true; + return (pc & 1ull) == 0; } const lldb_private::RegisterInfo * Index: source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp =================================================================== --- source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp +++ source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp @@ -1336,10 +1336,7 @@ if (triple.getArch() == llvm::Triple::x86 || triple.getArch() == llvm::Triple::x86_64) { - if (strcmp(flavor, "intel") == 0 || strcmp(flavor, "att") == 0) - return true; - else - return false; + return strcmp(flavor, "intel") == 0 || strcmp(flavor, "att") == 0; } else return false; } Index: source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp =================================================================== --- source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp +++ source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp @@ -387,8 +387,8 @@ 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 @@ 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 @@ 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::IsKernel() const { - return m_kernel_image == true; + return m_kernel_image; } void DynamicLoaderDarwinKernel::KextImageInfo::SetIsKernel(bool is_kernel) { @@ -1280,7 +1274,7 @@ 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)) { Index: source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp =================================================================== --- source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp +++ source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp @@ -359,16 +359,18 @@ if (image_sp.get() == nullptr || image_sp->GetAsDictionary() == nullptr) return false; StructuredData::Dictionary *image = image_sp->GetAsDictionary(); - if (image->HasKey("load_address") == false || - image->HasKey("pathname") == false || - image->HasKey("mod_date") == false || - image->HasKey("mach_header") == false || + // clang-format off + if (!image->HasKey("load_address") || + !image->HasKey("pathname") || + !image->HasKey("mod_date") || + !image->HasKey("mach_header") || image->GetValueForKey("mach_header")->GetAsDictionary() == nullptr || - image->HasKey("segments") == false || + !image->HasKey("segments") || image->GetValueForKey("segments")->GetAsArray() == nullptr || - image->HasKey("uuid") == false) { + !image->HasKey("uuid")) { return false; } + // clang-format on image_infos[i].address = image->GetValueForKey("load_address")->GetAsInteger()->GetValue(); image_infos[i].mod_date = @@ -712,11 +714,7 @@ return false; ObjCLanguageRuntime *objc_runtime = m_process->GetObjCLanguageRuntime(); - if (objc_runtime != NULL && objc_runtime->IsModuleObjCLibrary(module_sp)) { - return true; - } - - return false; + return objc_runtime != NULL && objc_runtime->IsModuleObjCLibrary(module_sp); } //---------------------------------------------------------------------- Index: source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.cpp =================================================================== --- source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.cpp +++ source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.cpp @@ -65,7 +65,7 @@ } } - if (UseDYLDSPI(process) == false) { + if (!UseDYLDSPI(process)) { create = false; } @@ -503,8 +503,7 @@ info_dict->GetValueForKey("shared_cache_uuid")->GetStringValue(); if (!uuid_str.empty()) uuid.SetFromStringRef(uuid_str); - if (info_dict->GetValueForKey("no_shared_cache")->GetBooleanValue() == - false) + if (!info_dict->GetValueForKey("no_shared_cache")->GetBooleanValue()) using_shared_cache = eLazyBoolYes; else using_shared_cache = eLazyBoolNo; Index: source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp =================================================================== --- source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp +++ source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp @@ -85,7 +85,7 @@ } } - if (UseDYLDSPI(process) == true) { + if (UseDYLDSPI(process)) { create = false; } @@ -122,12 +122,12 @@ // value differs from the Process' image info address. When a process // execs itself it might cause a change if ASLR is enabled. const addr_t shlib_addr = m_process->GetImageInfoAddress(); - if (m_process_image_addr_is_all_images_infos == true && + if (m_process_image_addr_is_all_images_infos && shlib_addr != m_dyld_all_image_infos_addr) { // The image info address from the process is the // 'dyld_all_image_infos' address and it has changed. did_exec = true; - } else if (m_process_image_addr_is_all_images_infos == false && + } else if (!m_process_image_addr_is_all_images_infos && shlib_addr == m_dyld.address) { // The image info address from the process is the mach_header address // for dyld and it has changed. Index: source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp =================================================================== --- source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp +++ source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp @@ -455,14 +455,10 @@ // On Android L (API 21, 22) the load address of the "/system/bin/linker" // isn't filled in correctly. unsigned os_major = target.GetPlatform()->GetOSVersion().getMajor(); - if (target.GetArchitecture().GetTriple().isAndroid() && - (os_major == 21 || os_major == 22) && - (file_path == "/system/bin/linker" || - file_path == "/system/bin/linker64")) { - return true; - } - - return false; + return target.GetArchitecture().GetTriple().isAndroid() && + (os_major == 21 || os_major == 22) && + (file_path == "/system/bin/linker" || + file_path == "/system/bin/linker64"); } void DYLDRendezvous::UpdateBaseAddrIfNecessary(SOEntry &entry, Index: source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp =================================================================== --- source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp +++ source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp @@ -117,7 +117,7 @@ EvalSpecialModulesStatus(); // if we dont have a load address we cant re-base - bool rebase_exec = (load_offset == LLDB_INVALID_ADDRESS) ? false : true; + bool rebase_exec = load_offset != LLDB_INVALID_ADDRESS; // if we have a valid executable if (executable_sp.get()) { Index: source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp =================================================================== --- source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp +++ source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp @@ -778,12 +778,9 @@ StringRef name_string_ref = name.GetStringRef(); // The ClangASTSource is not responsible for finding $-names. - if (name_string_ref.empty() || - (ignore_all_dollar_names && name_string_ref.startswith("$")) || - name_string_ref.startswith("_$")) - return true; - - return false; + return name_string_ref.empty() || + (ignore_all_dollar_names && name_string_ref.startswith("$")) || + name_string_ref.startswith("_$"); } void ClangASTSource::FindExternalVisibleDecls( Index: source/Plugins/ExpressionParser/Clang/IRForTarget.cpp =================================================================== --- source/Plugins/ExpressionParser/Clang/IRForTarget.cpp +++ source/Plugins/ExpressionParser/Clang/IRForTarget.cpp @@ -778,11 +778,8 @@ static bool IsObjCSelectorRef(Value *value) { GlobalVariable *global_variable = dyn_cast(value); - if (!global_variable || !global_variable->hasName() || - !global_variable->getName().startswith("OBJC_SELECTOR_REFERENCES_")) - return false; - - return true; + return !(!global_variable || !global_variable->hasName() || + !global_variable->getName().startswith("OBJC_SELECTOR_REFERENCES_")); } // This function does not report errors; its callers are responsible. @@ -953,11 +950,8 @@ static bool IsObjCClassReference(Value *value) { GlobalVariable *global_variable = dyn_cast(value); - if (!global_variable || !global_variable->hasName() || - !global_variable->getName().startswith("OBJC_CLASS_REFERENCES_")) - return false; - - return true; + return !(!global_variable || !global_variable->hasName() || + !global_variable->getName().startswith("OBJC_CLASS_REFERENCES_")); } // This function does not report errors; its callers are responsible. @@ -1259,12 +1253,9 @@ llvm::NextPowerOf2(constant_size) * 8); lldb_private::Status get_data_error; - if (!scalar.GetAsMemoryData(data, constant_size, - lldb_private::endian::InlHostByteOrder(), - get_data_error)) - return false; - - return true; + return scalar.GetAsMemoryData(data, constant_size, + lldb_private::endian::InlHostByteOrder(), + get_data_error) != 0; } else if (ConstantDataArray *array_initializer = dyn_cast(initializer)) { if (array_initializer->isString()) { Index: source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp =================================================================== --- source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp +++ source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp @@ -776,10 +776,7 @@ uint32_t random_data = rand(); const uint32_t addr_byte_size = GetAddressByteSize(); - if (!MemAWrite(context, address, random_data, addr_byte_size)) - return false; - - return true; + return MemAWrite(context, address, random_data, addr_byte_size); } // Write "bits (32) UNKNOWN" to register n. Helper function for many ARM @@ -3340,10 +3337,7 @@ EmulateInstruction::Context context; context.type = EmulateInstruction::eContextImmediate; context.SetNoArgs(); - if (!WriteFlags(context, res.result, res.carry_out, res.overflow)) - return false; - - return true; + return WriteFlags(context, res.result, res.carry_out, res.overflow); } // Compare Negative (register) adds a register value and an optionally-shifted @@ -3410,10 +3404,7 @@ EmulateInstruction::Context context; context.type = EmulateInstruction::eContextImmediate; context.SetNoArgs(); - if (!WriteFlags(context, res.result, res.carry_out, res.overflow)) - return false; - - return true; + return WriteFlags(context, res.result, res.carry_out, res.overflow); } // Compare (immediate) subtracts an immediate value from a register value. It @@ -3463,10 +3454,7 @@ EmulateInstruction::Context context; context.type = EmulateInstruction::eContextImmediate; context.SetNoArgs(); - if (!WriteFlags(context, res.result, res.carry_out, res.overflow)) - return false; - - return true; + return WriteFlags(context, res.result, res.carry_out, res.overflow); } // Compare (register) subtracts an optionally-shifted register value from a @@ -3542,10 +3530,7 @@ EmulateInstruction::Context context; context.type = EmulateInstruction::eContextImmediate; context.SetNoArgs(); - if (!WriteFlags(context, res.result, res.carry_out, res.overflow)) - return false; - - return true; + return WriteFlags(context, res.result, res.carry_out, res.overflow); } // Arithmetic Shift Right (immediate) shifts a register value right by an @@ -9245,11 +9230,8 @@ context.type = EmulateInstruction::eContextImmediate; context.SetNoArgs(); - if (!WriteCoreRegOptionalFlags(context, res.result, Rd, setflags, - res.carry_out, res.overflow)) - return false; - - return true; + return WriteCoreRegOptionalFlags(context, res.result, Rd, setflags, + res.carry_out, res.overflow); } // Reverse Subtract (register) subtracts a register value from an optionally- @@ -9326,11 +9308,8 @@ EmulateInstruction::Context context; context.type = EmulateInstruction::eContextImmediate; context.SetNoArgs(); - if (!WriteCoreRegOptionalFlags(context, res.result, Rd, setflags, - res.carry_out, res.overflow)) - return false; - - return true; + return WriteCoreRegOptionalFlags(context, res.result, Rd, setflags, + res.carry_out, res.overflow); } // Reverse Subtract with Carry (immediate) subtracts a register value and the @@ -9388,11 +9367,8 @@ context.type = EmulateInstruction::eContextImmediate; context.SetNoArgs(); - if (!WriteCoreRegOptionalFlags(context, res.result, Rd, setflags, - res.carry_out, res.overflow)) - return false; - - return true; + return WriteCoreRegOptionalFlags(context, res.result, Rd, setflags, + res.carry_out, res.overflow); } // Reverse Subtract with Carry (register) subtracts a register value and the @@ -9460,11 +9436,8 @@ EmulateInstruction::Context context; context.type = EmulateInstruction::eContextImmediate; context.SetNoArgs(); - if (!WriteCoreRegOptionalFlags(context, res.result, Rd, setflags, - res.carry_out, res.overflow)) - return false; - - return true; + return WriteCoreRegOptionalFlags(context, res.result, Rd, setflags, + res.carry_out, res.overflow); } // Subtract with Carry (immediate) subtracts an immediate value and the value @@ -9531,11 +9504,8 @@ context.type = EmulateInstruction::eContextImmediate; context.SetNoArgs(); - if (!WriteCoreRegOptionalFlags(context, res.result, Rd, setflags, - res.carry_out, res.overflow)) - return false; - - return true; + return WriteCoreRegOptionalFlags(context, res.result, Rd, setflags, + res.carry_out, res.overflow); } // Subtract with Carry (register) subtracts an optionally-shifted register @@ -9620,11 +9590,8 @@ EmulateInstruction::Context context; context.type = EmulateInstruction::eContextImmediate; context.SetNoArgs(); - if (!WriteCoreRegOptionalFlags(context, res.result, Rd, setflags, - res.carry_out, res.overflow)) - return false; - - return true; + return WriteCoreRegOptionalFlags(context, res.result, Rd, setflags, + res.carry_out, res.overflow); } // This instruction subtracts an immediate value from a register value, and @@ -9713,11 +9680,8 @@ context.type = EmulateInstruction::eContextImmediate; context.SetNoArgs(); - if (!WriteCoreRegOptionalFlags(context, res.result, Rd, setflags, - res.carry_out, res.overflow)) - return false; - - return true; + return WriteCoreRegOptionalFlags(context, res.result, Rd, setflags, + res.carry_out, res.overflow); } // This instruction subtracts an immediate value from a register value, and @@ -14153,11 +14117,8 @@ else target = addr & 0xfffffffe; - if (!WriteRegisterUnsigned(context, eRegisterKindGeneric, - LLDB_REGNUM_GENERIC_PC, target)) - return false; - - return true; + return WriteRegisterUnsigned(context, eRegisterKindGeneric, + LLDB_REGNUM_GENERIC_PC, target); } // As a side effect, BXWritePC sets context.arg2 to eModeARM or eModeThumb by @@ -14191,11 +14152,8 @@ LLDB_REGNUM_GENERIC_FLAGS, m_new_inst_cpsr)) return false; } - if (!WriteRegisterUnsigned(context, eRegisterKindGeneric, - LLDB_REGNUM_GENERIC_PC, target)) - return false; - - return true; + return WriteRegisterUnsigned(context, eRegisterKindGeneric, + LLDB_REGNUM_GENERIC_PC, target); } // Dispatches to either BXWritePC or BranchWritePC based on architecture @@ -14408,14 +14366,14 @@ evaluate_options & eEmulateInstructionOptionIgnoreConditions; bool success = false; - if (m_opcode_cpsr == 0 || m_ignore_conditions == false) { + if (m_opcode_cpsr == 0 || !m_ignore_conditions) { m_opcode_cpsr = ReadRegisterUnsigned(eRegisterKindDWARF, dwarf_cpsr, 0, &success); } // Only return false if we are unable to read the CPSR if we care about // conditions - if (success == false && m_ignore_conditions == false) + if (!success && !m_ignore_conditions) return false; uint32_t orig_pc_value = 0; Index: source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp =================================================================== --- source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp +++ source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp @@ -436,7 +436,7 @@ // Only return false if we are unable to read the CPSR if we care about // conditions - if (success == false && m_ignore_conditions == false) + if (!success && !m_ignore_conditions) return false; uint32_t orig_pc_value = 0; @@ -546,11 +546,8 @@ } else return false; - if (!WriteRegisterUnsigned(context, eRegisterKindGeneric, - LLDB_REGNUM_GENERIC_PC, addr)) - return false; - - return true; + return WriteRegisterUnsigned(context, eRegisterKindGeneric, + LLDB_REGNUM_GENERIC_PC, addr); } bool EmulateInstructionARM64::ConditionHolds(const uint32_t cond) { @@ -1096,9 +1093,7 @@ return false; } - if (!BranchTo(context, 64, target)) - return false; - return true; + return BranchTo(context, 64, target); } bool EmulateInstructionARM64::EmulateBcond(const uint32_t opcode) { Index: source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp =================================================================== --- source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp +++ source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp @@ -220,10 +220,8 @@ } bool EmulateInstructionMIPS::SetTargetTriple(const ArchSpec &arch) { - if (arch.GetTriple().getArch() == llvm::Triple::mips || - arch.GetTriple().getArch() == llvm::Triple::mipsel) - return true; - return false; + return arch.GetTriple().getArch() == llvm::Triple::mips || + arch.GetTriple().getArch() == llvm::Triple::mipsel; } const char *EmulateInstructionMIPS::GetRegisterName(unsigned reg_num, @@ -1350,10 +1348,7 @@ context.type = eContextPopRegisterOffStack; context.SetAddress(address); - if (!WriteRegister(context, ®_info_src, data_src)) - return false; - - return true; + return WriteRegister(context, ®_info_src, data_src); } return false; @@ -1450,11 +1445,8 @@ context.SetImmediateSigned(imm); context.type = eContextImmediate; - if (WriteRegisterUnsigned(context, eRegisterKindDWARF, dwarf_zero_mips + rt, - imm)) - return true; - - return false; + return WriteRegisterUnsigned(context, eRegisterKindDWARF, + dwarf_zero_mips + rt, imm); } bool EmulateInstructionMIPS::Emulate_ADDIUSP(llvm::MCInst &insn) { @@ -1697,10 +1689,7 @@ context.type = eContextPopRegisterOffStack; context.SetAddress(base_address); - if (!WriteRegister(context, ®_info_src, data_src)) - return false; - - return true; + return WriteRegister(context, ®_info_src, data_src); } return false; @@ -1807,11 +1796,8 @@ context.type = eContextAdjustStackPointer; // update SP - if (!WriteRegisterUnsigned(context, eRegisterKindDWARF, dwarf_sp_mips, - result)) - return false; - - return true; + return WriteRegisterUnsigned(context, eRegisterKindDWARF, dwarf_sp_mips, + result); } static int IsAdd64bitOverflow(int32_t a, int32_t b) { @@ -1864,11 +1850,8 @@ context.type = eContextRelativeBranchImmediate; context.SetImmediate(offset); - if (!WriteRegisterUnsigned(context, eRegisterKindDWARF, dwarf_pc_mips, - target)) - return false; - - return true; + return WriteRegisterUnsigned(context, eRegisterKindDWARF, dwarf_pc_mips, + target); } /* @@ -1947,11 +1930,8 @@ context.type = eContextRelativeBranchImmediate; context.SetImmediate(current_inst_size + offset); - if (!WriteRegisterUnsigned(context, eRegisterKindDWARF, dwarf_pc_mips, - target)) - return false; - - return true; + return WriteRegisterUnsigned(context, eRegisterKindDWARF, dwarf_pc_mips, + target); } /* @@ -2122,11 +2102,8 @@ context.type = eContextRelativeBranchImmediate; context.SetImmediate(offset); - if (!WriteRegisterUnsigned(context, eRegisterKindDWARF, dwarf_pc_mips, - target)) - return false; - - return true; + return WriteRegisterUnsigned(context, eRegisterKindDWARF, dwarf_pc_mips, + target); } /* @@ -2189,11 +2166,8 @@ context.type = eContextRelativeBranchImmediate; context.SetImmediate(current_inst_size + offset); - if (!WriteRegisterUnsigned(context, eRegisterKindDWARF, dwarf_pc_mips, - target)) - return false; - - return true; + return WriteRegisterUnsigned(context, eRegisterKindDWARF, dwarf_pc_mips, + target); } bool EmulateInstructionMIPS::Emulate_B16_MM(llvm::MCInst &insn) { @@ -2214,11 +2188,8 @@ context.type = eContextRelativeBranchImmediate; context.SetImmediate(current_inst_size + offset); - if (!WriteRegisterUnsigned(context, eRegisterKindDWARF, dwarf_pc_mips, - target)) - return false; - - return true; + return WriteRegisterUnsigned(context, eRegisterKindDWARF, dwarf_pc_mips, + target); } /* @@ -2529,11 +2500,8 @@ Context context; - if (!WriteRegisterUnsigned(context, eRegisterKindDWARF, dwarf_pc_mips, - target)) - return false; - - return true; + return WriteRegisterUnsigned(context, eRegisterKindDWARF, dwarf_pc_mips, + target); } bool EmulateInstructionMIPS::Emulate_J(llvm::MCInst &insn) { @@ -2556,10 +2524,7 @@ Context context; - if (!WriteRegisterUnsigned(context, eRegisterKindDWARF, dwarf_pc_mips, pc)) - return false; - - return true; + return WriteRegisterUnsigned(context, eRegisterKindDWARF, dwarf_pc_mips, pc); } bool EmulateInstructionMIPS::Emulate_JAL(llvm::MCInst &insn) { @@ -2688,11 +2653,8 @@ Context context; - if (!WriteRegisterUnsigned(context, eRegisterKindDWARF, dwarf_pc_mips, - target)) - return false; - - return true; + return WriteRegisterUnsigned(context, eRegisterKindDWARF, dwarf_pc_mips, + target); } bool EmulateInstructionMIPS::Emulate_JR(llvm::MCInst &insn) { @@ -2713,11 +2675,8 @@ Context context; - if (!WriteRegisterUnsigned(context, eRegisterKindDWARF, dwarf_pc_mips, - rs_val)) - return false; - - return true; + return WriteRegisterUnsigned(context, eRegisterKindDWARF, dwarf_pc_mips, + rs_val); } /* @@ -2758,11 +2717,8 @@ } Context context; - if (!WriteRegisterUnsigned(context, eRegisterKindDWARF, dwarf_pc_mips, - target)) - return false; - - return true; + return WriteRegisterUnsigned(context, eRegisterKindDWARF, dwarf_pc_mips, + target); } bool EmulateInstructionMIPS::Emulate_BC1EQZ(llvm::MCInst &insn) { @@ -2797,11 +2753,8 @@ Context context; - if (!WriteRegisterUnsigned(context, eRegisterKindDWARF, dwarf_pc_mips, - target)) - return false; - - return true; + return WriteRegisterUnsigned(context, eRegisterKindDWARF, dwarf_pc_mips, + target); } bool EmulateInstructionMIPS::Emulate_BC1NEZ(llvm::MCInst &insn) { @@ -2836,11 +2789,8 @@ Context context; - if (!WriteRegisterUnsigned(context, eRegisterKindDWARF, dwarf_pc_mips, - target)) - return false; - - return true; + return WriteRegisterUnsigned(context, eRegisterKindDWARF, dwarf_pc_mips, + target); } /* @@ -2898,11 +2848,8 @@ } Context context; - if (!WriteRegisterUnsigned(context, eRegisterKindDWARF, dwarf_pc_mips, - target)) - return false; - - return true; + return WriteRegisterUnsigned(context, eRegisterKindDWARF, dwarf_pc_mips, + target); } bool EmulateInstructionMIPS::Emulate_BNZB(llvm::MCInst &insn) { @@ -2993,11 +2940,8 @@ Context context; context.type = eContextRelativeBranchImmediate; - if (!WriteRegisterUnsigned(context, eRegisterKindDWARF, dwarf_pc_mips, - target)) - return false; - - return true; + return WriteRegisterUnsigned(context, eRegisterKindDWARF, dwarf_pc_mips, + target); } bool EmulateInstructionMIPS::Emulate_BNZV(llvm::MCInst &insn) { @@ -3039,11 +2983,8 @@ Context context; context.type = eContextRelativeBranchImmediate; - if (!WriteRegisterUnsigned(context, eRegisterKindDWARF, dwarf_pc_mips, - target)) - return false; - - return true; + return WriteRegisterUnsigned(context, eRegisterKindDWARF, dwarf_pc_mips, + target); } bool EmulateInstructionMIPS::Emulate_LDST_Imm(llvm::MCInst &insn) { Index: source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp =================================================================== --- source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp +++ source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp @@ -207,10 +207,8 @@ } bool EmulateInstructionMIPS64::SetTargetTriple(const ArchSpec &arch) { - if (arch.GetTriple().getArch() == llvm::Triple::mips64 || - arch.GetTriple().getArch() == llvm::Triple::mips64el) - return true; - return false; + return arch.GetTriple().getArch() == llvm::Triple::mips64 || + arch.GetTriple().getArch() == llvm::Triple::mips64el; } const char *EmulateInstructionMIPS64::GetRegisterName(unsigned reg_num, @@ -1240,10 +1238,7 @@ Context context; context.type = eContextRegisterLoad; - if (!WriteRegister(context, ®_info_src, data_src)) - return false; - - return true; + return WriteRegister(context, ®_info_src, data_src); } return false; @@ -1262,11 +1257,8 @@ context.SetImmediateSigned(imm); context.type = eContextImmediate; - if (WriteRegisterUnsigned(context, eRegisterKindDWARF, dwarf_zero_mips64 + rt, - imm)) - return true; - - return false; + return WriteRegisterUnsigned(context, eRegisterKindDWARF, + dwarf_zero_mips64 + rt, imm); } bool EmulateInstructionMIPS64::Emulate_DSUBU_DADDU(llvm::MCInst &insn) { @@ -1394,11 +1386,8 @@ context.type = eContextRelativeBranchImmediate; context.SetImmediate(offset); - if (!WriteRegisterUnsigned(context, eRegisterKindDWARF, dwarf_pc_mips64, - target)) - return false; - - return true; + return WriteRegisterUnsigned(context, eRegisterKindDWARF, dwarf_pc_mips64, + target); } /* @@ -1633,11 +1622,8 @@ context.type = eContextRelativeBranchImmediate; context.SetImmediate(offset); - if (!WriteRegisterUnsigned(context, eRegisterKindDWARF, dwarf_pc_mips64, - target)) - return false; - - return true; + return WriteRegisterUnsigned(context, eRegisterKindDWARF, dwarf_pc_mips64, + target); } bool EmulateInstructionMIPS64::Emulate_BC(llvm::MCInst &insn) { @@ -1659,11 +1645,8 @@ Context context; - if (!WriteRegisterUnsigned(context, eRegisterKindDWARF, dwarf_pc_mips64, - target)) - return false; - - return true; + return WriteRegisterUnsigned(context, eRegisterKindDWARF, dwarf_pc_mips64, + target); } static int IsAdd64bitOverflow(int64_t a, int64_t b) { @@ -1747,11 +1730,8 @@ context.type = eContextRelativeBranchImmediate; context.SetImmediate(current_inst_size + offset); - if (!WriteRegisterUnsigned(context, eRegisterKindDWARF, dwarf_pc_mips64, - target)) - return false; - - return true; + return WriteRegisterUnsigned(context, eRegisterKindDWARF, dwarf_pc_mips64, + target); } /* @@ -1814,11 +1794,8 @@ context.type = eContextRelativeBranchImmediate; context.SetImmediate(current_inst_size + offset); - if (!WriteRegisterUnsigned(context, eRegisterKindDWARF, dwarf_pc_mips64, - target)) - return false; - - return true; + return WriteRegisterUnsigned(context, eRegisterKindDWARF, dwarf_pc_mips64, + target); } bool EmulateInstructionMIPS64::Emulate_J(llvm::MCInst &insn) { @@ -1841,10 +1818,8 @@ Context context; - if (!WriteRegisterUnsigned(context, eRegisterKindDWARF, dwarf_pc_mips64, pc)) - return false; - - return true; + return WriteRegisterUnsigned(context, eRegisterKindDWARF, dwarf_pc_mips64, + pc); } bool EmulateInstructionMIPS64::Emulate_JAL(llvm::MCInst &insn) { @@ -1973,11 +1948,8 @@ Context context; - if (!WriteRegisterUnsigned(context, eRegisterKindDWARF, dwarf_pc_mips64, - target)) - return false; - - return true; + return WriteRegisterUnsigned(context, eRegisterKindDWARF, dwarf_pc_mips64, + target); } bool EmulateInstructionMIPS64::Emulate_JR(llvm::MCInst &insn) { @@ -1998,11 +1970,8 @@ Context context; - if (!WriteRegisterUnsigned(context, eRegisterKindDWARF, dwarf_pc_mips64, - rs_val)) - return false; - - return true; + return WriteRegisterUnsigned(context, eRegisterKindDWARF, dwarf_pc_mips64, + rs_val); } /* @@ -2052,11 +2021,8 @@ Context context; - if (!WriteRegisterUnsigned(context, eRegisterKindDWARF, dwarf_pc_mips64, - target)) - return false; - - return true; + return WriteRegisterUnsigned(context, eRegisterKindDWARF, dwarf_pc_mips64, + target); } bool EmulateInstructionMIPS64::Emulate_BC1EQZ(llvm::MCInst &insn) { @@ -2091,11 +2057,8 @@ Context context; - if (!WriteRegisterUnsigned(context, eRegisterKindDWARF, dwarf_pc_mips64, - target)) - return false; - - return true; + return WriteRegisterUnsigned(context, eRegisterKindDWARF, dwarf_pc_mips64, + target); } bool EmulateInstructionMIPS64::Emulate_BC1NEZ(llvm::MCInst &insn) { @@ -2130,11 +2093,8 @@ Context context; - if (!WriteRegisterUnsigned(context, eRegisterKindDWARF, dwarf_pc_mips64, - target)) - return false; - - return true; + return WriteRegisterUnsigned(context, eRegisterKindDWARF, dwarf_pc_mips64, + target); } /* @@ -2193,11 +2153,8 @@ Context context; - if (!WriteRegisterUnsigned(context, eRegisterKindDWARF, dwarf_pc_mips64, - target)) - return false; - - return true; + return WriteRegisterUnsigned(context, eRegisterKindDWARF, dwarf_pc_mips64, + target); } bool EmulateInstructionMIPS64::Emulate_BNZB(llvm::MCInst &insn) { @@ -2288,11 +2245,8 @@ Context context; context.type = eContextRelativeBranchImmediate; - if (!WriteRegisterUnsigned(context, eRegisterKindDWARF, dwarf_pc_mips64, - target)) - return false; - - return true; + return WriteRegisterUnsigned(context, eRegisterKindDWARF, dwarf_pc_mips64, + target); } bool EmulateInstructionMIPS64::Emulate_BNZV(llvm::MCInst &insn) { @@ -2334,11 +2288,8 @@ Context context; context.type = eContextRelativeBranchImmediate; - if (!WriteRegisterUnsigned(context, eRegisterKindDWARF, dwarf_pc_mips64, - target)) - return false; - - return true; + return WriteRegisterUnsigned(context, eRegisterKindDWARF, dwarf_pc_mips64, + target); } bool EmulateInstructionMIPS64::Emulate_LDST_Imm(llvm::MCInst &insn) { Index: source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp =================================================================== --- source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp +++ source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp @@ -141,10 +141,7 @@ } // We processed all characters. It is a vaild basename. - if (idx == basename.size()) - return true; - - return false; + return idx == basename.size(); } bool CPlusPlusLanguage::MethodName::TrySimplifiedParse() { Index: source/Plugins/Language/ObjC/CF.cpp =================================================================== --- source/Plugins/Language/ObjC/CF.cpp +++ source/Plugins/Language/ObjC/CF.cpp @@ -149,7 +149,7 @@ } } - if (is_type_ok == false) + if (!is_type_ok) return false; Status error; Index: source/Plugins/Language/ObjC/NSException.cpp =================================================================== --- source/Plugins/Language/ObjC/NSException.cpp +++ source/Plugins/Language/ObjC/NSException.cpp @@ -144,11 +144,8 @@ m_userinfo_sp.reset(); m_reserved_sp.reset(); - if (!ExtractFields(m_backend, &m_name_sp, &m_reason_sp, &m_userinfo_sp, - &m_reserved_sp)) { - return false; - } - return true; + return ExtractFields(m_backend, &m_name_sp, &m_reason_sp, &m_userinfo_sp, + &m_reserved_sp); } bool MightHaveChildren() override { return true; } Index: source/Plugins/Language/ObjC/NSIndexPath.cpp =================================================================== --- source/Plugins/Language/ObjC/NSIndexPath.cpp +++ source/Plugins/Language/ObjC/NSIndexPath.cpp @@ -126,11 +126,7 @@ return false; } - bool MightHaveChildren() override { - if (m_impl.m_mode == Mode::Invalid) - return false; - return true; - } + bool MightHaveChildren() override { return m_impl.m_mode != Mode::Invalid; } size_t GetIndexOfChildWithName(const ConstString &name) override { const char *item_name = name.GetCString(); Index: source/Plugins/Language/ObjC/NSString.cpp =================================================================== --- source/Plugins/Language/ObjC/NSString.cpp +++ source/Plugins/Language/ObjC/NSString.cpp @@ -225,10 +225,10 @@ options.SetStream(&stream); options.SetQuote('"'); options.SetSourceSize(explicit_length); - options.SetNeedsZeroTermination(has_explicit_length == false); + options.SetNeedsZeroTermination(!has_explicit_length); options.SetIgnoreMaxLength(summary_options.GetCapping() == TypeSummaryCapping::eTypeSummaryUncapped); - options.SetBinaryZeroIsTerminator(has_explicit_length == false); + options.SetBinaryZeroIsTerminator(!has_explicit_length); options.SetLanguage(summary_options.GetLanguage()); return StringPrinter::ReadStringAndDumpToStream< StringPrinter::StringElementType::UTF16>(options); @@ -245,10 +245,10 @@ options.SetStream(&stream); options.SetQuote('"'); options.SetSourceSize(explicit_length); - options.SetNeedsZeroTermination(has_explicit_length == false); + options.SetNeedsZeroTermination(!has_explicit_length); options.SetIgnoreMaxLength(summary_options.GetCapping() == TypeSummaryCapping::eTypeSummaryUncapped); - options.SetBinaryZeroIsTerminator(has_explicit_length == false); + options.SetBinaryZeroIsTerminator(!has_explicit_length); options.SetLanguage(summary_options.GetLanguage()); return StringPrinter::ReadStringAndDumpToStream< StringPrinter::StringElementType::UTF16>(options); @@ -260,10 +260,7 @@ Status error; explicit_length = process_sp->ReadUnsignedIntegerFromMemory(location, 1, 0, error); - if (error.Fail() || explicit_length == 0) - has_explicit_length = false; - else - has_explicit_length = true; + has_explicit_length = !(error.Fail() || explicit_length == 0); location++; } options.SetLocation(location); Index: source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp =================================================================== --- source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp +++ source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp @@ -309,10 +309,7 @@ return false; // Can we maybe ask Clang about this? - if (strstr(name, "_vptr$") == name) - return true; - else - return false; + return strstr(name, "_vptr$") == name; } //------------------------------------------------------------------ Index: source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.cpp =================================================================== --- source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.cpp +++ source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.cpp @@ -264,11 +264,7 @@ } process->ReadCStringFromMemory(m_types_ptr, m_types, error); - if (error.Fail()) { - return false; - } - - return true; + return !error.Fail(); } bool ClassDescriptorV2::ivar_list_t::Read(Process *process, lldb::addr_t addr) { @@ -323,11 +319,7 @@ } process->ReadCStringFromMemory(m_type_ptr, m_type, error); - if (error.Fail()) { - return false; - } - - return true; + return !error.Fail(); } bool ClassDescriptorV2::Describe( Index: source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp =================================================================== --- source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp +++ source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp @@ -441,13 +441,10 @@ SymbolContextList sc_list; - if (target.GetImages().FindSymbolsWithNameAndType(s_method_signature, - eSymbolTypeCode, sc_list) || - target.GetImages().FindSymbolsWithNameAndType(s_arclite_method_signature, - eSymbolTypeCode, sc_list)) - return true; - else - return false; + return target.GetImages().FindSymbolsWithNameAndType( + s_method_signature, eSymbolTypeCode, sc_list) || + target.GetImages().FindSymbolsWithNameAndType( + s_arclite_method_signature, eSymbolTypeCode, sc_list); } lldb::SearchFilterSP AppleObjCRuntime::CreateExceptionSearchFilter() { Index: source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp =================================================================== --- source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp +++ source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp @@ -58,7 +58,7 @@ class_type_or_name.SetName(class_descriptor->GetClassName()); } } - return class_type_or_name.IsEmpty() == false; + return !class_type_or_name.IsEmpty(); } //------------------------------------------------------------------ Index: source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp =================================================================== --- source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp +++ source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp @@ -454,7 +454,7 @@ } } } - return class_type_or_name.IsEmpty() == false; + return !class_type_or_name.IsEmpty(); } //------------------------------------------------------------------ @@ -1852,8 +1852,8 @@ // warn if: // - we could not run either expression // - we found fewer than num_classes_to_warn_at classes total - if ((false == shared_cache_update_result.m_update_ran) || - (false == dynamic_update_result.m_update_ran)) + if ((!shared_cache_update_result.m_update_ran) || + (!dynamic_update_result.m_update_ran)) WarnIfNoClassesCached( SharedCacheWarningReason::eExpressionExecutionFailure); else if (dynamic_update_result.m_num_found + @@ -2428,7 +2428,7 @@ ObjCLanguageRuntime::ClassDescriptorSP AppleObjCRuntimeV2::NonPointerISACache::GetClassDescriptor(ObjCISA isa) { ObjCISA real_isa = 0; - if (EvaluateNonPointerISA(isa, real_isa) == false) + if (!EvaluateNonPointerISA(isa, real_isa)) return ObjCLanguageRuntime::ClassDescriptorSP(); auto cache_iter = m_cache.find(real_isa); if (cache_iter != m_cache.end()) Index: source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp =================================================================== --- source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp +++ source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp @@ -200,10 +200,7 @@ // The base class MischiefManaged does some cleanup - so you have to call it in // your MischiefManaged derived class. bool AppleThreadPlanStepThroughObjCTrampoline::MischiefManaged() { - if (IsPlanComplete()) - return true; - else - return false; + return IsPlanComplete(); } bool AppleThreadPlanStepThroughObjCTrampoline::WillStop() { return true; } Index: source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp =================================================================== --- source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp +++ source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp @@ -2074,10 +2074,8 @@ // If this Element has subelements then JIT rsaElementGetSubElements() for // details about its fields - if (*elem.field_count.get() > 0 && !JITSubelements(elem, context, frame_ptr)) - return false; - - return true; + return !(*elem.field_count.get() > 0 && + !JITSubelements(elem, context, frame_ptr)); } // JITs the RS runtime for information about the subelements/fields of a struct @@ -2300,10 +2298,7 @@ SetElementSize(alloc->element); // Use GetOffsetPointer() to infer size of the allocation - if (!JITAllocationSize(alloc, frame_ptr)) - return false; - - return true; + return JITAllocationSize(alloc, frame_ptr); } // Function attempts to set the type_name member of the paramaterised Element Index: source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp =================================================================== --- source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp +++ source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp @@ -207,7 +207,7 @@ while (pos != archive_map.end() && pos->first == file) { bool match = true; if (arch.IsValid() && - pos->second->GetArchitecture().IsCompatibleMatch(arch) == false) + !pos->second->GetArchitecture().IsCompatibleMatch(arch)) match = false; else if (file_offset != LLDB_INVALID_OFFSET && pos->second->GetFileOffset() != file_offset) Index: source/Plugins/ObjectFile/ELF/ELFHeader.cpp =================================================================== --- source/Plugins/ObjectFile/ELF/ELFHeader.cpp +++ source/Plugins/ObjectFile/ELF/ELFHeader.cpp @@ -38,7 +38,7 @@ lldb::offset_t saved_offset = *offset; for (uint32_t i = 0; i < count; ++i, ++value) { - if (GetMaxU64(data, offset, value, byte_size) == false) { + if (!GetMaxU64(data, offset, value, byte_size)) { *offset = saved_offset; return false; } @@ -60,7 +60,7 @@ lldb::offset_t saved_offset = *offset; for (uint32_t i = 0; i < count; ++i, ++value) { - if (GetMaxS64(data, offset, value, byte_size) == false) { + if (!GetMaxS64(data, offset, value, byte_size)) { *offset = saved_offset; return false; } @@ -133,7 +133,7 @@ return false; // Read e_entry, e_phoff and e_shoff. - if (GetMaxU64(data, offset, &e_entry, byte_size, 3) == false) + if (!GetMaxU64(data, offset, &e_entry, byte_size, 3)) return false; // Read e_flags. @@ -232,11 +232,11 @@ return false; // Read sh_flags. - if (GetMaxU64(data, offset, &sh_flags, byte_size) == false) + if (!GetMaxU64(data, offset, &sh_flags, byte_size)) return false; // Read sh_addr, sh_off and sh_size. - if (GetMaxU64(data, offset, &sh_addr, byte_size, 3) == false) + if (!GetMaxU64(data, offset, &sh_addr, byte_size, 3)) return false; // Read sh_link and sh_info. @@ -244,7 +244,7 @@ return false; // Read sh_addralign and sh_entsize. - if (GetMaxU64(data, offset, &sh_addralign, byte_size, 2) == false) + if (!GetMaxU64(data, offset, &sh_addralign, byte_size, 2)) return false; return true; @@ -332,7 +332,7 @@ if (parsing_32) { // Read st_value and st_size. - if (GetMaxU64(data, offset, &st_value, byte_size, 2) == false) + if (!GetMaxU64(data, offset, &st_value, byte_size, 2)) return false; // Read st_info and st_other. @@ -376,7 +376,7 @@ if (parsing_32) { // Read p_offset, p_vaddr, p_paddr, p_filesz and p_memsz. - if (GetMaxU64(data, offset, &p_offset, byte_size, 5) == false) + if (!GetMaxU64(data, offset, &p_offset, byte_size, 5)) return false; // Read p_flags. @@ -384,7 +384,7 @@ return false; // Read p_align. - if (GetMaxU64(data, offset, &p_align, byte_size) == false) + if (!GetMaxU64(data, offset, &p_align, byte_size)) return false; } else { // Read p_flags. @@ -392,7 +392,7 @@ return false; // Read p_offset, p_vaddr, p_paddr, p_filesz, p_memsz and p_align. - if (GetMaxU64(data, offset, &p_offset, byte_size, 6) == false) + if (!GetMaxU64(data, offset, &p_offset, byte_size, 6)) return false; } @@ -420,10 +420,7 @@ const unsigned byte_size = data.GetAddressByteSize(); // Read r_offset and r_info. - if (GetMaxU64(data, offset, &r_offset, byte_size, 2) == false) - return false; - - return true; + return GetMaxU64(data, offset, &r_offset, byte_size, 2) != false; } //------------------------------------------------------------------------------ @@ -436,11 +433,11 @@ const unsigned byte_size = data.GetAddressByteSize(); // Read r_offset and r_info. - if (GetMaxU64(data, offset, &r_offset, byte_size, 2) == false) + if (!GetMaxU64(data, offset, &r_offset, byte_size, 2)) return false; // Read r_addend; - if (GetMaxS64(data, offset, &r_addend, byte_size) == false) + if (!GetMaxS64(data, offset, &r_addend, byte_size)) return false; return true; Index: source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp =================================================================== --- source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp +++ source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp @@ -1145,7 +1145,7 @@ uint32_t idx; lldb::offset_t offset; for (idx = 0, offset = 0; idx < header.e_phnum; ++idx) { - if (program_headers[idx].Parse(data, &offset) == false) + if (!program_headers[idx].Parse(data, &offset)) break; } @@ -1557,7 +1557,7 @@ uint32_t idx; lldb::offset_t offset; for (idx = 0, offset = 0; idx < header.e_shnum; ++idx) { - if (section_headers[idx].Parse(sh_data, &offset) == false) + if (!section_headers[idx].Parse(sh_data, &offset)) break; } if (idx < section_headers.size()) @@ -2082,7 +2082,7 @@ unsigned i; for (i = 0; i < num_symbols; ++i) { - if (symbol.Parse(symtab_data, &offset) == false) + if (!symbol.Parse(symtab_data, &offset)) break; const char *symbol_name = strtab_data.PeekCStr(symbol.st_name); @@ -2548,7 +2548,7 @@ unsigned slot_type = hdr->GetRelocationJumpSlotType(); unsigned i; for (i = 0; i < num_relocations; ++i) { - if (rel.Parse(rel_data, &offset) == false) + if (!rel.Parse(rel_data, &offset)) break; if (reloc_type(rel) != slot_type) @@ -2681,7 +2681,7 @@ } for (unsigned i = 0; i < num_relocations; ++i) { - if (rel.Parse(rel_data, &offset) == false) + if (!rel.Parse(rel_data, &offset)) break; Symbol *symbol = NULL; Index: source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp =================================================================== --- source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp +++ source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp @@ -218,7 +218,7 @@ // that size on disk (to avoid __PAGEZERO) and load them SectionSP section_sp(section_list->GetSectionAtIndex(sect_idx)); if (section_sp && section_sp->GetFileSize() > 0 && - section_sp->IsThreadSpecific() == false) { + !section_sp->IsThreadSpecific()) { if (target.GetSectionLoadList().SetSectionLoadAddress( section_sp, section_sp->GetFileAddress() + value)) ++num_loaded_sections; Index: source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp =================================================================== --- source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp +++ source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp @@ -4469,7 +4469,7 @@ symbol_value -= section_file_addr; } - if (is_debug == false) { + if (!is_debug) { if (type == eSymbolTypeCode) { // See if we can find a N_FUN entry for any code symbols. If we // do find a match, and the name matches, then we can merge the @@ -4616,7 +4616,7 @@ if (function_starts_count > 0) { uint32_t num_synthetic_function_symbols = 0; for (i = 0; i < function_starts_count; ++i) { - if (function_starts.GetEntryRef(i).data == false) + if (!function_starts.GetEntryRef(i).data) ++num_synthetic_function_symbols; } @@ -4628,7 +4628,7 @@ for (i = 0; i < function_starts_count; ++i) { const FunctionStarts::Entry *func_start_entry = function_starts.GetEntryAtIndex(i); - if (func_start_entry->data == false) { + if (!func_start_entry->data) { addr_t symbol_file_addr = func_start_entry->addr; uint32_t symbol_flags = 0; if (is_arm) { @@ -5861,7 +5861,7 @@ if (m_sdk_versions.empty()) { lldb::offset_t offset = MachHeaderSizeFromMagic(m_header.magic); bool success = false; - for (uint32_t i = 0; success == false && i < m_header.ncmds; ++i) { + for (uint32_t i = 0; !success && i < m_header.ncmds; ++i) { const lldb::offset_t load_cmd_offset = offset; version_min_command lc; @@ -5890,47 +5890,46 @@ offset = load_cmd_offset + lc.cmdsize; } - if (success == false) - { - offset = MachHeaderSizeFromMagic(m_header.magic); - for (uint32_t i = 0; success == false && i < m_header.ncmds; ++i) - { - const lldb::offset_t load_cmd_offset = offset; + if (!success) { + offset = MachHeaderSizeFromMagic(m_header.magic); + for (uint32_t i = 0; !success && i < m_header.ncmds; ++i) { + const lldb::offset_t load_cmd_offset = offset; - version_min_command lc; - if (m_data.GetU32(&offset, &lc.cmd, 2) == NULL) - break; - if (lc.cmd == llvm::MachO::LC_BUILD_VERSION) - { - // struct build_version_command { - // uint32_t cmd; /* LC_BUILD_VERSION */ - // uint32_t cmdsize; /* sizeof(struct build_version_command) plus */ - // /* ntools * sizeof(struct build_tool_version) */ - // uint32_t platform; /* platform */ - // uint32_t minos; /* X.Y.Z is encoded in nibbles xxxx.yy.zz */ - // uint32_t sdk; /* X.Y.Z is encoded in nibbles xxxx.yy.zz */ - // uint32_t ntools; /* number of tool entries following this */ - // }; - - offset += 4; // skip platform - uint32_t minos = m_data.GetU32(&offset); - - const uint32_t xxxx = minos >> 16; - const uint32_t yy = (minos >> 8) & 0xffu; - const uint32_t zz = minos & 0xffu; - if (xxxx) - { - m_sdk_versions.push_back (xxxx); - m_sdk_versions.push_back (yy); - m_sdk_versions.push_back (zz); - success = true; - } - } - offset = load_cmd_offset + lc.cmdsize; + version_min_command lc; + if (m_data.GetU32(&offset, &lc.cmd, 2) == NULL) + break; + if (lc.cmd == llvm::MachO::LC_BUILD_VERSION) { + // struct build_version_command { + // uint32_t cmd; /* LC_BUILD_VERSION */ + // uint32_t cmdsize; /* sizeof(struct + // build_version_command) plus */ + // /* ntools * sizeof(struct + // build_tool_version) */ + // uint32_t platform; /* platform */ + // uint32_t minos; /* X.Y.Z is encoded in nibbles + // xxxx.yy.zz */ uint32_t sdk; /* X.Y.Z is encoded + // in nibbles xxxx.yy.zz */ uint32_t ntools; /* number + // of tool entries following this */ + // }; + + offset += 4; // skip platform + uint32_t minos = m_data.GetU32(&offset); + + const uint32_t xxxx = minos >> 16; + const uint32_t yy = (minos >> 8) & 0xffu; + const uint32_t zz = minos & 0xffu; + if (xxxx) { + m_sdk_versions.push_back(xxxx); + m_sdk_versions.push_back(yy); + m_sdk_versions.push_back(zz); + success = true; + } } + offset = load_cmd_offset + lc.cmdsize; + } } - if (success == false) { + if (!success) { // Push an invalid value so we don't try to find // the version # again on the next call to this // method. @@ -5991,8 +5990,7 @@ ++sect_idx) { Section *section = section_list->GetSectionAtIndex(sect_idx).get(); if (section && section->GetFileSize() > 0 && - section->GetFileOffset() == 0 && - section->IsThreadSpecific() == false && + section->GetFileOffset() == 0 && !section->IsThreadSpecific() && module_sp.get() == section->GetModule().get()) { return section; } @@ -6011,7 +6009,7 @@ lldb::addr_t mach_header_file_addr = mach_header_section->GetFileAddress(); if (mach_header_file_addr != LLDB_INVALID_ADDRESS) { if (section && section->GetFileSize() > 0 && - section->IsThreadSpecific() == false && + !section->IsThreadSpecific() && module_sp.get() == section->GetModule().get()) { // Ignore __LINKEDIT and __DWARF segments if (section->GetName() == GetSegmentNameLINKEDIT()) { @@ -6019,7 +6017,7 @@ // kernel binary like a kext or mach_kernel. const bool is_memory_image = (bool)m_process_wp.lock(); const Strata strata = GetStrata(); - if (is_memory_image == false || strata == eStrataKernel) + if (!is_memory_image || strata == eStrataKernel) return LLDB_INVALID_ADDRESS; } return section->GetFileAddress() - mach_header_file_addr + @@ -6046,7 +6044,7 @@ // sections that size on disk (to avoid __PAGEZERO) and load them SectionSP section_sp(section_list->GetSectionAtIndex(sect_idx)); if (section_sp && section_sp->GetFileSize() > 0 && - section_sp->IsThreadSpecific() == false && + !section_sp->IsThreadSpecific() && module_sp.get() == section_sp->GetModule().get()) { // Ignore __LINKEDIT and __DWARF segments if (section_sp->GetName() == GetSegmentNameLINKEDIT()) { @@ -6054,7 +6052,7 @@ // isn't a kernel binary like a kext or mach_kernel. const bool is_memory_image = (bool)m_process_wp.lock(); const Strata strata = GetStrata(); - if (is_memory_image == false || strata == eStrataKernel) + if (!is_memory_image || strata == eStrataKernel) continue; } if (target.GetSectionLoadList().SetSectionLoadAddress( Index: source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp =================================================================== --- source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp +++ source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp @@ -527,7 +527,7 @@ } } - return m_sect_headers.empty() == false; + return !m_sect_headers.empty(); } bool ObjectFilePECOFF::GetSectionName(std::string §_name, Index: source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp =================================================================== --- source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp +++ source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp @@ -213,7 +213,7 @@ // beginning of the list uint32_t insert_idx = 0; for (uint32_t core_idx = 0; core_idx < num_cores; ++core_idx) { - if (core_used_map[core_idx] == false) { + if (!core_used_map[core_idx]) { new_thread_list.InsertThread( core_thread_list.GetThreadAtIndex(core_idx, false), insert_idx); ++insert_idx; Index: source/Plugins/Platform/Android/PlatformAndroid.cpp =================================================================== --- source/Plugins/Platform/Android/PlatformAndroid.cpp +++ source/Plugins/Platform/Android/PlatformAndroid.cpp @@ -74,7 +74,7 @@ } bool create = force; - if (create == false && arch && arch->IsValid()) { + if (!create && arch && arch->IsValid()) { const llvm::Triple &triple = arch->GetTriple(); switch (triple.getVendor()) { case llvm::Triple::PC: Index: source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp =================================================================== --- source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp +++ source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp @@ -48,7 +48,7 @@ arch ? arch->GetTriple().getTriple() : ""); bool create = force; - if (create == false && arch && arch->IsValid()) { + if (!create && arch && arch->IsValid()) { const llvm::Triple &triple = arch->GetTriple(); switch (triple.getOS()) { case llvm::Triple::FreeBSD: Index: source/Plugins/Platform/Kalimba/PlatformKalimba.cpp =================================================================== --- source/Plugins/Platform/Kalimba/PlatformKalimba.cpp +++ source/Plugins/Platform/Kalimba/PlatformKalimba.cpp @@ -30,7 +30,7 @@ PlatformSP PlatformKalimba::CreateInstance(bool force, const ArchSpec *arch) { bool create = force; - if (create == false && arch && arch->IsValid()) { + if (!create && arch && arch->IsValid()) { const llvm::Triple &triple = arch->GetTriple(); switch (triple.getVendor()) { case llvm::Triple::CSR: Index: source/Plugins/Platform/Linux/PlatformLinux.cpp =================================================================== --- source/Plugins/Platform/Linux/PlatformLinux.cpp +++ source/Plugins/Platform/Linux/PlatformLinux.cpp @@ -46,7 +46,7 @@ arch ? arch->GetTriple().getTriple() : ""); bool create = force; - if (create == false && arch && arch->IsValid()) { + if (!create && arch && arch->IsValid()) { const llvm::Triple &triple = arch->GetTriple(); switch (triple.getOS()) { case llvm::Triple::Linux: Index: source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.cpp =================================================================== --- source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.cpp +++ source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.cpp @@ -76,7 +76,7 @@ } bool create = force; - if (create == false && arch && arch->IsValid()) { + if (!create && arch && arch->IsValid()) { switch (arch->GetMachine()) { case llvm::Triple::x86_64: { const llvm::Triple &triple = arch->GetTriple(); Index: source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.cpp =================================================================== --- source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.cpp +++ source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.cpp @@ -75,7 +75,7 @@ } bool create = force; - if (create == false && arch && arch->IsValid()) { + if (!create && arch && arch->IsValid()) { switch (arch->GetMachine()) { case llvm::Triple::x86_64: { const llvm::Triple &triple = arch->GetTriple(); Index: source/Plugins/Platform/MacOSX/PlatformDarwin.cpp =================================================================== --- source/Plugins/Platform/MacOSX/PlatformDarwin.cpp +++ source/Plugins/Platform/MacOSX/PlatformDarwin.cpp @@ -489,10 +489,7 @@ return false; ObjectFile::Type obj_type = obj_file->GetType(); - if (obj_type == ObjectFile::eTypeDynamicLinker) - return true; - else - return false; + return obj_type == ObjectFile::eTypeDynamicLinker; } bool PlatformDarwin::x86GetSupportedArchitectureAtIndex(uint32_t idx, Index: source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp =================================================================== --- source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp +++ source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp @@ -91,7 +91,7 @@ // ArchSpec for normal userland debugging. It is only useful in kernel debug // sessions and the DynamicLoaderDarwinPlugin (or a user doing 'platform // select') will force the creation of this Platform plugin. - if (force == false) { + if (!force) { if (log) log->Printf("PlatformDarwinKernel::%s() aborting creation of platform " "because force == false", @@ -102,7 +102,7 @@ bool create = force; LazyBool is_ios_debug_session = eLazyBoolCalculate; - if (create == false && arch && arch->IsValid()) { + if (!create && arch && arch->IsValid()) { const llvm::Triple &triple = arch->GetTriple(); switch (triple.getVendor()) { case llvm::Triple::Apple: @@ -640,10 +640,7 @@ shallow_bundle_str += ".dSYM"; dsym_fspec.SetFile(shallow_bundle_str, FileSpec::Style::native); FileSystem::Instance().Resolve(dsym_fspec); - if (FileSystem::Instance().IsDirectory(dsym_fspec)) { - return true; - } - return false; + return FileSystem::Instance().IsDirectory(dsym_fspec); } // Given a FileSpec of /dir/dir/mach.development.t7004 Return true if a dSYM @@ -654,10 +651,7 @@ std::string filename = kernel_binary.GetFilename().AsCString(); filename += ".dSYM"; kernel_dsym.GetFilename() = ConstString(filename); - if (FileSystem::Instance().IsDirectory(kernel_dsym)) { - return true; - } - return false; + return FileSystem::Instance().IsDirectory(kernel_dsym); } Status PlatformDarwinKernel::GetSharedModule( Index: source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp =================================================================== --- source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp +++ source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp @@ -80,7 +80,7 @@ const bool is_host = false; bool create = force; - if (create == false && arch && arch->IsValid()) { + if (!create && arch && arch->IsValid()) { const llvm::Triple &triple = arch->GetTriple(); switch (triple.getVendor()) { case llvm::Triple::Apple: Index: source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp =================================================================== --- source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp +++ source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp @@ -71,7 +71,7 @@ } bool create = force; - if (create == false && arch && arch->IsValid()) { + if (!create && arch && arch->IsValid()) { switch (arch->GetMachine()) { case llvm::Triple::arm: case llvm::Triple::aarch64: Index: source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp =================================================================== --- source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp +++ source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp @@ -76,7 +76,7 @@ } bool create = force; - if (create == false && arch && arch->IsValid()) { + if (!create && arch && arch->IsValid()) { switch (arch->GetMachine()) { case llvm::Triple::x86_64: case llvm::Triple::x86: { Index: source/Plugins/Platform/MacOSX/objcxx/PlatformiOSSimulatorCoreSimulatorSupport.mm =================================================================== --- source/Plugins/Platform/MacOSX/objcxx/PlatformiOSSimulatorCoreSimulatorSupport.mm +++ source/Plugins/Platform/MacOSX/objcxx/PlatformiOSSimulatorCoreSimulatorSupport.mm @@ -591,7 +591,7 @@ std::function f) { const size_t n = GetNumDevices(); for (NSUInteger i = 0; i < n; ++i) { - if (f(GetDeviceAtIndex(i)) == false) + if (!f(GetDeviceAtIndex(i))) break; } } Index: source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp =================================================================== --- source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp +++ source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp @@ -46,7 +46,7 @@ arch ? arch->GetTriple().getTriple() : ""); bool create = force; - if (create == false && arch && arch->IsValid()) { + if (!create && arch && arch->IsValid()) { const llvm::Triple &triple = arch->GetTriple(); switch (triple.getOS()) { case llvm::Triple::NetBSD: Index: source/Plugins/Platform/OpenBSD/PlatformOpenBSD.cpp =================================================================== --- source/Plugins/Platform/OpenBSD/PlatformOpenBSD.cpp +++ source/Plugins/Platform/OpenBSD/PlatformOpenBSD.cpp @@ -46,7 +46,7 @@ arch ? arch->GetTriple().getTriple() : ""); bool create = force; - if (create == false && arch && arch->IsValid()) { + if (!create && arch && arch->IsValid()) { const llvm::Triple &triple = arch->GetTriple(); switch (triple.getOS()) { case llvm::Triple::OpenBSD: Index: source/Plugins/Platform/Windows/PlatformWindows.cpp =================================================================== --- source/Plugins/Platform/Windows/PlatformWindows.cpp +++ source/Plugins/Platform/Windows/PlatformWindows.cpp @@ -67,7 +67,7 @@ const bool is_host = false; bool create = force; - if (create == false && arch && arch->IsValid()) { + if (!create && arch && arch->IsValid()) { const llvm::Triple &triple = arch->GetTriple(); switch (triple.getVendor()) { case llvm::Triple::PC: Index: source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp =================================================================== --- source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp +++ source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp @@ -40,7 +40,7 @@ void PlatformRemoteGDBServer::Initialize() { Platform::Initialize(); - if (g_initialized == false) { + if (!g_initialized) { g_initialized = true; PluginManager::RegisterPlugin( PlatformRemoteGDBServer::GetPluginNameStatic(), Index: source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp =================================================================== --- source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp +++ source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp @@ -463,19 +463,13 @@ bool CommunicationKDP::RemoteIsEFI() { if (GetKernelVersion() == NULL) return false; - if (strncmp(m_kernel_version.c_str(), "EFI", 3) == 0) - return true; - else - return false; + return strncmp(m_kernel_version.c_str(), "EFI", 3) == 0; } bool CommunicationKDP::RemoteIsDarwinKernel() { if (GetKernelVersion() == NULL) return false; - if (m_kernel_version.find("Darwin Kernel") != std::string::npos) - return true; - else - return false; + return m_kernel_version.find("Darwin Kernel") != std::string::npos; } lldb::addr_t CommunicationKDP::GetLoadAddress() { @@ -1258,9 +1252,7 @@ request_packet.PutHex32(GetCPUMask()); DataExtractor reply_packet; - if (SendRequestAndGetReply(command, request_packet, reply_packet)) - return true; - return false; + return SendRequestAndGetReply(command, request_packet, reply_packet); } bool CommunicationKDP::SendRequestBreakpoint(bool set, addr_t addr) { @@ -1293,7 +1285,5 @@ const uint32_t command_length = 8; MakeRequestPacketHeader(command, request_packet, command_length); DataExtractor reply_packet; - if (SendRequestAndGetReply(command, request_packet, reply_packet)) - return true; - return false; + return SendRequestAndGetReply(command, request_packet, reply_packet); } Index: source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp =================================================================== --- source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp +++ source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp @@ -1670,7 +1670,7 @@ return LLDB_INVALID_INDEX32; // We must watch for either read or write - if (read == false && write == false) + if (!read && !write) return LLDB_INVALID_INDEX32; // Can't watch more than 4 bytes per WVR/WCR pair Index: source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp =================================================================== --- source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp +++ source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp @@ -956,7 +956,7 @@ return LLDB_INVALID_INDEX32; // We must watch for either read or write - if (read == false && write == false) + if (!read && !write) return LLDB_INVALID_INDEX32; // Can't watch more than 4 bytes per WVR/WCR pair Index: source/Plugins/Process/Utility/RegisterContextLLDB.cpp =================================================================== --- source/Plugins/Process/Utility/RegisterContextLLDB.cpp +++ source/Plugins/Process/Utility/RegisterContextLLDB.cpp @@ -324,7 +324,7 @@ above_trap_handler = true; if (pc == 0 || pc == 0x1) { - if (above_trap_handler == false) { + if (!above_trap_handler) { m_frame_type = eNotAValidFrame; UnwindLogMsg("this frame has a pc of 0x0"); return; @@ -474,7 +474,7 @@ bool decr_pc_and_recompute_addr_range = false; // If the symbol lookup failed... - if (m_sym_ctx_valid == false) + if (!m_sym_ctx_valid) decr_pc_and_recompute_addr_range = true; // Or if we're in the middle of the stack (and not "above" an asynchronous @@ -1250,7 +1250,7 @@ // Address register and it hasn't been saved anywhere yet -- that is, // it's still live in the actual register. Handle this specially. - if (have_unwindplan_regloc == false && return_address_reg.IsValid() && + if (!have_unwindplan_regloc && return_address_reg.IsValid() && IsFrameZero()) { if (return_address_reg.GetAsKind(eRegisterKindLLDB) != LLDB_INVALID_REGNUM) { @@ -1329,11 +1329,7 @@ } } - if (can_fetch_pc_value && can_fetch_cfa) { - have_unwindplan_regloc = true; - } else { - have_unwindplan_regloc = false; - } + have_unwindplan_regloc = can_fetch_pc_value && can_fetch_cfa; } else { // We were unable to fall back to another unwind plan have_unwindplan_regloc = false; @@ -1344,7 +1340,7 @@ ExecutionContext exe_ctx(m_thread.shared_from_this()); Process *process = exe_ctx.GetProcessPtr(); - if (have_unwindplan_regloc == false) { + if (!have_unwindplan_regloc) { // If the UnwindPlan failed to give us an unwind location for this // register, we may be able to fall back to some ABI-defined default. For // example, some ABIs allow to determine the caller's SP via the CFA. Also, @@ -1363,7 +1359,7 @@ } } - if (have_unwindplan_regloc == false) { + if (!have_unwindplan_regloc) { if (IsFrameZero()) { // This is frame 0 - we should return the actual live register context // value @@ -1409,7 +1405,7 @@ } if (unwindplan_regloc.IsSame()) { - if (IsFrameZero() == false && + if (!IsFrameZero() && (regnum.GetAsKind(eRegisterKindGeneric) == LLDB_REGNUM_GENERIC_PC || regnum.GetAsKind(eRegisterKindGeneric) == LLDB_REGNUM_GENERIC_RA)) { UnwindLogMsg("register %s (%d) is marked as 'IsSame' - it is a pc or " @@ -2051,12 +2047,8 @@ pc = abi->FixCodeAddress(pc); } - if (m_all_registers_available == false && above_trap_handler == false && - (pc == 0 || pc == 1)) { - return false; - } - - return true; + return !(m_all_registers_available == false && + above_trap_handler == false && (pc == 0 || pc == 1)); } else { return false; } Index: source/Plugins/Process/Utility/RegisterContextPOSIX_x86.cpp =================================================================== --- source/Plugins/Process/Utility/RegisterContextPOSIX_x86.cpp +++ source/Plugins/Process/Utility/RegisterContextPOSIX_x86.cpp @@ -376,7 +376,7 @@ if (m_fpr_type == eNotValid) { // TODO: Use assembly to call cpuid on the inferior and query ebx or ecx m_fpr_type = eXSAVE; // extended floating-point registers, if available - if (false == ReadFPR()) + if (!ReadFPR()) m_fpr_type = eFXSAVE; // assume generic floating-point registers } return m_fpr_type; Index: source/Plugins/Process/Utility/UnwindLLDB.cpp =================================================================== --- source/Plugins/Process/Utility/UnwindLLDB.cpp +++ source/Plugins/Process/Utility/UnwindLLDB.cpp @@ -212,15 +212,15 @@ // On Mac OS X, the _sigtramp asynchronous signal trampoline frame may not // have its (constructed) CFA aligned correctly -- don't do the abi // alignment check for these. - if (reg_ctx_sp->IsTrapHandlerFrame() == false) { + if (!reg_ctx_sp->IsTrapHandlerFrame()) { // See if we can find a fallback unwind plan for THIS frame. It may be // that the UnwindPlan we're using for THIS frame was bad and gave us a // bad CFA. If that's not it, then see if we can change the UnwindPlan // for the frame below us ("NEXT") -- see if using that other UnwindPlan // gets us a better unwind state. - if (reg_ctx_sp->TryFallbackUnwindPlan() == false || - reg_ctx_sp->GetCFA(cursor_sp->cfa) == false || - abi->CallFrameAddressIsValid(cursor_sp->cfa) == false) { + if (!reg_ctx_sp->TryFallbackUnwindPlan() || + !reg_ctx_sp->GetCFA(cursor_sp->cfa) || + !abi->CallFrameAddressIsValid(cursor_sp->cfa)) { if (prev_frame->reg_ctx_lldb_sp->TryFallbackUnwindPlan()) { // TryFallbackUnwindPlan for prev_frame succeeded and updated // reg_ctx_lldb_sp field of prev_frame. However, cfa field of @@ -385,10 +385,8 @@ // Cursor::m_frames[m_frames.size() - 2], reg_ctx_lldb_sp field was already // updated during TryFallbackUnwindPlan call above. However, cfa field // still needs to be updated. Hence updating it here and then returning. - if (!(m_frames[m_frames.size() - 2]->reg_ctx_lldb_sp->GetCFA( - m_frames[m_frames.size() - 2]->cfa))) - return false; - return true; + return m_frames[m_frames.size() - 2]->reg_ctx_lldb_sp->GetCFA( + m_frames[m_frames.size() - 2]->cfa); } // The new frame hasn't helped in unwinding. Fall back to the original one as @@ -470,10 +468,7 @@ UnwindLLDB::RegisterSearchResult result; result = m_frames[frame_num]->reg_ctx_lldb_sp->SavedLocationForRegister( lldb_regnum, regloc); - if (result == UnwindLLDB::RegisterSearchResult::eRegisterFound) - return true; - else - return false; + return result == UnwindLLDB::RegisterSearchResult::eRegisterFound; } while (frame_num >= 0) { UnwindLLDB::RegisterSearchResult result; Index: source/Plugins/Process/gdb-remote/GDBRemoteClientBase.cpp =================================================================== --- source/Plugins/Process/gdb-remote/GDBRemoteClientBase.cpp +++ source/Plugins/Process/gdb-remote/GDBRemoteClientBase.cpp @@ -379,7 +379,7 @@ log->PutCString("GDBRemoteClientBase::Lock::Lock sent packet: \\x03"); m_comm.m_interrupt_time = steady_clock::now(); } - m_comm.m_cv.wait(lock, [this] { return m_comm.m_is_running == false; }); + m_comm.m_cv.wait(lock, [this] { return !m_comm.m_is_running; }); m_did_interrupt = true; } m_acquired = true; Index: source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp =================================================================== --- source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp +++ source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp @@ -656,7 +656,7 @@ // Size of packet before it is decompressed, for logging purposes size_t original_packet_size = m_bytes.size(); if (CompressionIsEnabled()) { - if (DecompressPacket() == false) { + if (!DecompressPacket()) { packet.Clear(); return GDBRemoteCommunication::PacketType::Standard; } Index: source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp =================================================================== --- source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp +++ source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp @@ -252,10 +252,7 @@ m_attach_or_wait_reply = eLazyBoolYes; } } - if (m_attach_or_wait_reply == eLazyBoolYes) - return true; - else - return false; + return m_attach_or_wait_reply == eLazyBoolYes; } bool GDBRemoteCommunicationClient::GetSyncThreadStateSupported() { @@ -269,14 +266,11 @@ m_prepare_for_reg_writing_reply = eLazyBoolYes; } } - if (m_prepare_for_reg_writing_reply == eLazyBoolYes) - return true; - else - return false; + return m_prepare_for_reg_writing_reply == eLazyBoolYes; } void GDBRemoteCommunicationClient::ResetDiscoverableSettings(bool did_exec) { - if (did_exec == false) { + if (!did_exec) { // Hard reset everything, this is when we first connect to a GDB server m_supports_not_sending_acks = eLazyBoolCalculate; m_supports_thread_suffix = eLazyBoolCalculate; @@ -745,7 +739,7 @@ bool sequence_mutex_unavailable; size_t size; size = GetCurrentThreadIDs(thread_ids, sequence_mutex_unavailable); - if (size && sequence_mutex_unavailable == false) { + if (size && !sequence_mutex_unavailable) { m_curr_pid = thread_ids.front(); m_curr_pid_is_valid = eLazyBoolYes; return m_curr_pid; @@ -839,8 +833,8 @@ if (name_equal_value && name_equal_value[0]) { StreamString packet; bool send_hex_encoding = false; - for (const char *p = name_equal_value; - *p != '\0' && send_hex_encoding == false; ++p) { + for (const char *p = name_equal_value; *p != '\0' && !send_hex_encoding; + ++p) { if (isprint(*p)) { switch (*p) { case '$': @@ -1693,7 +1687,7 @@ found_num_field = true; } } - if (found_num_field == false) { + if (!found_num_field) { m_supports_watchpoint_support_info = eLazyBoolNo; } } else { @@ -1728,12 +1722,10 @@ // On targets like MIPS and ppc64le, watchpoint exceptions are always // generated before the instruction is executed. The connected target may // not support qHostInfo or qWatchpointSupportInfo packets. - if (atype == llvm::Triple::mips || atype == llvm::Triple::mipsel || - atype == llvm::Triple::mips64 || atype == llvm::Triple::mips64el || - atype == llvm::Triple::ppc64le) - after = false; - else - after = true; + after = + !(atype == llvm::Triple::mips || atype == llvm::Triple::mipsel || + atype == llvm::Triple::mips64 || atype == llvm::Triple::mips64el || + atype == llvm::Triple::ppc64le); } else { // For MIPS and ppc64le, set m_watchpoints_trigger_after_instruction to // eLazyBoolNo if it is not calculated before. @@ -3776,7 +3768,7 @@ // Is this the initial qSymbol:: packet? bool first_qsymbol_query = true; - if (m_supports_qSymbol && m_qSymbol_requests_done == false) { + if (m_supports_qSymbol && !m_qSymbol_requests_done) { Lock lock(*this, false); if (lock) { StreamString packet; Index: source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp =================================================================== --- source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp +++ source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp @@ -458,7 +458,7 @@ ((ProcessGDBRemote *)process)->GetGDBRemote()); const bool use_g_packet = - gdb_comm.AvoidGPackets((ProcessGDBRemote *)process) == false; + !gdb_comm.AvoidGPackets((ProcessGDBRemote *)process); GDBRemoteClientBase::Lock lock(gdb_comm, false); if (lock) { @@ -521,7 +521,7 @@ ((ProcessGDBRemote *)process)->GetGDBRemote()); const bool use_g_packet = - gdb_comm.AvoidGPackets((ProcessGDBRemote *)process) == false; + !gdb_comm.AvoidGPackets((ProcessGDBRemote *)process); GDBRemoteClientBase::Lock lock(gdb_comm, false); if (lock) { Index: source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp =================================================================== --- source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp +++ source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp @@ -1528,7 +1528,7 @@ new EventDataBytes(continue_packet.GetString().data(), continue_packet.GetSize())); - if (listener_sp->GetEvent(event_sp, std::chrono::seconds(5)) == false) { + if (!listener_sp->GetEvent(event_sp, std::chrono::seconds(5))) { error.SetErrorString("Resume timed out."); if (log) log->Printf("ProcessGDBRemote::DoResume: Resume timed out."); @@ -1984,7 +1984,7 @@ } } - if (!handled && signo && did_exec == false) { + if (!handled && signo && !did_exec) { if (signo == SIGTRAP) { // Currently we are going to assume SIGTRAP means we are either // hitting a breakpoint or hardware single stepping. @@ -2698,7 +2698,7 @@ // We are are not using non-stop mode, there can only be one last stop // reply packet, so clear the list. - if (GetTarget().GetNonStopModeEnabled() == false) + if (!GetTarget().GetNonStopModeEnabled()) m_stop_packet_stack.clear(); // Add this stop packet to the stop packet stack This stack will get popped Index: source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp =================================================================== --- source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp +++ source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp @@ -197,13 +197,10 @@ } bool ThreadGDBRemote::ThreadHasQueueInformation() const { - if (m_thread_dispatch_qaddr != 0 && - m_thread_dispatch_qaddr != LLDB_INVALID_ADDRESS && - m_dispatch_queue_t != LLDB_INVALID_ADDRESS && - m_queue_kind != eQueueKindUnknown && m_queue_serial_number != 0) { - return true; - } - return false; + return m_thread_dispatch_qaddr != 0 && + m_thread_dispatch_qaddr != LLDB_INVALID_ADDRESS && + m_dispatch_queue_t != LLDB_INVALID_ADDRESS && + m_queue_kind != eQueueKindUnknown && m_queue_serial_number != 0; } LazyBool ThreadGDBRemote::GetAssociatedWithLibdispatchQueue() { Index: source/Plugins/Process/mach-core/ProcessMachCore.cpp =================================================================== --- source/Plugins/Process/mach-core/ProcessMachCore.cpp +++ source/Plugins/Process/mach-core/ProcessMachCore.cpp @@ -302,36 +302,38 @@ // LC_IDENT is very obsolete and should not be used in new code, but if the // load command is present, let's use the contents. std::string corefile_identifier = core_objfile->GetIdentifierString(); - if (found_main_binary_definitively == false - && corefile_identifier.find("Darwin Kernel") != std::string::npos) { - UUID uuid; - addr_t addr = LLDB_INVALID_ADDRESS; - if (corefile_identifier.find("UUID=") != std::string::npos) { - size_t p = corefile_identifier.find("UUID=") + strlen("UUID="); - std::string uuid_str = corefile_identifier.substr(p, 36); - uuid.SetFromStringRef(uuid_str); - } - if (corefile_identifier.find("stext=") != std::string::npos) { - size_t p = corefile_identifier.find("stext=") + strlen("stext="); - if (corefile_identifier[p] == '0' && corefile_identifier[p + 1] == 'x') { - errno = 0; - addr = ::strtoul(corefile_identifier.c_str() + p, NULL, 16); - if (errno != 0 || addr == 0) - addr = LLDB_INVALID_ADDRESS; - } - } - if (uuid.IsValid() && addr != LLDB_INVALID_ADDRESS) { - m_mach_kernel_addr = addr; - found_main_binary_definitively = true; - if (log) - log->Printf("ProcessMachCore::DoLoadCore: Using the kernel address 0x%" PRIx64 - " from LC_IDENT/LC_NOTE 'kern ver str' string: '%s'", addr, corefile_identifier.c_str()); + if (!found_main_binary_definitively && + corefile_identifier.find("Darwin Kernel") != std::string::npos) { + UUID uuid; + addr_t addr = LLDB_INVALID_ADDRESS; + if (corefile_identifier.find("UUID=") != std::string::npos) { + size_t p = corefile_identifier.find("UUID=") + strlen("UUID="); + std::string uuid_str = corefile_identifier.substr(p, 36); + uuid.SetFromStringRef(uuid_str); + } + if (corefile_identifier.find("stext=") != std::string::npos) { + size_t p = corefile_identifier.find("stext=") + strlen("stext="); + if (corefile_identifier[p] == '0' && corefile_identifier[p + 1] == 'x') { + errno = 0; + addr = ::strtoul(corefile_identifier.c_str() + p, NULL, 16); + if (errno != 0 || addr == 0) + addr = LLDB_INVALID_ADDRESS; } + } + if (uuid.IsValid() && addr != LLDB_INVALID_ADDRESS) { + m_mach_kernel_addr = addr; + found_main_binary_definitively = true; + if (log) + log->Printf( + "ProcessMachCore::DoLoadCore: Using the kernel address 0x%" PRIx64 + " from LC_IDENT/LC_NOTE 'kern ver str' string: '%s'", + addr, corefile_identifier.c_str()); + } } - if (found_main_binary_definitively == false - && (m_dyld_addr == LLDB_INVALID_ADDRESS - || m_mach_kernel_addr == LLDB_INVALID_ADDRESS)) { + if (!found_main_binary_definitively && + (m_dyld_addr == LLDB_INVALID_ADDRESS || + m_mach_kernel_addr == LLDB_INVALID_ADDRESS)) { // We need to locate the main executable in the memory ranges we have in // the core file. We need to search for both a user-process dyld binary // and a kernel binary in memory; we must look at all the pages in the @@ -352,16 +354,15 @@ } } - if (found_main_binary_definitively == false - && m_mach_kernel_addr != LLDB_INVALID_ADDRESS) { + if (!found_main_binary_definitively && + m_mach_kernel_addr != LLDB_INVALID_ADDRESS) { // In the case of multiple kernel images found in the core file via // exhaustive search, we may not pick the correct one. See if the // DynamicLoaderDarwinKernel's search heuristics might identify the correct // one. Most of the time, I expect the address from SearchForDarwinKernel() // will be the same as the address we found via exhaustive search. - if (GetTarget().GetArchitecture().IsValid() == false && - m_core_module_sp.get()) { + if (!GetTarget().GetArchitecture().IsValid() && m_core_module_sp.get()) { GetTarget().SetArchitecture(m_core_module_sp->GetArchitecture()); } Index: source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp =================================================================== --- source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp +++ source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp @@ -222,9 +222,7 @@ bool PythonBytes::Check(PyObject *py_obj) { if (!py_obj) return false; - if (PyBytes_Check(py_obj)) - return true; - return false; + return PyBytes_Check(py_obj); } void PythonBytes::Reset(PyRefType type, PyObject *py_obj) { @@ -294,9 +292,7 @@ bool PythonByteArray::Check(PyObject *py_obj) { if (!py_obj) return false; - if (PyByteArray_Check(py_obj)) - return true; - return false; + return PyByteArray_Check(py_obj); } void PythonByteArray::Reset(PyRefType type, PyObject *py_obj) { Index: source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp =================================================================== --- source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp +++ source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp @@ -208,7 +208,7 @@ m_python_interpreter(py_interpreter) { DoAcquireLock(); if ((on_entry & InitSession) == InitSession) { - if (DoInitSession(on_entry, in, out, err) == false) { + if (!DoInitSession(on_entry, in, out, err)) { // Don't teardown the session if we didn't init it. m_teardown_session = false; } @@ -2838,7 +2838,7 @@ bool was_imported = (was_imported_globally || was_imported_locally); - if (was_imported == true && can_reload == false) { + if (was_imported && !can_reload) { error.SetErrorString("module already imported"); return false; } Index: source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp =================================================================== --- source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp +++ source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp @@ -657,7 +657,7 @@ } if (byte_size_valid && byte_size == 0 && type_name_cstr && - die.HasChildren() == false && + !die.HasChildren() && sc.comp_unit->GetLanguage() == eLanguageTypeObjC) { // Work around an issue with clang at the moment where forward // declarations for objective C classes are emitted as: @@ -895,7 +895,7 @@ // has child classes or types that require the class to be created // for use as their decl contexts the class will be ready to accept // these child definitions. - if (die.HasChildren() == false) { + if (!die.HasChildren()) { // No children for this struct/union/class, lets finish it if (ClangASTContext::StartTagDeclarationDefinition(clang_type)) { ClangASTContext::CompleteTagDeclarationDefinition(clang_type); @@ -1746,7 +1746,7 @@ element_type->GetForwardCompilerType(); if (ClangASTContext::IsCXXClassType(array_element_type) && - array_element_type.GetCompleteType() == false) { + !array_element_type.GetCompleteType()) { ModuleSP module_sp = die.GetModule(); if (module_sp) { if (die.GetCU()->GetProducer() == eProducerClang) @@ -2269,7 +2269,7 @@ if (type_source_info) { CompilerType base_class_type( &m_ast, type_source_info->getType().getAsOpaquePtr()); - if (base_class_type.GetCompleteType() == false) { + if (!base_class_type.GetCompleteType()) { auto module = dwarf->GetObjectFile()->GetModule(); module->ReportError(":: Class '%s' has a base class '%s' which " "does not have a complete definition.", @@ -2885,7 +2885,7 @@ break; } - if (is_artificial == false) { + if (!is_artificial) { Type *member_type = die.ResolveTypeUID(DIERef(encoding_form)); clang::FieldDecl *field_decl = NULL; @@ -3083,7 +3083,7 @@ } if (ClangASTContext::IsCXXClassType(member_clang_type) && - member_clang_type.GetCompleteType() == false) { + !member_clang_type.GetCompleteType()) { if (die.GetCU()->GetProducer() == eProducerClang) module_sp->ReportError( "DWARF DIE at 0x%8.8x (class %s) has a member variable " Index: source/Plugins/SymbolFile/DWARF/DWARFDebugMacro.cpp =================================================================== --- source/Plugins/SymbolFile/DWARF/DWARFDebugMacro.cpp +++ source/Plugins/SymbolFile/DWARF/DWARFDebugMacro.cpp @@ -25,7 +25,7 @@ header.m_version = debug_macro_data.GetU16(offset); uint8_t flags = debug_macro_data.GetU8(offset); - header.m_offset_is_64_bit = flags & OFFSET_SIZE_MASK ? true : false; + header.m_offset_is_64_bit = (flags & OFFSET_SIZE_MASK) != 0; if (flags & DEBUG_LINE_OFFSET_MASK) { if (header.m_offset_is_64_bit) Index: source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp =================================================================== --- source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp +++ source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp @@ -648,9 +648,7 @@ } bool DWARFUnit::Supports_DW_AT_APPLE_objc_complete_type() { - if (GetProducer() == eProducerLLVMGCC) - return false; - return true; + return GetProducer() != eProducerLLVMGCC; } bool DWARFUnit::DW_AT_decl_file_attributes_are_invalid() { @@ -662,11 +660,8 @@ bool DWARFUnit::Supports_unnamed_objc_bitfields() { if (GetProducer() == eProducerClang) { const uint32_t major_version = GetProducerVersionMajor(); - if (major_version > 425 || - (major_version == 425 && GetProducerVersionUpdate() >= 13)) - return true; - else - return false; + return major_version > 425 || + (major_version == 425 && GetProducerVersionUpdate() >= 13); } return true; // Assume all other compilers didn't have incorrect ObjC bitfield // info Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp =================================================================== --- source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -1679,7 +1679,7 @@ DWARFUnit *dwarf_cu = debug_info->GetCompileUnitAtIndex(cu_idx); const DWARFBaseDIE die = dwarf_cu->GetUnitDIEOnly(); - if (die && die.HasChildren() == false) { + if (die && !die.HasChildren()) { const char *name = die.GetAttributeValueAsString(DW_AT_name, nullptr); if (name) { @@ -2265,7 +2265,7 @@ sc.block = function_block.FindBlockByID(inlined_die.GetID()); if (sc.block == NULL) sc.block = function_block.FindBlockByID(inlined_die.GetOffset()); - if (sc.block == NULL || sc.block->GetStartAddress(addr) == false) + if (sc.block == NULL || !sc.block->GetStartAddress(addr)) addr.Clear(); } else { sc.block = NULL; Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp =================================================================== --- source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp +++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp @@ -89,7 +89,7 @@ idx < oso_end_idx; ++idx) { Symbol *exe_symbol = exe_symtab->SymbolAtIndex(idx); if (exe_symbol) { - if (exe_symbol->IsDebug() == false) + if (!exe_symbol->IsDebug()) continue; switch (exe_symbol->GetType()) { @@ -179,7 +179,7 @@ GetSymbolVendor(bool can_create = true, lldb_private::Stream *feedback_strm = NULL) override { // Scope for locker - if (m_symfile_ap.get() || can_create == false) + if (m_symfile_ap.get() || !can_create) return m_symfile_ap.get(); ModuleSP exe_module_sp(m_exe_module_wp.lock()); @@ -1155,7 +1155,7 @@ // Only search all .o files for the definition if we don't need the // implementation because otherwise, with a valid debug map we should have // the ObjC class symbol and the code above should have found it. - if (must_be_implementation == false) { + if (!must_be_implementation) { TypeSP type_sp; ForEachSymbolFile([&](SymbolFileDWARF *oso_dwarf) -> bool { @@ -1190,10 +1190,7 @@ ForEachSymbolFile([&](SymbolFileDWARF *oso_dwarf) -> bool { oso_dwarf->FindTypes(sc, name, parent_decl_ctx, append, max_matches, searched_symbol_files, types); - if (types.GetSize() >= max_matches) - return true; - else - return false; + return types.GetSize() >= max_matches; }); } Index: source/Plugins/SymbolFile/PDB/PDBASTParser.cpp =================================================================== --- source/Plugins/SymbolFile/PDB/PDBASTParser.cpp +++ source/Plugins/SymbolFile/PDB/PDBASTParser.cpp @@ -658,7 +658,7 @@ CompilerType element_ast_type = element_type->GetForwardCompilerType(); // If element type is UDT, it needs to be complete. if (ClangASTContext::IsCXXClassType(element_ast_type) && - element_ast_type.GetCompleteType() == false) { + !element_ast_type.GetCompleteType()) { if (ClangASTContext::StartTagDeclarationDefinition(element_ast_type)) { ClangASTContext::CompleteTagDeclarationDefinition(element_ast_type); } else { Index: source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp =================================================================== --- source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp +++ source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp @@ -237,8 +237,7 @@ // object is DBGSourcePath std::string DBGSourcePath = object->GetStringValue(); - if (new_style_source_remapping_dictionary == - false && + if (!new_style_source_remapping_dictionary && !original_DBGSourcePath_value.empty()) { DBGSourcePath = original_DBGSourcePath_value; } Index: source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp =================================================================== --- source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp +++ source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp @@ -238,7 +238,7 @@ error.Clear(); - if (thread.SafeToCallFunctions() == false) { + if (!thread.SafeToCallFunctions()) { if (log) log->Printf("Not safe to call functions on thread 0x%" PRIx64, thread.GetID()); Index: source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp =================================================================== --- source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp +++ source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp @@ -241,7 +241,7 @@ error.Clear(); - if (thread.SafeToCallFunctions() == false) { + if (!thread.SafeToCallFunctions()) { if (log) log->Printf("Not safe to call functions on thread 0x%" PRIx64, thread.GetID()); Index: source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.cpp =================================================================== --- source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.cpp +++ source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.cpp @@ -243,7 +243,7 @@ error.Clear(); - if (thread.SafeToCallFunctions() == false) { + if (!thread.SafeToCallFunctions()) { if (log) log->Printf("Not safe to call functions on thread 0x%" PRIx64, thread.GetID()); Index: source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.cpp =================================================================== --- source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.cpp +++ source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.cpp @@ -248,7 +248,7 @@ error.Clear(); - if (thread.SafeToCallFunctions() == false) { + if (!thread.SafeToCallFunctions()) { if (log) log->Printf("Not safe to call functions on thread 0x%" PRIx64, thread.GetID()); Index: source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp =================================================================== --- source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp +++ source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp @@ -100,10 +100,10 @@ return false; } UnwindPlan::Row::RegisterLocation first_row_pc_loc; - if (first_row->GetRegisterInfo( + if (!first_row->GetRegisterInfo( pc_regnum.GetAsKind(unwind_plan.GetRegisterKind()), - first_row_pc_loc) == false || - first_row_pc_loc.IsAtCFAPlusOffset() == false || + first_row_pc_loc) || + !first_row_pc_loc.IsAtCFAPlusOffset() || first_row_pc_loc.GetOffset() != -wordsize) { return false; } Index: source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp =================================================================== --- source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp +++ source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp @@ -304,26 +304,20 @@ // pushq %rbp [0x55] bool x86AssemblyInspectionEngine::push_rbp_pattern_p() { uint8_t *p = m_cur_insn; - if (*p == 0x55) - return true; - return false; + return *p == 0x55; } // pushq $0 ; the first instruction in start() [0x6a 0x00] bool x86AssemblyInspectionEngine::push_0_pattern_p() { uint8_t *p = m_cur_insn; - if (*p == 0x6a && *(p + 1) == 0x0) - return true; - return false; + return *p == 0x6a && *(p + 1) == 0x0; } // pushq $0 // pushl $0 bool x86AssemblyInspectionEngine::push_imm_pattern_p() { uint8_t *p = m_cur_insn; - if (*p == 0x68 || *p == 0x6a) - return true; - return false; + return *p == 0x68 || *p == 0x6a; } // pushl imm8(%esp) @@ -675,9 +669,7 @@ // ret [0xc9] or [0xc2 imm8] or [0xca imm8] bool x86AssemblyInspectionEngine::ret_pattern_p() { uint8_t *p = m_cur_insn; - if (*p == 0xc9 || *p == 0xc2 || *p == 0xca || *p == 0xc3) - return true; - return false; + return *p == 0xc9 || *p == 0xc2 || *p == 0xca || *p == 0xc3; } uint32_t x86AssemblyInspectionEngine::extract_4(uint8_t *b) { @@ -723,7 +715,7 @@ if (data == nullptr || size == 0) return false; - if (m_register_map_initialized == false) + if (!m_register_map_initialized) return false; addr_t current_func_text_offset = 0; @@ -864,7 +856,7 @@ // on the stack if (nonvolatile_reg_p(machine_regno) && machine_regno_to_lldb_regno(machine_regno, lldb_regno) && - saved_registers[machine_regno] == false) { + !saved_registers[machine_regno]) { UnwindPlan::Row::RegisterLocation regloc; if (is_aligned) regloc.SetAtAFAPlusOffset(-current_sp_bytes_offset_from_fa); @@ -881,7 +873,7 @@ if (nonvolatile_reg_p(machine_regno) && machine_regno_to_lldb_regno(machine_regno, lldb_regno) && - saved_registers[machine_regno] == true) { + saved_registers[machine_regno]) { saved_registers[machine_regno] = false; row->RemoveRegisterInfo(lldb_regno); @@ -953,7 +945,7 @@ else if (mov_reg_to_local_stack_frame_p(machine_regno, stack_offset) && nonvolatile_reg_p(machine_regno) && machine_regno_to_lldb_regno(machine_regno, lldb_regno) && - saved_registers[machine_regno] == false) { + !saved_registers[machine_regno]) { saved_registers[machine_regno] = true; UnwindPlan::Row::RegisterLocation regloc; @@ -1081,7 +1073,7 @@ } } - if (in_epilogue == false && row_updated) { + if (!in_epilogue && row_updated) { // If we're not in an epilogue sequence, save the updated Row UnwindPlan::Row *newrow = new UnwindPlan::Row; *newrow = *row.get(); @@ -1096,7 +1088,7 @@ // We may change the sp value without adding a new Row necessarily -- keep // track of it either way. - if (in_epilogue == false) { + if (!in_epilogue) { prologue_completed_sp_bytes_offset_from_cfa = current_sp_bytes_offset_from_fa; prologue_completed_is_aligned = is_aligned; @@ -1362,7 +1354,7 @@ uint8_t *data, size_t size, size_t &offset) { offset = 0; - if (m_register_map_initialized == false) + if (!m_register_map_initialized) return false; while (offset < size) { Index: source/Symbol/Block.cpp =================================================================== --- source/Symbol/Block.cpp +++ source/Symbol/Block.cpp @@ -83,7 +83,7 @@ size_t num_ranges = m_ranges.GetSize(); for (size_t i = 0; i < num_ranges; ++i) { const Range &range = m_ranges.GetEntryRef(i); - if (parent_block != nullptr && parent_block->Contains(range) == false) + if (parent_block != nullptr && !parent_block->Contains(range)) *s << '!'; else *s << ' '; @@ -369,7 +369,7 @@ } VariableListSP Block::GetBlockVariableList(bool can_create) { - if (m_parsed_block_variables == false) { + if (!m_parsed_block_variables) { if (m_variable_list_sp.get() == nullptr && can_create) { m_parsed_block_variables = true; SymbolContext sc; @@ -402,7 +402,7 @@ collection::const_iterator pos, end = m_children.end(); for (pos = m_children.begin(); pos != end; ++pos) { Block *child_block = pos->get(); - if (stop_if_child_block_is_inlined_function == false || + if (!stop_if_child_block_is_inlined_function || child_block->GetInlinedFunctionInfo() == nullptr) { num_variables_added += child_block->AppendBlockVariables( can_create, get_child_block_variables, Index: source/Symbol/ClangASTContext.cpp =================================================================== --- source/Symbol/ClangASTContext.cpp +++ 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 @@ -3933,9 +3930,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) { @@ -5590,7 +5585,7 @@ ->getDecl()); // Skip empty base classes - if (ClangASTContext::RecordHasFields(base_class_decl) == false) + if (!ClangASTContext::RecordHasFields(base_class_decl)) continue; num_children++; @@ -6652,7 +6647,7 @@ if (omit_empty_base_classes) { base_class_decl = llvm::cast( base_class->getType()->getAs()->getDecl()); - if (ClangASTContext::RecordHasFields(base_class_decl) == false) + if (!ClangASTContext::RecordHasFields(base_class_decl)) continue; } @@ -7447,7 +7442,7 @@ ->getAs() ->getDecl()); if (omit_empty_base_classes && - ClangASTContext::RecordHasFields(base_class_decl) == false) + !ClangASTContext::RecordHasFields(base_class_decl)) continue; CompilerType base_class_clang_type(getASTContext(), @@ -9102,8 +9097,7 @@ base_class->getType()->getAs()->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()) Index: source/Symbol/ClangASTImporter.cpp =================================================================== --- source/Symbol/ClangASTImporter.cpp +++ source/Symbol/ClangASTImporter.cpp @@ -1002,7 +1002,7 @@ if (isa(to) || isa(to)) { RecordDecl *from_record_decl = dyn_cast(from); if (from_record_decl == nullptr || - from_record_decl->isInjectedClassName() == false) { + !from_record_decl->isInjectedClassName()) { NamedDecl *to_named_decl = dyn_cast(to); if (!m_decls_already_deported->count(to_named_decl)) Index: source/Symbol/CompactUnwindInfo.cpp =================================================================== --- source/Symbol/CompactUnwindInfo.cpp +++ source/Symbol/CompactUnwindInfo.cpp @@ -259,7 +259,7 @@ m_objfile.GetModule()->LogMessage( log, "Reading compact unwind first-level indexes"); - if (m_unwindinfo_data_computed == false) { + if (!m_unwindinfo_data_computed) { if (m_section_sp->IsEncrypted()) { // Can't get section contents of a protected/encrypted section until we // have a live process and can read them out of memory. @@ -529,7 +529,7 @@ --it; } - if (it->sentinal_entry == true) { + if (it->sentinal_entry) { return false; } @@ -925,7 +925,7 @@ for (uint32_t i = 0; i < register_count; i++) { int renum = 0; for (int j = 1; j < 7; j++) { - if (used[j] == false) { + if (!used[j]) { if (renum == permunreg[i]) { registers[i] = j; used[j] = true; @@ -1187,7 +1187,7 @@ for (uint32_t i = 0; i < register_count; i++) { int renum = 0; for (int j = 1; j < 7; j++) { - if (used[j] == false) { + if (!used[j]) { if (renum == permunreg[i]) { registers[i] = j; used[j] = true; Index: source/Symbol/CompileUnit.cpp =================================================================== --- source/Symbol/CompileUnit.cpp +++ source/Symbol/CompileUnit.cpp @@ -291,7 +291,7 @@ // If we are not looking for inlined functions and our file spec doesn't // match then we are done... - if (file_spec_matches_cu_file_spec == false && check_inlines == false) + if (!file_spec_matches_cu_file_spec && !check_inlines) return 0; uint32_t file_idx = Index: source/Symbol/DWARFCallFrameInfo.cpp =================================================================== --- source/Symbol/DWARFCallFrameInfo.cpp +++ source/Symbol/DWARFCallFrameInfo.cpp @@ -161,7 +161,7 @@ module_sp->GetObjectFile() != &m_objfile) return false; - if (GetFDEEntryByFileAddress(addr.GetFileAddress(), fde_entry) == false) + if (!GetFDEEntryByFileAddress(addr.GetFileAddress(), fde_entry)) return false; return FDEToUnwindPlan(fde_entry.data, addr, unwind_plan); } @@ -243,7 +243,7 @@ DWARFCallFrameInfo::ParseCIE(const dw_offset_t cie_offset) { CIESP cie_sp(new CIE(cie_offset)); lldb::offset_t offset = cie_offset; - if (m_cfi_data_initialized == false) + if (!m_cfi_data_initialized) GetCFIData(); uint32_t length = m_cfi_data.GetU32(&offset); dw_offset_t cie_id, end_offset; @@ -394,7 +394,7 @@ } void DWARFCallFrameInfo::GetCFIData() { - if (m_cfi_data_initialized == false) { + if (!m_cfi_data_initialized) { Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_UNWIND)); if (log) m_objfile.GetModule()->LogMessage(log, "Reading EH frame info"); @@ -431,7 +431,7 @@ } lldb::offset_t offset = 0; - if (m_cfi_data_initialized == false) + if (!m_cfi_data_initialized) GetCFIData(); while (m_cfi_data.ValidOffsetForDataOfSize(offset, 8)) { const dw_offset_t current_entry = offset; @@ -533,7 +533,7 @@ if (m_section_sp.get() == nullptr || m_section_sp->IsEncrypted()) return false; - if (m_cfi_data_initialized == false) + if (!m_cfi_data_initialized) GetCFIData(); uint32_t length = m_cfi_data.GetU32(&offset); Index: source/Symbol/FuncUnwinders.cpp =================================================================== --- source/Symbol/FuncUnwinders.cpp +++ source/Symbol/FuncUnwinders.cpp @@ -255,7 +255,7 @@ int current_offset) { std::lock_guard guard(m_mutex); if (m_unwind_plan_assembly_sp.get() || m_tried_unwind_plan_assembly || - m_unwind_table.GetAllowAssemblyEmulationUnwindPlans() == false) { + !m_unwind_table.GetAllowAssemblyEmulationUnwindPlans()) { return m_unwind_plan_assembly_sp; } Index: source/Symbol/ObjectFile.cpp =================================================================== --- source/Symbol/ObjectFile.cpp +++ source/Symbol/ObjectFile.cpp @@ -588,9 +588,7 @@ regex_match.GetMatchAtIndex(path_with_object, 2, obj)) { archive_file.SetFile(path, FileSpec::Style::native); archive_object.SetCString(obj.c_str()); - if (must_exist && !FileSystem::Instance().Exists(archive_file)) - return false; - return true; + return !(must_exist && !FileSystem::Instance().Exists(archive_file)); } } return false; Index: source/Symbol/SymbolContext.cpp =================================================================== --- source/Symbol/SymbolContext.cpp +++ source/Symbol/SymbolContext.cpp @@ -105,12 +105,12 @@ if (function != nullptr) { SymbolContext inline_parent_sc; Address inline_parent_addr; - if (show_function_name == false) { + if (!show_function_name) { s->Printf("<"); dumped_something = true; } else { ConstString name; - if (show_function_arguments == false) + if (!show_function_arguments) name = function->GetNameNoArguments(); if (!name) name = function->GetName(); @@ -122,7 +122,7 @@ const addr_t function_offset = addr.GetOffset() - function->GetAddressRange().GetBaseAddress().GetOffset(); - if (show_function_name == false) { + if (!show_function_name) { // Print +offset even if offset is 0 dumped_something = true; s->Printf("+%" PRIu64 ">", function_offset); @@ -171,7 +171,7 @@ } } } else if (symbol != nullptr) { - if (show_function_name == false) { + if (!show_function_name) { s->Printf("<"); dumped_something = true; } else if (symbol->GetName()) { @@ -184,7 +184,7 @@ if (addr.IsValid() && symbol->ValueIsAddress()) { const addr_t symbol_offset = addr.GetOffset() - symbol->GetAddressRef().GetOffset(); - if (show_function_name == false) { + if (!show_function_name) { // Print +offset even if offset is 0 dumped_something = true; s->Printf("+%" PRIu64 ">", symbol_offset); @@ -1259,7 +1259,7 @@ } if (merge_symbol_into_function && sc.symbol != nullptr && sc.comp_unit == nullptr && sc.function == nullptr && - sc.block == nullptr && sc.line_entry.IsValid() == false) { + sc.block == nullptr && !sc.line_entry.IsValid()) { if (sc.symbol->ValueIsAddress()) { for (pos = m_symbol_contexts.begin(); pos != end; ++pos) { // Don't merge symbols into inlined function symbol contexts @@ -1289,7 +1289,7 @@ const SymbolContext &symbol_sc, uint32_t start_idx, uint32_t stop_idx) { if (symbol_sc.symbol != nullptr && symbol_sc.comp_unit == nullptr && symbol_sc.function == nullptr && symbol_sc.block == nullptr && - symbol_sc.line_entry.IsValid() == false) { + !symbol_sc.line_entry.IsValid()) { if (symbol_sc.symbol->ValueIsAddress()) { const size_t end = std::min(m_symbol_contexts.size(), stop_idx); for (size_t i = start_idx; i < end; ++i) { Index: source/Symbol/Symtab.cpp =================================================================== --- source/Symbol/Symtab.cpp +++ source/Symbol/Symtab.cpp @@ -740,7 +740,7 @@ for (uint32_t i = 0; i < sym_end; i++) { if (symbol_type == eSymbolTypeAny || m_symbols[i].GetType() == symbol_type) { - if (CheckSymbolAtIndex(i, symbol_debug_type, symbol_visibility) == false) + if (!CheckSymbolAtIndex(i, symbol_debug_type, symbol_visibility)) continue; const char *name = m_symbols[i].GetName().AsCString(); Index: source/Symbol/Type.cpp =================================================================== --- source/Symbol/Type.cpp +++ source/Symbol/Type.cpp @@ -746,10 +746,7 @@ } bool TypeAndOrName::IsEmpty() const { - if ((bool)m_type_name || (bool)m_type_pair) - return false; - else - return true; + return !((bool)m_type_name || (bool)m_type_pair); } void TypeAndOrName::Clear() { Index: source/Symbol/TypeSystem.cpp =================================================================== --- source/Symbol/TypeSystem.cpp +++ source/Symbol/TypeSystem.cpp @@ -193,7 +193,7 @@ TypeSystem *type_system = pair.second.get(); if (type_system && !visited.count(type_system)) { visited.insert(type_system); - if (callback(type_system) == false) + if (!callback(type_system)) break; } } Index: source/Target/Platform.cpp =================================================================== --- source/Target/Platform.cpp +++ source/Target/Platform.cpp @@ -1586,14 +1586,14 @@ if (process->GetModuleSpec(module_spec.GetFileSpec(), module_spec.GetArchitecture(), resolved_module_spec)) { - if (module_spec.GetUUID().IsValid() == false || + if (!module_spec.GetUUID().IsValid() || module_spec.GetUUID() == resolved_module_spec.GetUUID()) { got_module_spec = true; } } } - if (module_spec.GetArchitecture().IsValid() == false) { + if (!module_spec.GetArchitecture().IsValid()) { Status error; // No valid architecture was specified, ask the platform for the // architectures that we should be using (in the correct order) and see if @@ -1616,7 +1616,7 @@ // Get module information from a target. if (!GetModuleSpec(module_spec.GetFileSpec(), module_spec.GetArchitecture(), resolved_module_spec)) { - if (module_spec.GetUUID().IsValid() == false || + if (!module_spec.GetUUID().IsValid() || module_spec.GetUUID() == resolved_module_spec.GetUUID()) { return module_resolver(module_spec); } Index: source/Target/QueueItem.cpp =================================================================== --- source/Target/QueueItem.cpp +++ source/Target/QueueItem.cpp @@ -94,7 +94,7 @@ ProcessSP QueueItem::GetProcessSP() { return m_process_wp.lock(); } void QueueItem::FetchEntireItem() { - if (m_have_fetched_entire_item == true) + if (m_have_fetched_entire_item) return; ProcessSP process_sp = m_process_wp.lock(); if (process_sp) { Index: source/Target/RegisterNumber.cpp =================================================================== --- source/Target/RegisterNumber.cpp +++ source/Target/RegisterNumber.cpp @@ -61,26 +61,15 @@ return false; if (m_kind == rhs.m_kind) { - if (m_regnum == rhs.m_regnum) - return true; - else - return false; + return m_regnum == rhs.m_regnum; } uint32_t rhs_regnum = rhs.GetAsKind(m_kind); if (rhs_regnum != LLDB_INVALID_REGNUM) { - if (m_regnum == rhs_regnum) - return true; - else - return false; + return m_regnum == rhs_regnum; } uint32_t lhs_regnum = GetAsKind(rhs.m_kind); - { - if (lhs_regnum == rhs.m_regnum) - return true; - else - return false; - } + { return lhs_regnum == rhs.m_regnum; } return false; } Index: source/Target/StackFrame.cpp =================================================================== --- source/Target/StackFrame.cpp +++ source/Target/StackFrame.cpp @@ -1079,9 +1079,9 @@ m_sc.function->GetAddressRange().GetBaseAddress().GetLoadAddress( exe_ctx.GetTargetPtr()); - if (m_sc.function->GetFrameBaseExpression().Evaluate( + if (!m_sc.function->GetFrameBaseExpression().Evaluate( &exe_ctx, nullptr, loclist_base_addr, nullptr, nullptr, - expr_value, &m_frame_base_error) == false) { + expr_value, &m_frame_base_error)) { // We should really have an error if evaluate returns, but in case we // don't, lets set the error to something at least. if (m_frame_base_error.Success()) Index: source/Target/StopInfo.cpp =================================================================== --- source/Target/StopInfo.cpp +++ source/Target/StopInfo.cpp @@ -542,9 +542,9 @@ __FUNCTION__, m_value); } - if ((m_should_stop == false || internal_breakpoint) - && thread_sp->CompletedPlanOverridesBreakpoint()) { - + if ((!m_should_stop || internal_breakpoint) && + thread_sp->CompletedPlanOverridesBreakpoint()) { + // Override should_stop decision when we have completed step plan // additionally to the breakpoint m_should_stop = true; Index: source/Target/TargetList.cpp =================================================================== --- source/Target/TargetList.cpp +++ source/Target/TargetList.cpp @@ -234,7 +234,7 @@ // All platforms for all modules in the executable match, so we can // select this platform platform_sp = platforms.front(); - } else if (more_than_one_platforms == false) { + } else if (!more_than_one_platforms) { // No platforms claim to support this file error.SetErrorString("No matching platforms found for this file, " "specify one with the --platform option"); Index: source/Target/ThreadPlanBase.cpp =================================================================== --- source/Target/ThreadPlanBase.cpp +++ source/Target/ThreadPlanBase.cpp @@ -57,10 +57,7 @@ bool ThreadPlanBase::DoPlanExplainsStop(Event *event_ptr) { // The base plan should defer to its tracer, since by default it always // handles the stop. - if (TracerExplainsStop()) - return false; - else - return true; + return !TracerExplainsStop(); } Vote ThreadPlanBase::ShouldReportStop(Event *event_ptr) { Index: source/Target/ThreadPlanStepOverRange.cpp =================================================================== --- source/Target/ThreadPlanStepOverRange.cpp +++ source/Target/ThreadPlanStepOverRange.cpp @@ -123,10 +123,7 @@ } } // Fall back to symbol if we have no decision from comp_unit/function/block. - if (m_addr_context.symbol && m_addr_context.symbol == context.symbol) { - return true; - } - return false; + return m_addr_context.symbol && m_addr_context.symbol == context.symbol; } bool ThreadPlanStepOverRange::ShouldStop(Event *event_ptr) { Index: source/Utility/ArchSpec.cpp =================================================================== --- source/Utility/ArchSpec.cpp +++ source/Utility/ArchSpec.cpp @@ -610,10 +610,8 @@ bool ArchSpec::IsMIPS() const { const llvm::Triple::ArchType machine = GetMachine(); - if (machine == llvm::Triple::mips || machine == llvm::Triple::mipsel || - machine == llvm::Triple::mips64 || machine == llvm::Triple::mips64el) - return true; - return false; + return machine == llvm::Triple::mips || machine == llvm::Triple::mipsel || + machine == llvm::Triple::mips64 || machine == llvm::Triple::mips64el; } std::string ArchSpec::GetTargetABI() const { @@ -1096,9 +1094,7 @@ const llvm::Triple::EnvironmentType rhs_triple_env = rhs_triple.getEnvironment(); - if (!IsCompatibleEnvironment(lhs_triple_env, rhs_triple_env)) - return false; - return true; + return IsCompatibleEnvironment(lhs_triple_env, rhs_triple_env); } return false; } Index: source/Utility/RegisterValue.cpp =================================================================== --- source/Utility/RegisterValue.cpp +++ source/Utility/RegisterValue.cpp @@ -475,7 +475,7 @@ bool RegisterValue::CopyValue(const RegisterValue &rhs) { if (this == &rhs) - return rhs.m_type == eTypeInvalid ? false : true; + return rhs.m_type != eTypeInvalid; m_type = rhs.m_type; switch (m_type) { Index: source/Utility/StructuredData.cpp =================================================================== --- source/Utility/StructuredData.cpp +++ source/Utility/StructuredData.cpp @@ -226,7 +226,7 @@ } void StructuredData::Boolean::Dump(Stream &s, bool pretty_print) const { - if (m_value == true) + if (m_value) s.PutCString("true"); else s.PutCString("false"); Index: tools/debugserver/source/JSONGenerator.h =================================================================== --- tools/debugserver/source/JSONGenerator.h +++ tools/debugserver/source/JSONGenerator.h @@ -182,7 +182,7 @@ void SetValue(bool value) { m_value = value; } void Dump(std::ostream &s) const override { - if (m_value == true) + if (m_value) s << "true"; else s << "false"; @@ -262,7 +262,7 @@ s << "{"; for (collection::const_iterator iter = m_dict.begin(); iter != m_dict.end(); ++iter) { - if (have_printed_one_elem == false) { + if (!have_printed_one_elem) { have_printed_one_elem = true; } else { s << ","; Index: tools/debugserver/source/MacOSX/Genealogy.cpp =================================================================== --- tools/debugserver/source/MacOSX/Genealogy.cpp +++ tools/debugserver/source/MacOSX/Genealogy.cpp @@ -74,8 +74,7 @@ // (else we'll need to hit the timeout for every thread we're asked about.) // We'll try again at the next public stop. - if (m_thread_activities.size() == 0 && - m_diagnosticd_call_timed_out == false) { + if (m_thread_activities.size() == 0 && !m_diagnosticd_call_timed_out) { GetActivities(pid, thread_list, task); } std::map::const_iterator search; Index: tools/debugserver/source/MacOSX/MachProcess.mm =================================================================== --- tools/debugserver/source/MacOSX/MachProcess.mm +++ tools/debugserver/source/MacOSX/MachProcess.mm @@ -783,8 +783,8 @@ uuid_unparse_upper(image_infos[i].macho_info.uuid, uuidstr); image_info_dict_sp->AddStringItem("uuid", uuidstr); - if (image_infos[i].macho_info.min_version_os_name.empty() == false && - image_infos[i].macho_info.min_version_os_version.empty() == false) { + if (!image_infos[i].macho_info.min_version_os_name.empty() && + !image_infos[i].macho_info.min_version_os_version.empty()) { image_info_dict_sp->AddStringItem( "min_version_os_name", image_infos[i].macho_info.min_version_os_name); image_info_dict_sp->AddStringItem( @@ -1602,7 +1602,7 @@ void MachProcess::ReplyToAllExceptions() { PTHREAD_MUTEX_LOCKER(locker, m_exception_messages_mutex); - if (m_exception_messages.empty() == false) { + if (!m_exception_messages.empty()) { MachException::Message::iterator pos; MachException::Message::iterator begin = m_exception_messages.begin(); MachException::Message::iterator end = m_exception_messages.end(); @@ -1774,7 +1774,7 @@ if (bp->IsHardware()) { bool hw_disable_result = m_thread_list.DisableHardwareBreakpoint(bp); - if (hw_disable_result == true) { + if (hw_disable_result) { bp->SetEnabled(false); // Let the thread list know that a breakpoint has been modified if (remove) { @@ -1909,7 +1909,7 @@ if (wp->IsHardware()) { bool hw_disable_result = m_thread_list.DisableHardwareWatchpoint(wp); - if (hw_disable_result == true) { + if (hw_disable_result) { wp->SetEnabled(false); if (remove) m_watchpoints.Remove(addr); @@ -2179,7 +2179,7 @@ m_thread_list.Dump(); bool step_more = false; - if (m_thread_list.ShouldStop(step_more) && auto_resume == false) { + if (m_thread_list.ShouldStop(step_more) && !auto_resume) { // Wait for the eEventProcessRunningStateChanged event to be reset // before changing state to stopped to avoid race condition with // very fast start/stops Index: tools/debugserver/source/MacOSX/MachThread.cpp =================================================================== --- tools/debugserver/source/MacOSX/MachThread.cpp +++ tools/debugserver/source/MacOSX/MachThread.cpp @@ -83,7 +83,7 @@ DNBLogThreadedIf(LOG_THREAD | LOG_VERBOSE, "MachThread::%s ( )", __FUNCTION__); DNBError err; - if (MachPortNumberIsValid(m_mach_port_number) == false) + if (!MachPortNumberIsValid(m_mach_port_number)) return false; integer_t times_to_resume; @@ -121,7 +121,7 @@ DNBLogThreadedIf(LOG_THREAD | LOG_VERBOSE, "MachThread::%s ( )", __FUNCTION__); DNBError err; - if (MachPortNumberIsValid(m_mach_port_number) == false) + if (!MachPortNumberIsValid(m_mach_port_number)) return false; if (m_suspend_count > 0) { Index: tools/debugserver/source/MacOSX/MachVMRegion.cpp =================================================================== --- tools/debugserver/source/MacOSX/MachVMRegion.cpp +++ tools/debugserver/source/MacOSX/MachVMRegion.cpp @@ -166,10 +166,7 @@ // doesn't mean that "addr" is in the range. The data in this object will // be valid though, so you could see where the next region begins. So we // return false, yet leave "m_err" with a successfull return code. - if ((addr < m_start) || (addr >= (m_start + m_size))) - return false; - - return true; + return !((addr < m_start) || (addr >= (m_start + m_size))); } uint32_t MachVMRegion::GetDNBPermissions() const { Index: tools/debugserver/source/MacOSX/i386/DNBArchImplI386.cpp =================================================================== --- tools/debugserver/source/MacOSX/i386/DNBArchImplI386.cpp +++ tools/debugserver/source/MacOSX/i386/DNBArchImplI386.cpp @@ -889,10 +889,7 @@ LOG_WATCHPOINTS, "DNBArchImplI386::RollbackTransForHWP() SetDBGState() => 0x%8.8x.", kret); - if (kret == KERN_SUCCESS) - return true; - else - return false; + return kret == KERN_SUCCESS; } bool DNBArchImplI386::FinishTransForHWP() { m_2pc_trans_state = Trans_Done; @@ -918,7 +915,7 @@ return INVALID_NUB_HW_INDEX; // We must watch for either read or write - if (read == false && write == false) + if (!read && !write) return INVALID_NUB_HW_INDEX; // Read the debug state Index: tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp =================================================================== --- tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp +++ tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp @@ -844,10 +844,7 @@ "DNBArchImplX86_64::RollbackTransForHWP() SetDBGState() => 0x%8.8x.", kret); - if (kret == KERN_SUCCESS) - return true; - else - return false; + return kret == KERN_SUCCESS; } bool DNBArchImplX86_64::FinishTransForHWP() { m_2pc_trans_state = Trans_Done; @@ -873,7 +870,7 @@ return INVALID_NUB_HW_INDEX; // We must watch for either read or write - if (read == false && write == false) + if (!read && !write) return INVALID_NUB_HW_INDEX; // Read the debug state Index: tools/debugserver/source/RNBRemote.cpp =================================================================== --- tools/debugserver/source/RNBRemote.cpp +++ tools/debugserver/source/RNBRemote.cpp @@ -3413,10 +3413,7 @@ RNBRemoteSP remoteSP(g_remoteSP); if (remoteSP.get() != NULL) { RNBRemote *remote = remoteSP.get(); - if (remote->Comm().IsConnected()) - return false; - else - return true; + return !remote->Comm().IsConnected(); } return true; } @@ -3817,7 +3814,7 @@ attach_failed_due_to_sip = true; } - if (attach_failed_due_to_sip == false) { + if (!attach_failed_due_to_sip) { int csops_flags = 0; int retval = ::csops(pid_attaching_to, CS_OPS_STATUS, &csops_flags, sizeof(csops_flags)); @@ -5300,7 +5297,7 @@ thread_dict_sp->AddStringItem("reason", reason_value); - if (threads_with_valid_stop_info_only == false) { + if (!threads_with_valid_stop_info_only) { const char *thread_name = DNBThreadGetName(pid, tid); if (thread_name && thread_name[0]) thread_dict_sp->AddStringItem("name", thread_name); @@ -5488,7 +5485,7 @@ bool need_to_print_comma = false; - if (thread_activity_sp && timed_out == false) { + if (thread_activity_sp && !timed_out) { const Genealogy::Activity *activity = &thread_activity_sp->current_activity; bool need_vouchers_comma_sep = false; Index: tools/debugserver/source/RNBServices.cpp =================================================================== --- tools/debugserver/source/RNBServices.cpp +++ tools/debugserver/source/RNBServices.cpp @@ -57,9 +57,9 @@ const pid_t pid = proc_info.kp_proc.p_pid; // Skip zombie processes and processes with unset status - if (kinfo_user_matches == false || // User is acceptable - pid == our_pid || // Skip this process - pid == 0 || // Skip kernel (kernel pid is zero) + if (!kinfo_user_matches || // User is acceptable + pid == our_pid || // Skip this process + pid == 0 || // Skip kernel (kernel pid is zero) proc_info.kp_proc.p_stat == SZOMB || // Zombies are bad, they like brains... proc_info.kp_proc.p_flag & P_TRACED || // Being debugged? Index: tools/debugserver/source/libdebugserver.cpp =================================================================== --- tools/debugserver/source/libdebugserver.cpp +++ tools/debugserver/source/libdebugserver.cpp @@ -176,7 +176,7 @@ case eStateSuspended: case eStateCrashed: case eStateStopped: - if (initialize == false) { + if (!initialize) { // Compare the last stop count to our current notion of a stop count // to make sure we don't notify more than once for a given stop. nub_size_t prev_pid_stop_count = ctx.GetProcessStopCount(); Index: tools/lldb-mi/MICmdArgValFile.cpp =================================================================== --- tools/lldb-mi/MICmdArgValFile.cpp +++ tools/lldb-mi/MICmdArgValFile.cpp @@ -158,10 +158,7 @@ return false; const bool bValidChars = IsValidChars(vrFileNamePath); - if (bValidChars || bHavePosSlash || bHaveBckSlash) - return true; - - return false; + return bValidChars || bHavePosSlash || bHaveBckSlash; } //++ Index: tools/lldb-mi/MICmdArgValOptionLong.cpp =================================================================== --- tools/lldb-mi/MICmdArgValOptionLong.cpp +++ tools/lldb-mi/MICmdArgValOptionLong.cpp @@ -252,10 +252,7 @@ return false; const CMIUtilString strArg = vrTxt.substr(2); - if (strArg.IsNumber()) - return false; - - return true; + return !strArg.IsNumber(); } //++ Index: tools/lldb-mi/MICmdArgValString.cpp =================================================================== --- tools/lldb-mi/MICmdArgValString.cpp +++ tools/lldb-mi/MICmdArgValString.cpp @@ -33,7 +33,7 @@ // Throws: None. //-- CMICmdArgValString::CMICmdArgValString(const bool vbAnything) - : m_bHandleQuotedString(vbAnything ? true : false), m_bAcceptNumbers(false), + : m_bHandleQuotedString(vbAnything), m_bAcceptNumbers(false), m_bHandleDirPaths(false), m_bHandleAnything(vbAnything) {} //++ @@ -391,8 +391,5 @@ return false; const size_t nLen = vrTxt.length(); - if ((nLen > 5) && ((nPos + 2) == (nPos2 - 2))) - return false; - - return true; + return !((nLen > 5) && ((nPos + 2) == (nPos2 - 2))); } Index: tools/lldb-mi/MICmdArgValThreadGrp.cpp =================================================================== --- tools/lldb-mi/MICmdArgValThreadGrp.cpp +++ tools/lldb-mi/MICmdArgValThreadGrp.cpp @@ -115,10 +115,7 @@ return false; const CMIUtilString strNum = vrTxt.substr(1); - if (!strNum.IsNumber()) - return false; - - return true; + return strNum.IsNumber(); } //++ Index: tools/lldb-mi/MICmdFactory.cpp =================================================================== --- tools/lldb-mi/MICmdFactory.cpp +++ tools/lldb-mi/MICmdFactory.cpp @@ -128,10 +128,7 @@ bool CMICmdFactory::HaveAlready(const CMIUtilString &vMiCmd) const { const MapMiCmdToCmdCreatorFn_t::const_iterator it = m_mapMiCmdToCmdCreatorFn.find(vMiCmd); - if (it != m_mapMiCmdToCmdCreatorFn.end()) - return true; - - return false; + return it != m_mapMiCmdToCmdCreatorFn.end(); } //++ Index: tools/lldb-mi/MICmnLLDBDebugSessionInfo.cpp =================================================================== --- tools/lldb-mi/MICmnLLDBDebugSessionInfo.cpp +++ tools/lldb-mi/MICmnLLDBDebugSessionInfo.cpp @@ -532,7 +532,7 @@ const bool vbInSimpleForm, CMIUtilString &vwrStrValue) { const CMICmnLLDBUtilSBValue utilValue(vrValue, true, false); - const bool bExpandAggregates = vbInSimpleForm ? false : true; + const bool bExpandAggregates = !vbInSimpleForm; vwrStrValue = utilValue.GetValue(bExpandAggregates); return MIstatus::success; } Index: tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp =================================================================== --- tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp +++ tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp @@ -437,10 +437,10 @@ sBrkPtInfo.m_nIgnore = brkPt.GetIgnoreCount(); sBrkPtInfo.m_bPending = false; const char *pStrCondition = brkPt.GetCondition(); - sBrkPtInfo.m_bCondition = (pStrCondition != nullptr) ? true : false; + sBrkPtInfo.m_bCondition = pStrCondition != nullptr; sBrkPtInfo.m_strCondition = (pStrCondition != nullptr) ? pStrCondition : "??"; - sBrkPtInfo.m_bBrkPtThreadId = (brkPt.GetThreadID() != 0) ? true : false; + sBrkPtInfo.m_bBrkPtThreadId = brkPt.GetThreadID() != 0; sBrkPtInfo.m_nBrkPtThreadId = brkPt.GetThreadID(); } Index: tools/lldb-mi/MICmnLog.cpp =================================================================== --- tools/lldb-mi/MICmnLog.cpp +++ tools/lldb-mi/MICmnLog.cpp @@ -209,10 +209,7 @@ bool CMICmnLog::HaveMediumAlready(const IMedium &vrMedium) const { IMedium *pMedium = const_cast(&vrMedium); const MapMediumToName_t::const_iterator it = m_mapMediumToName.find(pMedium); - if (it != m_mapMediumToName.end()) - return true; - - return false; + return it != m_mapMediumToName.end(); } //++ Index: tools/lldb-mi/MIUtilMapIdToVariant.cpp =================================================================== --- tools/lldb-mi/MIUtilMapIdToVariant.cpp +++ tools/lldb-mi/MIUtilMapIdToVariant.cpp @@ -52,10 +52,7 @@ bool CMIUtilMapIdToVariant::HaveAlready(const CMIUtilString &vId) const { const MapKeyToVariantValue_t::const_iterator it = m_mapKeyToVariantValue.find(vId); - if (it != m_mapKeyToVariantValue.end()) - return true; - - return false; + return it != m_mapKeyToVariantValue.end(); } //++ Index: tools/lldb-mi/MIUtilString.cpp =================================================================== --- tools/lldb-mi/MIUtilString.cpp +++ tools/lldb-mi/MIUtilString.cpp @@ -378,10 +378,7 @@ return false; const size_t nPos = find_first_not_of("-.0123456789"); - if (nPos != std::string::npos) - return false; - - return true; + return nPos == std::string::npos; } //++ @@ -399,10 +396,7 @@ // Skip '0x..' prefix const size_t nPos = find_first_not_of("01234567890ABCDEFabcedf", 2); - if (nPos != std::string::npos) - return false; - - return true; + return nPos == std::string::npos; } //++ @@ -419,10 +413,7 @@ vwrNumber = 0; if (!IsNumber()) { - if (ExtractNumberFromHexadecimal(vwrNumber)) - return true; - - return false; + return ExtractNumberFromHexadecimal(vwrNumber); } std::stringstream ss(const_cast(*this)); @@ -639,10 +630,7 @@ return false; const size_t nLen = length(); - if ((nLen > 0) && (at(nLen - 1) != cQuote)) - return false; - - return true; + return !((nLen > 0) && (at(nLen - 1) != cQuote)); } //++ Index: tools/lldb-vscode/JSONUtils.cpp =================================================================== --- tools/lldb-vscode/JSONUtils.cpp +++ tools/lldb-vscode/JSONUtils.cpp @@ -97,9 +97,7 @@ } bool ObjectContainsKey(const llvm::json::Object &obj, llvm::StringRef key) { - if (obj.find(key) != obj.end()) - return true; - return false; + return obj.find(key) != obj.end(); } std::vector GetStrings(const llvm::json::Object *obj,