[all-commits] [llvm/llvm-project] cfb96d: Convert functions that were returning BreakpointOp...

jimingham via All-commits all-commits at lists.llvm.org
Tue Jun 15 14:34:23 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: cfb96d845a684a5c567823dbe2aa4392937ee979
      https://github.com/llvm/llvm-project/commit/cfb96d845a684a5c567823dbe2aa4392937ee979
  Author: Jim Ingham <jingham at apple.com>
  Date:   2021-06-15 (Tue, 15 Jun 2021)

  Changed paths:
    M lldb/include/lldb/Breakpoint/Breakpoint.h
    M lldb/include/lldb/Breakpoint/BreakpointLocation.h
    M lldb/include/lldb/Breakpoint/BreakpointLocationCollection.h
    M lldb/include/lldb/Breakpoint/BreakpointSite.h
    M lldb/include/lldb/Interpreter/ScriptInterpreter.h
    M lldb/source/API/SBBreakpoint.cpp
    M lldb/source/API/SBBreakpointLocation.cpp
    M lldb/source/API/SBBreakpointName.cpp
    M lldb/source/Breakpoint/Breakpoint.cpp
    M lldb/source/Breakpoint/BreakpointLocation.cpp
    M lldb/source/Breakpoint/BreakpointLocationCollection.cpp
    M lldb/source/Breakpoint/BreakpointName.cpp
    M lldb/source/Breakpoint/BreakpointOptions.cpp
    M lldb/source/Breakpoint/BreakpointSite.cpp
    M lldb/source/Commands/CommandObjectBreakpoint.cpp
    M lldb/source/Commands/CommandObjectBreakpointCommand.cpp
    M lldb/source/Core/IOHandlerCursesGUI.cpp
    M lldb/source/Interpreter/ScriptInterpreter.cpp
    M lldb/source/Plugins/Process/Utility/StopInfoMachException.cpp
    M lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
    M lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.cpp
    M lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.h
    M lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
    M lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h
    M lldb/source/Target/StopInfo.cpp

  Log Message:
  -----------
  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




More information about the All-commits mailing list