diff options
| author | Pavel Labath <labath@google.com> | 2018-06-20 08:12:50 +0000 |
|---|---|---|
| committer | Pavel Labath <labath@google.com> | 2018-06-20 08:12:50 +0000 |
| commit | 16662f3c6ea9bd5cb3459b6ad71d52037f4b397a (patch) | |
| tree | 590ca58876b8eac18ba17109e48ab39f44da0708 | |
| parent | 42a1ff11fb10040375067018bd517e85711e7f5d (diff) | |
| download | bcm5719-llvm-16662f3c6ea9bd5cb3459b6ad71d52037f4b397a.tar.gz bcm5719-llvm-16662f3c6ea9bd5cb3459b6ad71d52037f4b397a.zip | |
BreakpointIDList: Use llvm::ArrayRef instead of pointer+length pair
NFC
llvm-svn: 335102
| -rw-r--r-- | lldb/include/lldb/Breakpoint/BreakpointIDList.h | 2 | ||||
| -rw-r--r-- | lldb/source/Breakpoint/BreakpointIDList.cpp | 11 | ||||
| -rw-r--r-- | lldb/source/Commands/CommandObjectBreakpoint.cpp | 3 |
3 files changed, 7 insertions, 9 deletions
diff --git a/lldb/include/lldb/Breakpoint/BreakpointIDList.h b/lldb/include/lldb/Breakpoint/BreakpointIDList.h index 5877b6c551a..ec305583e8d 100644 --- a/lldb/include/lldb/Breakpoint/BreakpointIDList.h +++ b/lldb/include/lldb/Breakpoint/BreakpointIDList.h @@ -55,7 +55,7 @@ public: bool FindBreakpointID(const char *bp_id, size_t *position) const; - void InsertStringArray(const char **string_array, size_t array_size, + void InsertStringArray(llvm::ArrayRef<const char *> string_array, CommandReturnObject &result); // Returns a pair consisting of the beginning and end of a breakpoint diff --git a/lldb/source/Breakpoint/BreakpointIDList.cpp b/lldb/source/Breakpoint/BreakpointIDList.cpp index 8fa12720940..bc4c2a111fd 100644 --- a/lldb/source/Breakpoint/BreakpointIDList.cpp +++ b/lldb/source/Breakpoint/BreakpointIDList.cpp @@ -89,14 +89,13 @@ bool BreakpointIDList::FindBreakpointID(const char *bp_id_str, return FindBreakpointID(*bp_id, position); } -void BreakpointIDList::InsertStringArray(const char **string_array, - size_t array_size, - CommandReturnObject &result) { - if (string_array == nullptr) +void BreakpointIDList::InsertStringArray( + llvm::ArrayRef<const char *> string_array, CommandReturnObject &result) { + if(string_array.empty()) return; - for (uint32_t i = 0; i < array_size; ++i) { - auto bp_id = BreakpointID::ParseCanonicalReference(string_array[i]); + for (const char *str : string_array) { + auto bp_id = BreakpointID::ParseCanonicalReference(str); if (bp_id.hasValue()) m_breakpoint_ids.push_back(*bp_id); } diff --git a/lldb/source/Commands/CommandObjectBreakpoint.cpp b/lldb/source/Commands/CommandObjectBreakpoint.cpp index 79b92dc446d..fb0553e482d 100644 --- a/lldb/source/Commands/CommandObjectBreakpoint.cpp +++ b/lldb/source/Commands/CommandObjectBreakpoint.cpp @@ -2573,8 +2573,7 @@ void CommandObjectMultiwordBreakpoint::VerifyIDs(Args &args, Target *target, // NOW, convert the list of breakpoint id strings in TEMP_ARGS into an actual // BreakpointIDList: - valid_ids->InsertStringArray(temp_args.GetConstArgumentVector(), - temp_args.GetArgumentCount(), result); + valid_ids->InsertStringArray(temp_args.GetArgumentArrayRef(), result); // At this point, all of the breakpoint ids that the user passed in have // been converted to breakpoint IDs and put into valid_ids. |

