================ @@ -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"; + } + ---------------- AaronBallman wrote:
There's one more thing I'd like to see, just as a kindness to user: ``` if (Remove && DisableRemove) llvm::errs() << "warning: '-remove=1' and '-disable-remove' are incompatible options\n"; if (Insert && DisableInsert) llvm::errs() << "warning: '-insert=1' and '-disable-insert' are incompatible options\n"; ``` (And add tests for the diagnostics as well.) WDYT? https://github.com/llvm/llvm-project/pull/132991 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits