r198603 - Rename getTokenSimpleSpelling() to getPunctuatorSpelling()
Alp Toker
alp at nuanti.com
Mon Jan 6 04:54:08 PST 2014
Author: alp
Date: Mon Jan 6 06:54:07 2014
New Revision: 198603
URL: http://llvm.org/viewvc/llvm-project?rev=198603&view=rev
Log:
Rename getTokenSimpleSpelling() to getPunctuatorSpelling()
That's what it does, what the documentation says it does and what callers
expect it to do.
Modified:
cfe/trunk/include/clang/Basic/TokenKinds.h
cfe/trunk/lib/Basic/Diagnostic.cpp
cfe/trunk/lib/Basic/TokenKinds.cpp
cfe/trunk/lib/Parse/Parser.cpp
Modified: cfe/trunk/include/clang/Basic/TokenKinds.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/TokenKinds.h?rev=198603&r1=198602&r2=198603&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/TokenKinds.h (original)
+++ cfe/trunk/include/clang/Basic/TokenKinds.h Mon Jan 6 06:54:07 2014
@@ -63,7 +63,7 @@ const char *getTokenName(enum TokenKind
/// 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) {
Modified: cfe/trunk/lib/Basic/Diagnostic.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Diagnostic.cpp?rev=198603&r1=198602&r2=198603&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Diagnostic.cpp (original)
+++ cfe/trunk/lib/Basic/Diagnostic.cpp Mon Jan 6 06:54:07 2014
@@ -831,7 +831,7 @@ FormatDiagnostic(const char *DiagStr, co
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))
Modified: cfe/trunk/lib/Basic/TokenKinds.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/TokenKinds.cpp?rev=198603&r1=198602&r2=198603&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/TokenKinds.cpp (original)
+++ cfe/trunk/lib/Basic/TokenKinds.cpp Mon Jan 6 06:54:07 2014
@@ -29,7 +29,7 @@ const char *tok::getTokenName(enum Token
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"
Modified: cfe/trunk/lib/Parse/Parser.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/Parser.cpp?rev=198603&r1=198602&r2=198603&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/Parser.cpp (original)
+++ cfe/trunk/lib/Parse/Parser.cpp Mon Jan 6 06:54:07 2014
@@ -164,7 +164,7 @@ bool Parser::ExpectAndConsume(tok::Token
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::Token
SourceLocation EndLoc = PP.getLocForEndOfToken(PrevTokLocation);
const char *Spelling = 0;
if (EndLoc.isValid())
- Spelling = tok::getTokenSimpleSpelling(ExpectedTok);
+ Spelling = tok::getPunctuatorSpelling(ExpectedTok);
DiagnosticBuilder DB =
Spelling
More information about the cfe-commits
mailing list