Tiny refactoring to use member functions instead of directly accessing member fields.

llvm-svn: 148743
This commit is contained in:
Johnny Chen 2012-01-23 23:03:59 +00:00
parent 820417af07
commit fab7a91d92
4 changed files with 11 additions and 7 deletions

View File

@ -70,7 +70,10 @@ public:
}
void
IncrementHitCount ();
IncrementHitCount ()
{
++m_hit_count;
}
uint32_t
GetHardwareIndex () const

View File

@ -212,12 +212,12 @@ BreakpointLocation::ShouldStop (StoppointCallbackContext *context)
bool should_stop = true;
LogSP log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_BREAKPOINTS);
m_hit_count++;
IncrementHitCount();
if (!IsEnabled())
return false;
if (m_hit_count <= GetIgnoreCount())
if (GetHitCount() <= GetIgnoreCount())
return false;
// We only run synchronous callbacks in ShouldStop:

View File

@ -61,7 +61,7 @@ BreakpointSite::GetNextID()
bool
BreakpointSite::ShouldStop (StoppointCallbackContext *context)
{
m_hit_count++;
IncrementHitCount();
return m_owners.ShouldStop (context);
}

View File

@ -66,7 +66,8 @@ Watchpoint::SetDeclInfo (std::string &str)
return;
}
// Override default impl of StoppointLocation::IsHardware() since m_is_hardware
// member field is more accurate.
bool
Watchpoint::IsHardware () const
{
@ -79,12 +80,12 @@ Watchpoint::IsHardware () const
bool
Watchpoint::ShouldStop (StoppointCallbackContext *context)
{
++m_hit_count;
IncrementHitCount();
if (!IsEnabled())
return false;
if (m_hit_count <= GetIgnoreCount())
if (GetHitCount() <= GetIgnoreCount())
return false;
return true;