[PATCH] D139715: [include-cleaner] Print the line number of removal #includes.

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 9 06:48:21 PST 2022


hokein created this revision.
hokein added a reviewer: kadircet.
Herald added a project: All.
hokein requested review of this revision.
Herald added a project: clang-tools-extra.

I found that this information is helpful when using this tool.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D139715

Files:
  clang-tools-extra/include-cleaner/tool/IncludeCleaner.cpp


Index: clang-tools-extra/include-cleaner/tool/IncludeCleaner.cpp
===================================================================
--- clang-tools-extra/include-cleaner/tool/IncludeCleaner.cpp
+++ clang-tools-extra/include-cleaner/tool/IncludeCleaner.cpp
@@ -130,7 +130,7 @@
       switch (Print) {
       case PrintStyle::Changes:
         for (const Include *I : Results.Unused)
-          llvm::outs() << "- " << I->quote() << "\n";
+          llvm::outs() << "- " << I->quote() << " @Line:" << I->Line << "\n";
         for (const auto &I : Results.Missing)
           llvm::outs() << "+ " << I << "\n";
         break;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D139715.481633.patch
Type: text/x-patch
Size: 626 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20221209/a9b7d932/attachment.bin>


More information about the cfe-commits mailing list