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");
     }
   }
 


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");
     }
   }
 
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
  • [PATCH] D146885: [clang-tidy]... Congcong Cai via Phabricator via cfe-commits

Reply via email to