Skip to content

Commit 0eb5891

Browse files
committed
[clang][preprocessor] Allow calling DumpToken() on annotation tokens
Differential Revision: https://reviews.llvm.org/D122659
1 parent fcade8e commit 0eb5891

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

clang/lib/Lex/Preprocessor.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,10 @@ void Preprocessor::FinalizeForModelFile() {
232232
}
233233

234234
void Preprocessor::DumpToken(const Token &Tok, bool DumpFlags) const {
235-
llvm::errs() << tok::getTokenName(Tok.getKind()) << " '"
236-
<< getSpelling(Tok) << "'";
235+
llvm::errs() << tok::getTokenName(Tok.getKind());
236+
237+
if (!Tok.isAnnotation())
238+
llvm::errs() << " '" << getSpelling(Tok) << "'";
237239

238240
if (!DumpFlags) return;
239241

0 commit comments

Comments
 (0)