Excise <cctype> from Clang (except clang-tblgen) in favor of CharInfo.h.

Nearly all of these changes are one-to-one replacements; the few that
aren't have to do with custom identifier validation.

llvm-svn: 174768
diff --git a/clang/lib/Frontend/LayoutOverrideSource.cpp b/clang/lib/Frontend/LayoutOverrideSource.cpp
index 9309661..924a640 100644
--- a/clang/lib/Frontend/LayoutOverrideSource.cpp
+++ b/clang/lib/Frontend/LayoutOverrideSource.cpp
@@ -8,8 +8,8 @@
 //===----------------------------------------------------------------------===//
 #include "clang/Frontend/LayoutOverrideSource.h"
 #include "clang/AST/Decl.h"
+#include "clang/Basic/CharInfo.h"
 #include "llvm/Support/raw_ostream.h"
-#include <cctype>
 #include <fstream>
 #include <string>
 
@@ -17,10 +17,11 @@
 
 /// \brief Parse a simple identifier.
 static std::string parseName(StringRef S) {
-  unsigned Offset = 0;
-  while (Offset < S.size() &&
-         (isalpha(S[Offset]) || S[Offset] == '_' ||
-          (Offset > 0 && isdigit(S[Offset]))))
+  if (S.empty() || !isIdentifierHead(S[0]))
+    return "";
+
+  unsigned Offset = 1;
+  while (Offset < S.size() && isIdentifierBody(S[Offset]))
     ++Offset;
   
   return S.substr(0, Offset).str();
@@ -128,10 +129,10 @@
       continue;
 
     LineStr = LineStr.substr(Pos + strlen("FieldOffsets: ["));
-    while (!LineStr.empty() && isdigit(LineStr[0])) {
+    while (!LineStr.empty() && isDigit(LineStr[0])) {
       // Parse this offset.
       unsigned Idx = 1;
-      while (Idx < LineStr.size() && isdigit(LineStr[Idx]))
+      while (Idx < LineStr.size() && isDigit(LineStr[Idx]))
         ++Idx;
       
       unsigned long long Offset = 0;
@@ -141,7 +142,7 @@
       
       // Skip over this offset, the following comma, and any spaces.
       LineStr = LineStr.substr(Idx + 1);
-      while (!LineStr.empty() && isspace(LineStr[0]))
+      while (!LineStr.empty() && isWhitespace(LineStr[0]))
         LineStr = LineStr.substr(1);
     }
   }