diff options
author | Jordan Rose <jordan_rose@apple.com> | 2013-02-08 22:30:41 +0000 |
---|---|---|
committer | Jordan Rose <jordan_rose@apple.com> | 2013-02-08 22:30:41 +0000 |
commit | 3f6f51e28231f65de9c2dd150a2d757b2162cfa3 (patch) | |
tree | 1e341c81fec0bf620086a1afa40f4f847dc5bdc4 /lib/Basic/Diagnostic.cpp | |
parent | 4a04d445af4d29440371800409babc98708d98aa (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174768 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Basic/Diagnostic.cpp')
-rw-r--r-- | lib/Basic/Diagnostic.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/Basic/Diagnostic.cpp b/lib/Basic/Diagnostic.cpp index 6627ad62f3..2b448058a0 100644 --- a/lib/Basic/Diagnostic.cpp +++ b/lib/Basic/Diagnostic.cpp @@ -11,6 +11,7 @@ // //===----------------------------------------------------------------------===// +#include "clang/Basic/CharInfo.h" #include "clang/Basic/Diagnostic.h" #include "clang/Basic/DiagnosticOptions.h" #include "clang/Basic/IdentifierTable.h" @@ -19,7 +20,6 @@ #include "llvm/ADT/StringExtras.h" #include "llvm/Support/CrashRecoveryContext.h" #include "llvm/Support/raw_ostream.h" -#include <cctype> using namespace clang; @@ -457,8 +457,8 @@ static const char *ScanFormat(const char *I, const char *E, char Target) { // Escaped characters get implicitly skipped here. // Format specifier. - if (!isdigit(*I) && !ispunct(*I)) { - for (I++; I != E && !isdigit(*I) && *I != '{'; I++) ; + if (!isDigit(*I) && !isPunctuation(*I)) { + for (I++; I != E && !isDigit(*I) && *I != '{'; I++) ; if (I == E) break; if (*I == '{') Depth++; @@ -682,7 +682,7 @@ FormatDiagnostic(const char *DiagStr, const char *DiagEnd, OutStr.append(DiagStr, StrEnd); DiagStr = StrEnd; continue; - } else if (ispunct(DiagStr[1])) { + } else if (isPunctuation(DiagStr[1])) { OutStr.push_back(DiagStr[1]); // %% -> %. DiagStr += 2; continue; @@ -700,7 +700,7 @@ FormatDiagnostic(const char *DiagStr, const char *DiagEnd, unsigned ModifierLen = 0, ArgumentLen = 0; // Check to see if we have a modifier. If so eat it. - if (!isdigit(DiagStr[0])) { + if (!isDigit(DiagStr[0])) { Modifier = DiagStr; while (DiagStr[0] == '-' || (DiagStr[0] >= 'a' && DiagStr[0] <= 'z')) @@ -719,7 +719,7 @@ FormatDiagnostic(const char *DiagStr, const char *DiagEnd, } } - assert(isdigit(*DiagStr) && "Invalid format for argument in diagnostic"); + assert(isDigit(*DiagStr) && "Invalid format for argument in diagnostic"); unsigned ArgNo = *DiagStr++ - '0'; // Only used for type diffing. @@ -727,7 +727,7 @@ FormatDiagnostic(const char *DiagStr, const char *DiagEnd, DiagnosticsEngine::ArgumentKind Kind = getArgKind(ArgNo); if (ModifierIs(Modifier, ModifierLen, "diff")) { - assert(*DiagStr == ',' && isdigit(*(DiagStr + 1)) && + assert(*DiagStr == ',' && isDigit(*(DiagStr + 1)) && "Invalid format for diff modifier"); ++DiagStr; // Comma. ArgNo2 = *DiagStr++ - '0'; |