diff options
author | Michał Górny <mgorny@moritz.systems> | 2021-09-26 14:07:21 +0200 |
---|---|---|
committer | Michał Górny <mgorny@moritz.systems> | 2021-09-27 10:43:09 +0200 |
commit | f4b71e3479bfaec71ba5f4bb56c6a34357a7f938 (patch) | |
tree | 5788c74fc9ad8b8478ca30ceb6a97ce091cf4f43 /lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp | |
parent | 66d9d1012b031e7f7559e8f0e03b9e7bfb6c20a1 (diff) | |
download | llvm-f4b71e3479bfaec71ba5f4bb56c6a34357a7f938.zip llvm-f4b71e3479bfaec71ba5f4bb56c6a34357a7f938.tar.gz llvm-f4b71e3479bfaec71ba5f4bb56c6a34357a7f938.tar.bz2 |
[llvm] [ADT] Add a range/iterator-based Split()
Add a llvm::Split() implementation that can be used via range-for loop,
e.g.:
for (StringRef x : llvm::Split("foo,bar,baz", ','))
...
The implementation uses an additional SplittingIterator class that
uses StringRef::split() internally.
Differential Revision: https://reviews.llvm.org/D110496
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp')
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp index 1ad838b..cd85378 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp @@ -3656,10 +3656,7 @@ GDBRemoteCommunicationServerLLGS::Handle_qSaveCore( StringRef packet_str{packet.GetStringRef()}; assert(packet_str.startswith("qSaveCore")); if (packet_str.consume_front("qSaveCore;")) { - llvm::SmallVector<llvm::StringRef, 2> fields; - packet_str.split(fields, ';'); - - for (auto x : fields) { + for (auto x : llvm::Split(packet_str, ';')) { if (x.consume_front("path-hint:")) StringExtractor(x).GetHexByteString(path_hint); else |