[all-commits] [llvm/llvm-project] 5cbf74: [lldb][NFCI] Change return type of BreakpointIDLis...

Alex Langford via All-commits all-commits at lists.llvm.org
Mon Jan 8 10:52:14 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5cbf74b012c10e9cc841a27cd5d7335e556f47dd
      https://github.com/llvm/llvm-project/commit/5cbf74b012c10e9cc841a27cd5d7335e556f47dd
  Author: Alex Langford <alangford at apple.com>
  Date:   2024-01-08 (Mon, 08 Jan 2024)

  Changed paths:
    M lldb/include/lldb/Breakpoint/BreakpointIDList.h
    M lldb/source/Breakpoint/BreakpointIDList.cpp

  Log Message:
  -----------
  [lldb][NFCI] Change return type of BreakpointIDList::GetBreakpointIDAtIndex (#77166)

There are 2 motivations here:
1.) There is no need to hand out constant references to BreakpointIDs,
they are only 8 bytes big. In addition, every use of this method already
  makes a copy anyway.
2.) Each BreakpointIDList held onto an invalid BreakpointID specifically
to
  prevent lifetime issues. Returning a value means you can return an
  invalid BreakpointID instead of needing to allocate storage for an
  invalid BreakpointID.




More information about the All-commits mailing list