summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/StringExtras.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2009-11-13 02:18:25 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2009-11-13 02:18:25 +0000
commit7c6854995dbed4c597e16054847f119417e48df7 (patch)
treecb54de9fac01660759cb3bc92324cf5303acdc09 /llvm/lib/Support/StringExtras.cpp
parent653d0b99df8d39447991581494b4e638a032df33 (diff)
downloadbcm5719-llvm-7c6854995dbed4c597e16054847f119417e48df7.tar.gz
bcm5719-llvm-7c6854995dbed4c597e16054847f119417e48df7.zip
Switch to smallvector. Also fix issue with using unsigend for MaxSplit.
llvm-svn: 87068
Diffstat (limited to 'llvm/lib/Support/StringExtras.cpp')
-rw-r--r--llvm/lib/Support/StringExtras.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Support/StringExtras.cpp b/llvm/lib/Support/StringExtras.cpp
index 05ba34b2e7b..687394a2fce 100644
--- a/llvm/lib/Support/StringExtras.cpp
+++ b/llvm/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);
OpenPOWER on IntegriCloud