diff options
author | Eugene Zelenko <eugene.zelenko@gmail.com> | 2015-12-15 01:33:19 +0000 |
---|---|---|
committer | Eugene Zelenko <eugene.zelenko@gmail.com> | 2015-12-15 01:33:19 +0000 |
commit | e65b2cf2975891b83ecbfdc1d92fb89f248129e2 (patch) | |
tree | 02fb044f608cd6da5c3728fd235cc39c304723e0 /lldb/source/Target/ThreadPlanStepRange.cpp | |
parent | 162b68d86f36bcb19875d0e83cadecd86380abeb (diff) | |
download | bcm5719-llvm-e65b2cf2975891b83ecbfdc1d92fb89f248129e2.tar.gz bcm5719-llvm-e65b2cf2975891b83ecbfdc1d92fb89f248129e2.zip |
Fix Clang-tidy modernize-use-nullptr and readability-simplify-boolean-expr warnings in some files in source/Target/.
Simplify smart pointers checks in conditions. Other minor fixes.
llvm-svn: 255598
Diffstat (limited to 'lldb/source/Target/ThreadPlanStepRange.cpp')
-rw-r--r-- | lldb/source/Target/ThreadPlanStepRange.cpp | 43 |
1 files changed, 12 insertions, 31 deletions
diff --git a/lldb/source/Target/ThreadPlanStepRange.cpp b/lldb/source/Target/ThreadPlanStepRange.cpp index 9bddef3c65a..02667f8236e 100644 --- a/lldb/source/Target/ThreadPlanStepRange.cpp +++ b/lldb/source/Target/ThreadPlanStepRange.cpp @@ -7,12 +7,11 @@ // //===----------------------------------------------------------------------===// -#include "lldb/Target/ThreadPlanStepRange.h" - // C Includes // C++ Includes // Other libraries and framework includes // Project includes +#include "lldb/Target/ThreadPlanStepRange.h" #include "lldb/Breakpoint/BreakpointLocation.h" #include "lldb/Breakpoint/BreakpointSite.h" #include "lldb/Core/Disassembler.h" @@ -31,7 +30,6 @@ using namespace lldb; using namespace lldb_private; - //---------------------------------------------------------------------- // ThreadPlanStepRange: Step through a stack range, either stepping over or into // based on the value of \a type. @@ -221,12 +219,9 @@ ThreadPlanStepRange::InRange () new_context.line_entry.line, s.GetData()); } - } } - } - } if (!ret_value && log) @@ -239,7 +234,7 @@ bool ThreadPlanStepRange::InSymbol() { lldb::addr_t cur_pc = m_thread.GetRegisterContext()->GetPC(); - if (m_addr_context.function != NULL) + if (m_addr_context.function != nullptr) { return m_addr_context.function->GetAddressRange().ContainsLoadAddress (cur_pc, m_thread.CalculateTarget().get()); } @@ -291,11 +286,7 @@ ThreadPlanStepRange::CompareCurrentFrameToStartFrame() bool ThreadPlanStepRange::StopOthers () { - if (m_stop_others == lldb::eOnlyThisThread - || m_stop_others == lldb::eOnlyDuringStepping) - return true; - else - return false; + return (m_stop_others == lldb::eOnlyThisThread || m_stop_others == lldb::eOnlyDuringStepping); } InstructionList * @@ -308,14 +299,14 @@ ThreadPlanStepRange::GetInstructionsForAddress(lldb::addr_t addr, size_t &range_ { // Some joker added a zero size range to the stepping range... if (m_address_ranges[i].GetByteSize() == 0) - return NULL; + return nullptr; if (!m_instruction_ranges[i]) { //Disassemble the address range given: ExecutionContext exe_ctx (m_thread.GetProcess()); - const char *plugin_name = NULL; - const char *flavor = NULL; + const char *plugin_name = nullptr; + const char *flavor = nullptr; const bool prefer_file_cache = true; m_instruction_ranges[i] = Disassembler::DisassembleRange(GetTarget().GetArchitecture(), plugin_name, @@ -323,18 +314,17 @@ ThreadPlanStepRange::GetInstructionsForAddress(lldb::addr_t addr, size_t &range_ exe_ctx, m_address_ranges[i], prefer_file_cache); - } if (!m_instruction_ranges[i]) - return NULL; + return nullptr; else { // Find where we are in the instruction list as well. If we aren't at an instruction, - // return NULL. In this case, we're probably lost, and shouldn't try to do anything fancy. + // return nullptr. In this case, we're probably lost, and shouldn't try to do anything fancy. insn_offset = m_instruction_ranges[i]->GetInstructionList().GetIndexOfInstructionAtLoadAddress(addr, GetTarget()); if (insn_offset == UINT32_MAX) - return NULL; + return nullptr; else { range_index = i; @@ -343,7 +333,7 @@ ThreadPlanStepRange::GetInstructionsForAddress(lldb::addr_t addr, size_t &range_ } } } - return NULL; + return nullptr; } void @@ -376,7 +366,7 @@ ThreadPlanStepRange::SetNextBranchBreakpoint () size_t pc_index; size_t range_index; InstructionList *instructions = GetInstructionsForAddress (cur_addr, range_index, pc_index); - if (instructions == NULL) + if (instructions == nullptr) return false; else { @@ -511,15 +501,7 @@ ThreadPlanStepRange::MischiefManaged () else { FrameComparison frame_order = CompareCurrentFrameToStartFrame(); - if (frame_order != eFrameCompareOlder) - { - if (m_no_more_plans) - done = true; - else - done = false; - } - else - done = true; + done = (frame_order != eFrameCompareOlder) ? m_no_more_plans : true; } } @@ -536,7 +518,6 @@ ThreadPlanStepRange::MischiefManaged () { return false; } - } bool |