[PATCH] D122659: [clang][preprocessor] Allow calling DumpToken() on annotation tokens

Timm Bäder via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 30 01:52:39 PDT 2022


tbaeder updated this revision to Diff 419073.

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D122659/new/

https://reviews.llvm.org/D122659

Files:
  clang/lib/Lex/Preprocessor.cpp


Index: clang/lib/Lex/Preprocessor.cpp
===================================================================
--- clang/lib/Lex/Preprocessor.cpp
+++ clang/lib/Lex/Preprocessor.cpp
@@ -232,8 +232,10 @@
 }
 
 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;
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D122659.419073.patch
Type: text/x-patch
Size: 546 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220330/1b83a4cf/attachment.bin>


More information about the cfe-commits mailing list