diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2009-11-13 02:18:25 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2009-11-13 02:18:25 +0000 |
commit | c78c0c99a0fe1703ae72fc51e440aaa8e4e19e91 (patch) | |
tree | 0a822d49c72aa91f86d0961e50807a81e156bd0e /lib/Support | |
parent | 1e608819aa26c06b1552521469f2211339e3bfe0 (diff) |
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
Diffstat (limited to 'lib/Support')
-rw-r--r-- | lib/Support/StringExtras.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Support/StringExtras.cpp b/lib/Support/StringExtras.cpp index 05ba34b2e7..687394a2fc 100644 --- a/lib/Support/StringExtras.cpp +++ b/lib/Support/StringExtras.cpp @@ -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); |