summaryrefslogtreecommitdiffstats
path: root/lldb/source/Breakpoint/BreakpointIDList.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2016-11-21 23:18:07 +0000
committerZachary Turner <zturner@google.com>2016-11-21 23:18:07 +0000
commit1c55c9b5bf820a25ecf040fc3a5a1488b1d65cb2 (patch)
tree2ca0a559a8f8c36f3055919c15f379cfaf71df79 /lldb/source/Breakpoint/BreakpointIDList.cpp
parentc2cd4e004c4b34d8be0333b3dfe80831661bf11d (diff)
downloadbcm5719-llvm-1c55c9b5bf820a25ecf040fc3a5a1488b1d65cb2.tar.gz
bcm5719-llvm-1c55c9b5bf820a25ecf040fc3a5a1488b1d65cb2.zip
Add the new Args / entry-access API.
The long-term goal here is to get rid of the functions GetArgumentAtIndex() and GetQuoteCharAtIndex(), instead replacing them with operator based access and range-based for enumeration. There are a lot of callsites, though, so the changes will be done incrementally, starting with this one. Differential Revision: https://reviews.llvm.org/D26883 llvm-svn: 287597
Diffstat (limited to 'lldb/source/Breakpoint/BreakpointIDList.cpp')
-rw-r--r--lldb/source/Breakpoint/BreakpointIDList.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/lldb/source/Breakpoint/BreakpointIDList.cpp b/lldb/source/Breakpoint/BreakpointIDList.cpp
index 0f8a027b030..037b03e1e46 100644
--- a/lldb/source/Breakpoint/BreakpointIDList.cpp
+++ b/lldb/source/Breakpoint/BreakpointIDList.cpp
@@ -122,13 +122,12 @@ void BreakpointIDList::FindAndReplaceIDRanges(Args &old_args, Target *target,
llvm::StringRef range_from;
llvm::StringRef range_to;
llvm::StringRef current_arg;
- const size_t num_old_args = old_args.GetArgumentCount();
std::set<std::string> names_found;
- for (size_t i = 0; i < num_old_args; ++i) {
+ for (size_t i = 0; i < old_args.size(); ++i) {
bool is_range = false;
- current_arg = old_args.GetArgumentAtIndex(i);
+ current_arg = old_args[i].ref;
if (!allow_locations && current_arg.contains('.')) {
result.AppendErrorWithFormat(
"Breakpoint locations not allowed, saw location: %s.",
@@ -152,19 +151,17 @@ void BreakpointIDList::FindAndReplaceIDRanges(Args &old_args, Target *target,
return;
} else
names_found.insert(current_arg);
- } else if ((i + 2 < num_old_args) &&
- BreakpointID::IsRangeIdentifier(
- old_args.GetArgumentAtIndex(i + 1)) &&
+ } else if ((i + 2 < old_args.size()) &&
+ BreakpointID::IsRangeIdentifier(old_args[i + 1].ref) &&
BreakpointID::IsValidIDExpression(current_arg) &&
- BreakpointID::IsValidIDExpression(
- old_args.GetArgumentAtIndex(i + 2))) {
+ BreakpointID::IsValidIDExpression(old_args[i + 2].ref)) {
range_from = current_arg;
- range_to = old_args.GetArgumentAtIndex(i + 2);
+ range_to = old_args[i + 2].ref;
is_range = true;
i = i + 2;
} else {
// See if user has specified id.*
- llvm::StringRef tmp_str = old_args.GetArgumentAtIndex(i);
+ llvm::StringRef tmp_str = old_args[i].ref;
size_t pos = tmp_str.find('.');
if (pos != llvm::StringRef::npos) {
llvm::StringRef bp_id_str = tmp_str.substr(0, pos);
OpenPOWER on IntegriCloud