[clang-tools-extra] [include-cleaner] rename enabled flags to `disable-*` (PR #132991)

Mohamed Emad via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 30 06:36:27 PDT 2025


================
@@ -183,9 +195,26 @@ class Action : public clang::ASTFrontendAction {
     auto Results =
         analyze(AST.Roots, PP.MacroReferences, PP.Includes, &PI,
                 getCompilerInstance().getPreprocessor(), HeaderFilter);
-    if (!Insert)
+
+    if (!Insert) {
+      llvm::errs()
+          << "[WARNING] -insert is deprecated in favor of `-disable-insert`. "
+             "The old flag was confusing since it suggested that inserts "
+             "were disabled by default, when they were actually enabled. "
+             "See https://github.com/llvm/llvm-project/issues/132983\n";
+    }
+
+    if (!Remove) {
+      llvm::errs()
+          << "[WARNING] -remove is deprecated in favor of `-disable-remove`. "
+             "The old flag was confusing since it suggested that removes "
+             "were disabled by default, when they were actually enabled. "
+             "See https://github.com/llvm/llvm-project/issues/132983\n";
+    }
+
----------------
hulxv wrote:

That will make the user need to `-remove=0` to use `-disable-remove` because `-remove` is true by default. Do you find that correct? 

https://github.com/llvm/llvm-project/pull/132991


More information about the cfe-commits mailing list