summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target/ThreadPlanStepOut.cpp
diff options
context:
space:
mode:
authorEugene Zelenko <eugene.zelenko@gmail.com>2015-12-15 01:33:19 +0000
committerEugene Zelenko <eugene.zelenko@gmail.com>2015-12-15 01:33:19 +0000
commite65b2cf2975891b83ecbfdc1d92fb89f248129e2 (patch)
tree02fb044f608cd6da5c3728fd235cc39c304723e0 /lldb/source/Target/ThreadPlanStepOut.cpp
parent162b68d86f36bcb19875d0e83cadecd86380abeb (diff)
downloadbcm5719-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/ThreadPlanStepOut.cpp')
-rw-r--r--lldb/source/Target/ThreadPlanStepOut.cpp57
1 files changed, 19 insertions, 38 deletions
diff --git a/lldb/source/Target/ThreadPlanStepOut.cpp b/lldb/source/Target/ThreadPlanStepOut.cpp
index 8ee8d1c4e49..92403cb92ed 100644
--- a/lldb/source/Target/ThreadPlanStepOut.cpp
+++ b/lldb/source/Target/ThreadPlanStepOut.cpp
@@ -7,12 +7,11 @@
//
//===----------------------------------------------------------------------===//
-#include "lldb/Target/ThreadPlanStepOut.h"
-
// C Includes
// C++ Includes
// Other libraries and framework includes
// Project includes
+#include "lldb/Target/ThreadPlanStepOut.h"
#include "lldb/Breakpoint/Breakpoint.h"
#include "lldb/Core/Log.h"
#include "lldb/Core/Value.h"
@@ -53,7 +52,7 @@ ThreadPlanStepOut::ThreadPlanStepOut
m_return_bp_id (LLDB_INVALID_BREAK_ID),
m_return_addr (LLDB_INVALID_ADDRESS),
m_stop_others (stop_others),
- m_immediate_step_from_function(NULL)
+ m_immediate_step_from_function(nullptr)
{
SetFlagsToDefault();
SetupAvoidNoDebug(step_out_avoids_code_without_debug_info);
@@ -80,14 +79,14 @@ ThreadPlanStepOut::ThreadPlanStepOut
{
// First queue a plan that gets us to this inlined frame, and when we get there we'll queue a second
// plan that walks us out of this frame.
- m_step_out_to_inline_plan_sp.reset (new ThreadPlanStepOut(m_thread,
- NULL,
- false,
- stop_others,
- eVoteNoOpinion,
- eVoteNoOpinion,
- frame_idx - 1,
- eLazyBoolNo));
+ m_step_out_to_inline_plan_sp.reset(new ThreadPlanStepOut(m_thread,
+ nullptr,
+ false,
+ stop_others,
+ eVoteNoOpinion,
+ eVoteNoOpinion,
+ frame_idx - 1,
+ eLazyBoolNo));
static_cast<ThreadPlanStepOut *>(m_step_out_to_inline_plan_sp.get())->SetShouldStopHereCallbacks(nullptr, nullptr);
m_step_out_to_inline_plan_sp->SetPrivate(true);
}
@@ -96,7 +95,6 @@ ThreadPlanStepOut::ThreadPlanStepOut
// If we're already at the inlined frame we're stepping through, then just do that now.
QueueInlinedStepPlan(false);
}
-
}
else if (return_frame_sp)
{
@@ -109,7 +107,7 @@ ThreadPlanStepOut::ThreadPlanStepOut
return;
Breakpoint *return_bp = m_thread.CalculateTarget()->CreateBreakpoint (m_return_addr, true, false).get();
- if (return_bp != NULL)
+ if (return_bp != nullptr)
{
return_bp->SetThreadID(m_thread.GetID());
m_return_bp_id = return_bp->GetID();
@@ -125,7 +123,6 @@ ThreadPlanStepOut::ThreadPlanStepOut
}
}
}
-
}
void
@@ -231,10 +228,7 @@ ThreadPlanStepOut::DoPlanExplainsStop (Event *event_ptr)
// If the step out plan is done, then we just need to step through the inlined frame.
if (m_step_out_to_inline_plan_sp)
{
- if (m_step_out_to_inline_plan_sp->MischiefManaged())
- return true;
- else
- return false;
+ return m_step_out_to_inline_plan_sp->MischiefManaged();
}
else if (m_step_through_inline_plan_sp)
{
@@ -249,10 +243,7 @@ ThreadPlanStepOut::DoPlanExplainsStop (Event *event_ptr)
}
else if (m_step_out_further_plan_sp)
{
- if (m_step_out_further_plan_sp->MischiefManaged())
- return true;
- else
- return false;
+ return m_step_out_further_plan_sp->MischiefManaged();
}
// We don't explain signals or breakpoints (breakpoints that handle stepping in or
@@ -282,10 +273,7 @@ ThreadPlanStepOut::DoPlanExplainsStop (Event *event_ptr)
}
else
{
- if (m_immediate_step_from_id < frame_zero_id)
- done = true;
- else
- done = false;
+ done = (m_immediate_step_from_id < frame_zero_id);
}
if (done)
@@ -304,7 +292,6 @@ ThreadPlanStepOut::DoPlanExplainsStop (Event *event_ptr)
if (site_sp->GetNumberOfOwners() == 1)
return true;
-
}
return false;
}
@@ -359,10 +346,7 @@ ThreadPlanStepOut::ShouldStop (Event *event_ptr)
if (!done)
{
StackID frame_zero_id = m_thread.GetStackFrameAtIndex(0)->GetStackID();
- if (frame_zero_id < m_step_out_to_id)
- done = false;
- else
- done = true;
+ done = !(frame_zero_id < m_step_out_to_id);
}
// The normal step out computations think we are done, so all we need to do is consult the ShouldStopHere,
@@ -409,7 +393,7 @@ ThreadPlanStepOut::DoWillResume (StateType resume_state, bool current_plan)
if (current_plan)
{
Breakpoint *return_bp = m_thread.CalculateTarget()->GetBreakpointByID(m_return_bp_id).get();
- if (return_bp != NULL)
+ if (return_bp != nullptr)
return_bp->SetEnabled (true);
}
return true;
@@ -421,7 +405,7 @@ ThreadPlanStepOut::WillStop ()
if (m_return_bp_id != LLDB_INVALID_BREAK_ID)
{
Breakpoint *return_bp = m_thread.CalculateTarget()->GetBreakpointByID(m_return_bp_id).get();
- if (return_bp != NULL)
+ if (return_bp != nullptr)
return_bp->SetEnabled (false);
}
@@ -531,7 +515,7 @@ ThreadPlanStepOut::CalculateReturnValue ()
if (m_return_valobj_sp)
return;
- if (m_immediate_step_from_function != NULL)
+ if (m_immediate_step_from_function != nullptr)
{
CompilerType return_compiler_type = m_immediate_step_from_function->GetCompilerType().GetFunctionReturnType();
if (return_compiler_type)
@@ -550,8 +534,5 @@ ThreadPlanStepOut::IsPlanStale()
// there's something for us to do. Otherwise, we're stale.
StackID frame_zero_id = m_thread.GetStackFrameAtIndex(0)->GetStackID();
- if (frame_zero_id < m_step_out_to_id)
- return false;
- else
- return true;
+ return !(frame_zero_id < m_step_out_to_id);
}
OpenPOWER on IntegriCloud