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/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h | |
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/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h')
-rw-r--r-- | lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h index 93d5768..9eb6efc 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h +++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h @@ -244,7 +244,7 @@ public: std::unique_ptr<ScriptInterpreterLocker> AcquireInterpreterLock() override; void CollectDataForBreakpointCommandCallback( - std::vector<BreakpointOptions *> &bp_options_vec, + std::vector<std::reference_wrapper<BreakpointOptions>> &bp_options_vec, CommandReturnObject &result) override; void @@ -252,20 +252,19 @@ public: CommandReturnObject &result) override; /// Set the callback body text into the callback for the breakpoint. - Status SetBreakpointCommandCallback(BreakpointOptions *bp_options, + Status SetBreakpointCommandCallback(BreakpointOptions &bp_options, const char *callback_body) override; Status SetBreakpointCommandCallbackFunction( - BreakpointOptions *bp_options, - const char *function_name, + BreakpointOptions &bp_options, const char *function_name, StructuredData::ObjectSP extra_args_sp) override; /// This one is for deserialization: Status SetBreakpointCommandCallback( - BreakpointOptions *bp_options, + BreakpointOptions &bp_options, std::unique_ptr<BreakpointOptions::CommandData> &data_up) override; - Status SetBreakpointCommandCallback(BreakpointOptions *bp_options, + Status SetBreakpointCommandCallback(BreakpointOptions &bp_options, const char *command_body_text, StructuredData::ObjectSP extra_args_sp, bool uses_extra_args); |