diff --git a/include/Support/StringExtras.h b/include/Support/StringExtras.h index 6b6472954ee..0b45103aa3b 100644 --- a/include/Support/StringExtras.h +++ b/include/Support/StringExtras.h @@ -97,6 +97,13 @@ static inline std::string ftostr(double V) { return Buffer; } +std::string LowercaseString (const std::string &S) { + std::string result (S); + for (unsigned i = 0; i < S.length(); ++i) + if (isupper (result[i])) + result[i] = tolower(result[i]); + return result; +} /// getToken - This function extracts one token from source, ignoring any /// leading characters that appear in the Delimiters string, and ending the diff --git a/include/llvm/ADT/StringExtras.h b/include/llvm/ADT/StringExtras.h index 6b6472954ee..0b45103aa3b 100644 --- a/include/llvm/ADT/StringExtras.h +++ b/include/llvm/ADT/StringExtras.h @@ -97,6 +97,13 @@ static inline std::string ftostr(double V) { return Buffer; } +std::string LowercaseString (const std::string &S) { + std::string result (S); + for (unsigned i = 0; i < S.length(); ++i) + if (isupper (result[i])) + result[i] = tolower(result[i]); + return result; +} /// getToken - This function extracts one token from source, ignoring any /// leading characters that appear in the Delimiters string, and ending the