[PATCH] D146885: [clang-tidy][NFC] add debug log when clean empty namespace

Congcong Cai via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Mar 25 14:29:51 PDT 2023


HerrCai0907 created this revision.
HerrCai0907 added a reviewer: njames93.
Herald added a subscriber: xazax.hun.
Herald added a project: All.
HerrCai0907 requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Adding debug log when clean empty namespace can make (#60051)[https://github.com/llvm/llvm-project/issues/60051#issuecomment-1383923360] more cleaner.
User will not be confused why the whole namespace is deleted after fixing modernize-concat-nested-namespaces.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D146885

Files:
  clang/lib/Format/Format.cpp


Index: clang/lib/Format/Format.cpp
===================================================================
--- clang/lib/Format/Format.cpp
+++ clang/lib/Format/Format.cpp
@@ -2472,10 +2472,13 @@
 
     for (auto Line : DeletedLines) {
       FormatToken *Tok = AnnotatedLines[Line]->First;
+      LLVM_DEBUG(llvm::dbgs() << "clean empty namespace:\"");
       while (Tok) {
+        LLVM_DEBUG(llvm::dbgs() << Tok->TokenText << " ");
         deleteToken(Tok);
         Tok = Tok->Next;
       }
+      LLVM_DEBUG(llvm::dbgs() << "\"\n");
     }
   }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D146885.508343.patch
Type: text/x-patch
Size: 549 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230325/9312b146/attachment.bin>


More information about the cfe-commits mailing list