Author: Haojian Wu Date: 2023-06-22T14:37:11+02:00 New Revision: e339b07944799ebd1692e8f7019690fe14a33257
URL: https://github.com/llvm/llvm-project/commit/e339b07944799ebd1692e8f7019690fe14a33257 DIFF: https://github.com/llvm/llvm-project/commit/e339b07944799ebd1692e8f7019690fe14a33257.diff LOG: [include-cleaner] No need to overwrite the source file if there is no cleanups Added: Modified: clang-tools-extra/include-cleaner/tool/IncludeCleaner.cpp Removed: ################################################################################ diff --git a/clang-tools-extra/include-cleaner/tool/IncludeCleaner.cpp b/clang-tools-extra/include-cleaner/tool/IncludeCleaner.cpp index 008da47164092..574023fda4968 100644 --- a/clang-tools-extra/include-cleaner/tool/IncludeCleaner.cpp +++ b/clang-tools-extra/include-cleaner/tool/IncludeCleaner.cpp @@ -148,7 +148,7 @@ class Action : public clang::ASTFrontendAction { } } - if (Edit) { + if (Edit && (!Results.Missing.empty() || !Results.Unused.empty())) { if (auto Err = llvm::writeToOutput( Path, [&](llvm::raw_ostream &OS) -> llvm::Error { OS << Final; _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits