From 0eb5891adcb84ccf665e88a62f573a1e22696782 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Timm=20B=C3=A4der?= Date: Tue, 29 Mar 2022 16:58:45 +0200 Subject: [PATCH] [clang][preprocessor] Allow calling DumpToken() on annotation tokens Differential Revision: https://reviews.llvm.org/D122659 --- clang/lib/Lex/Preprocessor.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/clang/lib/Lex/Preprocessor.cpp b/clang/lib/Lex/Preprocessor.cpp index 43b9930..abbd333 100644 --- a/clang/lib/Lex/Preprocessor.cpp +++ b/clang/lib/Lex/Preprocessor.cpp @@ -232,8 +232,10 @@ void Preprocessor::FinalizeForModelFile() { } void Preprocessor::DumpToken(const Token &Tok, bool DumpFlags) const { - llvm::errs() << tok::getTokenName(Tok.getKind()) << " '" - << getSpelling(Tok) << "'"; + llvm::errs() << tok::getTokenName(Tok.getKind()); + + if (!Tok.isAnnotation()) + llvm::errs() << " '" << getSpelling(Tok) << "'"; if (!DumpFlags) return; -- 2.7.4