mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-26 02:26:07 +00:00
Rename getTokenSimpleSpelling() to getPunctuatorSpelling()
That's what it does, what the documentation says it does and what callers expect it to do. llvm-svn: 198603
This commit is contained in:
parent
7649ebacd6
commit
6d35eab5a6
@ -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) {
|
||||
|
@ -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))
|
||||
|
@ -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"
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user