From c78c0c99a0fe1703ae72fc51e440aaa8e4e19e91 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Fri, 13 Nov 2009 02:18:25 +0000 Subject: 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 --- lib/Support/StringExtras.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib/Support/StringExtras.cpp') 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 using namespace llvm; @@ -57,12 +58,12 @@ void llvm::SplitString(const std::string &Source, } } -void llvm::StringRef::split(std::vector &A, - StringRef Separators, unsigned MaxSplit, +void llvm::StringRef::split(SmallVectorImpl &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 p = rest.split(Separators); -- cgit v1.2.3-18-g5258