diff options
author | Jim Ingham <jingham@apple.com> | 2021-06-11 17:00:46 -0700 |
---|---|---|
committer | Jim Ingham <jingham@apple.com> | 2021-06-15 14:34:02 -0700 |
commit | cfb96d845a684a5c567823dbe2aa4392937ee979 (patch) | |
tree | 90bd697e80379e5571851ea981486af352823f1b /lldb/source/Commands/CommandObjectBreakpoint.cpp | |
parent | 56da28240f3c9d1c0b7152749bfd4777c67828e0 (diff) | |
download | llvm-cfb96d845a684a5c567823dbe2aa4392937ee979.zip llvm-cfb96d845a684a5c567823dbe2aa4392937ee979.tar.gz llvm-cfb96d845a684a5c567823dbe2aa4392937ee979.tar.bz2 |
Convert functions that were returning BreakpointOption * to BreakpointOption &.
This is an NFC cleanup.
Many of the API's that returned BreakpointOptions always returned valid ones.
Internally the BreakpointLocations usually have null BreakpointOptions, since they
use their owner's options until an option is set specifically on the location.
So the original code used pointers & unique_ptr everywhere for consistency.
But that made the code hard to reason about from the outside.
This patch changes the code so that everywhere an API is guaranteed to
return a non-null BreakpointOption, it returns it as a reference to make
that clear.
It also changes the Breakpoint to hold a BreakpointOption
member where it previously had a UP. Since we were always filling the UP
in the Breakpoint constructor, having the UP wasn't helping anything.
Differential Revision: https://reviews.llvm.org/D104162
Diffstat (limited to 'lldb/source/Commands/CommandObjectBreakpoint.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectBreakpoint.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lldb/source/Commands/CommandObjectBreakpoint.cpp b/lldb/source/Commands/CommandObjectBreakpoint.cpp index 724eacd..3f5311b 100644 --- a/lldb/source/Commands/CommandObjectBreakpoint.cpp +++ b/lldb/source/Commands/CommandObjectBreakpoint.cpp @@ -713,7 +713,7 @@ protected: // Now set the various options that were passed in: if (bp_sp) { - bp_sp->GetOptions()->CopyOverSetOptions(m_bp_opts.GetBreakpointOptions()); + bp_sp->GetOptions().CopyOverSetOptions(m_bp_opts.GetBreakpointOptions()); if (!m_options.m_breakpoint_names.empty()) { Status name_error; @@ -863,10 +863,10 @@ protected: BreakpointLocation *location = bp->FindLocationByID(cur_bp_id.GetLocationID()).get(); if (location) - location->GetLocationOptions()->CopyOverSetOptions( + location->GetLocationOptions().CopyOverSetOptions( m_bp_opts.GetBreakpointOptions()); } else { - bp->GetOptions()->CopyOverSetOptions( + bp->GetOptions().CopyOverSetOptions( m_bp_opts.GetBreakpointOptions()); } } @@ -1769,7 +1769,7 @@ protected: bp_name->SetHelp(m_bp_id.m_help_string.GetStringValue().str().c_str()); if (bp_sp) - target.ConfigureBreakpointName(*bp_name, *bp_sp->GetOptions(), + target.ConfigureBreakpointName(*bp_name, bp_sp->GetOptions(), m_access_options.GetPermissions()); else target.ConfigureBreakpointName(*bp_name, |