]> granicus.if.org Git - clang/commitdiff
Rename getTokenSimpleSpelling() to getPunctuatorSpelling()
authorAlp Toker <alp@nuanti.com>
Mon, 6 Jan 2014 12:54:07 +0000 (12:54 +0000)
committerAlp Toker <alp@nuanti.com>
Mon, 6 Jan 2014 12:54:07 +0000 (12:54 +0000)
That's what it does, what the documentation says it does and what callers
expect it to do.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198603 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/TokenKinds.h
lib/Basic/Diagnostic.cpp
lib/Basic/TokenKinds.cpp
lib/Parse/Parser.cpp

index 53f006a88716491b17b32ed995b37132903574c7..e77e732f7036f48427f0c72bc8a2eea1cd8d8fb4 100644 (file)
@@ -63,7 +63,7 @@ const char *getTokenName(enum TokenKind Kind) LLVM_READNONE;
 /// and will not produce any alternative spellings (e.g., a
 /// digraph). For the actual spelling of a given Token, use
 /// Preprocessor::getSpelling().
-const char *getTokenSimpleSpelling(enum TokenKind Kind) LLVM_READNONE;
+const char *getPunctuatorSpelling(enum TokenKind Kind) LLVM_READNONE;
 
 /// \brief Return true if this is a raw identifier or an identifier kind.
 inline bool isAnyIdentifier(TokenKind K) {
index eaae388fd8d54d07fdb27da6e585e64864ca810f..9d7643b3622a6ea6f6a30598b3744a5f797e6e4c 100644 (file)
@@ -831,7 +831,7 @@ FormatDiagnostic(const char *DiagStr, const char *DiagEnd,
       if (const char *S = getTokenNameForDiagnostic(Kind))
         // Unquoted translatable token name.
         Out << S;
-      else if (const char *S = tok::getTokenSimpleSpelling(Kind))
+      else if (const char *S = tok::getPunctuatorSpelling(Kind))
         // Quoted token spelling, currently only covers punctuators.
         Out << '\'' << S << '\'';
       else if (const char *S = tok::getTokenName(Kind))
index f62624c55a2f72fcf68f78820d509c166765c1ee..2a9c9bfa2f97a98d727a781c3cc8d2f5549f248d 100644 (file)
@@ -29,7 +29,7 @@ const char *tok::getTokenName(enum TokenKind Kind) {
   return 0;
 }
 
-const char *tok::getTokenSimpleSpelling(enum TokenKind Kind) {
+const char *tok::getPunctuatorSpelling(enum TokenKind Kind) {
   switch (Kind) {
 #define PUNCTUATOR(X,Y) case X: return Y;
 #include "clang/Basic/TokenKinds.def"
index 0caf152a069f1212bcbeae8f0e20b676ba4338e5..27e16a7914da009fd84d9a8c881cb3cd1ce9071e 100644 (file)
@@ -164,7 +164,7 @@ bool Parser::ExpectAndConsume(tok::TokenKind ExpectedTok, unsigned DiagID,
     SourceLocation Loc = Tok.getLocation();
     DiagnosticBuilder DB = Diag(Loc, DiagID);
     DB << FixItHint::CreateReplacement(SourceRange(Loc),
-                                       getTokenSimpleSpelling(ExpectedTok));
+                                       getPunctuatorSpelling(ExpectedTok));
     if (DiagID == diag::err_expected)
       DB << ExpectedTok;
     else if (DiagID == diag::err_expected_after)
@@ -180,7 +180,7 @@ bool Parser::ExpectAndConsume(tok::TokenKind ExpectedTok, unsigned DiagID,
   SourceLocation EndLoc = PP.getLocForEndOfToken(PrevTokLocation);
   const char *Spelling = 0;
   if (EndLoc.isValid())
-    Spelling = tok::getTokenSimpleSpelling(ExpectedTok);
+    Spelling = tok::getPunctuatorSpelling(ExpectedTok);
 
   DiagnosticBuilder DB =
       Spelling