mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-11 08:29:25 +00:00
Switch to smallvector. Also fix issue with using unsigend for MaxSplit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@87068 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "llvm/ADT/StringExtras.h"
|
||||
#include "llvm/ADT/SmallVector.h"
|
||||
#include <cstring>
|
||||
using namespace llvm;
|
||||
|
||||
@@ -57,12 +58,12 @@ void llvm::SplitString(const std::string &Source,
|
||||
}
|
||||
}
|
||||
|
||||
void llvm::StringRef::split(std::vector<StringRef> &A,
|
||||
StringRef Separators, unsigned MaxSplit,
|
||||
void llvm::StringRef::split(SmallVectorImpl<StringRef> &A,
|
||||
StringRef Separators, int MaxSplit,
|
||||
bool KeepEmpty) const {
|
||||
StringRef rest = *this;
|
||||
|
||||
for (unsigned splits = 0;
|
||||
for (int splits = 0;
|
||||
rest.size() != 0 && (MaxSplit < 0 || splits < MaxSplit);
|
||||
++splits) {
|
||||
std::pair<llvm::StringRef, llvm::StringRef> p = rest.split(Separators);
|
||||
|
Reference in New Issue
Block a user