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
/// 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) {
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))
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"
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)
SourceLocation EndLoc = PP.getLocForEndOfToken(PrevTokLocation);
const char *Spelling = 0;
if (EndLoc.isValid())
- Spelling = tok::getTokenSimpleSpelling(ExpectedTok);
+ Spelling = tok::getPunctuatorSpelling(ExpectedTok);
DiagnosticBuilder DB =
Spelling