Index: AsmWriter.cpp
===================================================================
--- AsmWriter.cpp	(revision 132050)
+++ AsmWriter.cpp	(working copy)
@@ -99,11 +99,13 @@
   }
 
   // Scan the name to see if it needs quotes first.
-  bool NeedsQuotes = isdigit(Name[0]);
+  bool NeedsQuotes = Name[0] >= '0' && Name[0] <= '9';
   if (!NeedsQuotes) {
     for (unsigned i = 0, e = Name.size(); i != e; ++i) {
       char C = Name[i];
-      if (!isalnum(C) && C != '-' && C != '.' && C != '_') {
+      if (!((C >= '0' && C <= '9') || (C >= 'A' && C <= 'Z')
+		|| (C >= 'a' && C <= 'z') || C == '_' || C == '-' || C == '.'
+		|| (C & 0x80) != 0)) {
         NeedsQuotes = true;
         break;
       }
Index: LLVMContext.cpp
===================================================================
--- LLVMContext.cpp	(revision 132050)
+++ LLVMContext.cpp	(working copy)
@@ -106,17 +106,25 @@
 //===----------------------------------------------------------------------===//
 
 #ifndef NDEBUG
+
 /// isValidName - Return true if Name is a valid custom metadata handler name.
 static bool isValidName(StringRef MDName) {
   if (MDName.empty())
     return false;
 
-  if (!std::isalpha(MDName[0]))
-    return false;
+  {
+	char C = MDName[0];
+    if (!((C >= 'A' && C <= 'Z') || (C >= 'a' && C <= 'z') || C == '_' // these too?  || C == '-' || C == '.'
+      || (C & 0x80) != 0))
+      return false;
+  }
 
   for (StringRef::iterator I = MDName.begin() + 1, E = MDName.end(); I != E;
        ++I) {
-    if (!std::isalnum(*I) && *I != '_' && *I != '-' && *I != '.')
+	char C = *I;
+    if (!((C >= '0' && C <= '9') || (C >= 'A' && C <= 'Z')
+      || (C >= 'a' && C <= 'z') || C == '_' || C == '-' || C == '.'
+      || (C & 0x80) != 0))
       return false;
   }
   return true;
