From 3f6f51e28231f65de9c2dd150a2d757b2162cfa3 Mon Sep 17 00:00:00 2001 From: Jordan Rose Date: Fri, 8 Feb 2013 22:30:41 +0000 Subject: Excise 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 --- lib/Basic/Diagnostic.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'lib/Basic/Diagnostic.cpp') 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 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'; -- cgit v1.2.3-18-g5258