From: Benjamin Kramer Date: Mon, 11 Jan 2010 18:44:35 +0000 (+0000) Subject: Turns out llvm-gcc still uses SplitString with a vector. Add it back until I X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=c30837d6c1ee814ba62e32848e1d2cbfb7385953;p=oota-llvm.git Turns out llvm-gcc still uses SplitString with a vector. Add it back until I have a fix. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93163 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/ADT/StringExtras.h b/include/llvm/ADT/StringExtras.h index f58fe8eade0..2f5c39cad8a 100644 --- a/include/llvm/ADT/StringExtras.h +++ b/include/llvm/ADT/StringExtras.h @@ -20,6 +20,7 @@ #include #include #include +#include namespace llvm { template class SmallVectorImpl; @@ -217,6 +218,11 @@ void SplitString(StringRef Source, SmallVectorImpl &OutFragments, StringRef Delimiters = " \t\n\v\f\r"); +// FIXME: remove when llvm-gcc doesn't use this anymore +void SplitString(StringRef Source, + std::vector &OutFragments, + StringRef Delimiters = " \t\n\v\f\r"); + /// HashString - Hash funtion for strings. /// /// This is the Bernstein hash function. diff --git a/lib/Support/StringExtras.cpp b/lib/Support/StringExtras.cpp index 65b41d526f4..2363ad60d17 100644 --- a/lib/Support/StringExtras.cpp +++ b/lib/Support/StringExtras.cpp @@ -48,6 +48,18 @@ void llvm::SplitString(StringRef Source, } } +// FIXME: remove when llvm-gcc doesn't use this anymore +void llvm::SplitString(StringRef Source, + std::vector &OutFragments, + StringRef Delimiters) { + StringRef S2, S; + tie(S2, S) = getToken(Source, Delimiters); + while (!S2.empty()) { + OutFragments.push_back(S2); + tie(S2, S) = getToken(S, Delimiters); + } +} + void llvm::StringRef::split(SmallVectorImpl &A, StringRef Separators, int MaxSplit, bool KeepEmpty) const {