[llvm-commits] CVS: llvm/include/Support/StringExtras.h

Misha Brukman brukman at cs.uiuc.edu
Thu Jun 24 18:40:02 PDT 2004


Changes in directory llvm/include/Support:

StringExtras.h updated: 1.14 -> 1.15

---
Log message:

Add a LowercaseString() utility function, courtesy of brg.


---
Diffs of the changes:  (+7 -0)

Index: llvm/include/Support/StringExtras.h
diff -u llvm/include/Support/StringExtras.h:1.14 llvm/include/Support/StringExtras.h:1.15
--- llvm/include/Support/StringExtras.h:1.14	Fri Jun  4 15:21:53 2004
+++ llvm/include/Support/StringExtras.h	Thu Jun 24 18:38:52 2004
@@ -97,6 +97,13 @@
   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





More information about the llvm-commits mailing list