From 5dbbc3b14bb04ef4bf2cbf4c23008f94f4253704 Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Wed, 31 Jul 2024 11:02:18 -0700 Subject: [lldb] Use Target references instead of pointers in CommandObject (NFC) The GetTarget helper returns a Target reference so there's reason to convert it to a pointer and check its validity. --- lldb/source/Commands/CommandObjectBreakpointCommand.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lldb/source/Commands/CommandObjectBreakpointCommand.cpp') diff --git a/lldb/source/Commands/CommandObjectBreakpointCommand.cpp b/lldb/source/Commands/CommandObjectBreakpointCommand.cpp index 5d95c2a30957..8c1fb513e016 100644 --- a/lldb/source/Commands/CommandObjectBreakpointCommand.cpp +++ b/lldb/source/Commands/CommandObjectBreakpointCommand.cpp @@ -548,9 +548,9 @@ public: protected: void DoExecute(Args &command, CommandReturnObject &result) override { - Target *target = &GetTarget(); + Target &target = GetTarget(); - const BreakpointList &breakpoints = target->GetBreakpointList(); + const BreakpointList &breakpoints = target.GetBreakpointList(); size_t num_breakpoints = breakpoints.GetSize(); if (num_breakpoints == 0) { @@ -566,7 +566,7 @@ protected: BreakpointIDList valid_bp_ids; CommandObjectMultiwordBreakpoint::VerifyBreakpointOrLocationIDs( - command, target, result, &valid_bp_ids, + command, &target, result, &valid_bp_ids, BreakpointName::Permissions::PermissionKinds::listPerm); if (result.Succeeded()) { @@ -575,7 +575,7 @@ protected: BreakpointID cur_bp_id = valid_bp_ids.GetBreakpointIDAtIndex(i); if (cur_bp_id.GetBreakpointID() != LLDB_INVALID_BREAK_ID) { Breakpoint *bp = - target->GetBreakpointByID(cur_bp_id.GetBreakpointID()).get(); + target.GetBreakpointByID(cur_bp_id.GetBreakpointID()).get(); if (bp) { BreakpointLocationSP bp_loc_sp; -- cgit v1.2.3