Author: Owen Pan Date: 2024-03-16T22:24:11-07:00 New Revision: b92d6dd704d789240685a336ad8b25a9f381b4cc
URL: https://github.com/llvm/llvm-project/commit/b92d6dd704d789240685a336ad8b25a9f381b4cc DIFF: https://github.com/llvm/llvm-project/commit/b92d6dd704d789240685a336ad8b25a9f381b4cc.diff LOG: [clang-format][NFC] Delete 100+ redundant #include lines in .cpp files Added: Modified: clang/lib/Format/AffectedRangeManager.cpp clang/lib/Format/BreakableToken.cpp clang/lib/Format/ContinuationIndenter.cpp clang/lib/Format/DefinitionBlockSeparator.cpp clang/lib/Format/FormatToken.cpp clang/lib/Format/FormatTokenLexer.cpp clang/lib/Format/MacroCallReconstructor.cpp clang/lib/Format/MacroExpander.cpp clang/lib/Format/NamespaceEndCommentsFixer.cpp clang/lib/Format/ObjCPropertyAttributeOrderFixer.cpp clang/lib/Format/QualifierAlignmentFixer.cpp clang/lib/Format/SortJavaScriptImports.cpp clang/lib/Format/TokenAnalyzer.cpp clang/lib/Format/TokenAnnotator.cpp clang/lib/Format/UnwrappedLineFormatter.cpp clang/lib/Format/UnwrappedLineParser.cpp clang/lib/Format/UsingDeclarationsSorter.cpp clang/lib/Format/WhitespaceManager.cpp clang/tools/clang-format/ClangFormat.cpp Removed: ################################################################################ diff --git a/clang/lib/Format/AffectedRangeManager.cpp b/clang/lib/Format/AffectedRangeManager.cpp index bf124d73e89e71..ae08965714b1b7 100644 --- a/clang/lib/Format/AffectedRangeManager.cpp +++ b/clang/lib/Format/AffectedRangeManager.cpp @@ -13,7 +13,6 @@ #include "AffectedRangeManager.h" -#include "FormatToken.h" #include "TokenAnnotator.h" namespace clang { diff --git a/clang/lib/Format/BreakableToken.cpp b/clang/lib/Format/BreakableToken.cpp index 75304908dc6506..c33b74eeb80b4a 100644 --- a/clang/lib/Format/BreakableToken.cpp +++ b/clang/lib/Format/BreakableToken.cpp @@ -15,10 +15,6 @@ #include "BreakableToken.h" #include "ContinuationIndenter.h" #include "clang/Basic/CharInfo.h" -#include "clang/Format/Format.h" -#include "llvm/ADT/STLExtras.h" -#include "llvm/Support/Debug.h" -#include <algorithm> #define DEBUG_TYPE "format-token-breaker" diff --git a/clang/lib/Format/ContinuationIndenter.cpp b/clang/lib/Format/ContinuationIndenter.cpp index 964f1ead806bfb..3987f2185450ec 100644 --- a/clang/lib/Format/ContinuationIndenter.cpp +++ b/clang/lib/Format/ContinuationIndenter.cpp @@ -14,15 +14,6 @@ #include "ContinuationIndenter.h" #include "BreakableToken.h" #include "FormatInternal.h" -#include "FormatToken.h" -#include "WhitespaceManager.h" -#include "clang/Basic/OperatorPrecedence.h" -#include "clang/Basic/SourceManager.h" -#include "clang/Basic/TokenKinds.h" -#include "clang/Format/Format.h" -#include "llvm/ADT/StringSet.h" -#include "llvm/Support/Debug.h" -#include <optional> #define DEBUG_TYPE "format-indenter" diff --git a/clang/lib/Format/DefinitionBlockSeparator.cpp b/clang/lib/Format/DefinitionBlockSeparator.cpp index 319236d3bd618c..32fc77de4407cc 100644 --- a/clang/lib/Format/DefinitionBlockSeparator.cpp +++ b/clang/lib/Format/DefinitionBlockSeparator.cpp @@ -14,7 +14,6 @@ //===----------------------------------------------------------------------===// #include "DefinitionBlockSeparator.h" -#include "llvm/Support/Debug.h" #define DEBUG_TYPE "definition-block-separator" namespace clang { diff --git a/clang/lib/Format/FormatToken.cpp b/clang/lib/Format/FormatToken.cpp index 665b2e43259b21..a63db8cc795277 100644 --- a/clang/lib/Format/FormatToken.cpp +++ b/clang/lib/Format/FormatToken.cpp @@ -14,9 +14,6 @@ #include "FormatToken.h" #include "ContinuationIndenter.h" -#include "llvm/ADT/SmallVector.h" -#include "llvm/Support/Debug.h" -#include <climits> namespace clang { namespace format { diff --git a/clang/lib/Format/FormatTokenLexer.cpp b/clang/lib/Format/FormatTokenLexer.cpp index 717eb6bb49b1f4..a1c8df80e6a9f5 100644 --- a/clang/lib/Format/FormatTokenLexer.cpp +++ b/clang/lib/Format/FormatTokenLexer.cpp @@ -13,11 +13,7 @@ //===----------------------------------------------------------------------===// #include "FormatTokenLexer.h" -#include "FormatToken.h" -#include "clang/Basic/SourceLocation.h" #include "clang/Basic/SourceManager.h" -#include "clang/Format/Format.h" -#include "llvm/Support/Regex.h" namespace clang { namespace format { diff --git a/clang/lib/Format/MacroCallReconstructor.cpp b/clang/lib/Format/MacroCallReconstructor.cpp index 101acefdfe7a31..5ba4f2c99a6afa 100644 --- a/clang/lib/Format/MacroCallReconstructor.cpp +++ b/clang/lib/Format/MacroCallReconstructor.cpp @@ -16,10 +16,7 @@ #include "Macros.h" #include "UnwrappedLineParser.h" -#include "clang/Basic/TokenKinds.h" #include "llvm/ADT/DenseSet.h" -#include "llvm/Support/Debug.h" -#include <cassert> #define DEBUG_TYPE "format-reconstruct" diff --git a/clang/lib/Format/MacroExpander.cpp b/clang/lib/Format/MacroExpander.cpp index 5a1cdd884c5e69..7668765764e8d7 100644 --- a/clang/lib/Format/MacroExpander.cpp +++ b/clang/lib/Format/MacroExpander.cpp @@ -14,19 +14,8 @@ #include "Macros.h" -#include "Encoding.h" -#include "FormatToken.h" #include "FormatTokenLexer.h" -#include "clang/Basic/TokenKinds.h" -#include "clang/Format/Format.h" -#include "clang/Lex/HeaderSearch.h" -#include "clang/Lex/HeaderSearchOptions.h" -#include "clang/Lex/Lexer.h" -#include "clang/Lex/ModuleLoader.h" #include "clang/Lex/Preprocessor.h" -#include "clang/Lex/PreprocessorOptions.h" -#include "llvm/ADT/StringSet.h" -#include "llvm/Support/ErrorHandling.h" namespace clang { namespace format { diff --git a/clang/lib/Format/NamespaceEndCommentsFixer.cpp b/clang/lib/Format/NamespaceEndCommentsFixer.cpp index 08f8d6840fe00a..010cc41f176836 100644 --- a/clang/lib/Format/NamespaceEndCommentsFixer.cpp +++ b/clang/lib/Format/NamespaceEndCommentsFixer.cpp @@ -13,9 +13,6 @@ //===----------------------------------------------------------------------===// #include "NamespaceEndCommentsFixer.h" -#include "clang/Basic/TokenKinds.h" -#include "llvm/Support/Debug.h" -#include "llvm/Support/Regex.h" #define DEBUG_TYPE "namespace-end-comments-fixer" diff --git a/clang/lib/Format/ObjCPropertyAttributeOrderFixer.cpp b/clang/lib/Format/ObjCPropertyAttributeOrderFixer.cpp index c91d6251425eab..6339d346fd9c7d 100644 --- a/clang/lib/Format/ObjCPropertyAttributeOrderFixer.cpp +++ b/clang/lib/Format/ObjCPropertyAttributeOrderFixer.cpp @@ -15,8 +15,6 @@ #include "ObjCPropertyAttributeOrderFixer.h" -#include <algorithm> - namespace clang { namespace format { diff --git a/clang/lib/Format/QualifierAlignmentFixer.cpp b/clang/lib/Format/QualifierAlignmentFixer.cpp index a44c09056a0ed1..32d5153fc8151d 100644 --- a/clang/lib/Format/QualifierAlignmentFixer.cpp +++ b/clang/lib/Format/QualifierAlignmentFixer.cpp @@ -13,12 +13,6 @@ //===----------------------------------------------------------------------===// #include "QualifierAlignmentFixer.h" -#include "FormatToken.h" -#include "llvm/Support/Debug.h" -#include "llvm/Support/Regex.h" - -#include <algorithm> -#include <optional> #define DEBUG_TYPE "format-qualifier-alignment-fixer" diff --git a/clang/lib/Format/SortJavaScriptImports.cpp b/clang/lib/Format/SortJavaScriptImports.cpp index 1a6a1b19e7022a..fda2ad8c311bfb 100644 --- a/clang/lib/Format/SortJavaScriptImports.cpp +++ b/clang/lib/Format/SortJavaScriptImports.cpp @@ -13,19 +13,6 @@ #include "SortJavaScriptImports.h" #include "TokenAnalyzer.h" -#include "TokenAnnotator.h" -#include "clang/Basic/Diagnostic.h" -#include "clang/Basic/DiagnosticOptions.h" -#include "clang/Basic/LLVM.h" -#include "clang/Basic/SourceLocation.h" -#include "clang/Basic/SourceManager.h" -#include "clang/Basic/TokenKinds.h" -#include "clang/Format/Format.h" -#include "llvm/ADT/STLExtras.h" -#include "llvm/ADT/SmallVector.h" -#include "llvm/Support/Debug.h" -#include <algorithm> -#include <string> #define DEBUG_TYPE "format-formatter" diff --git a/clang/lib/Format/TokenAnalyzer.cpp b/clang/lib/Format/TokenAnalyzer.cpp index bd648c430f9b0a..2fdc2460bf67c8 100644 --- a/clang/lib/Format/TokenAnalyzer.cpp +++ b/clang/lib/Format/TokenAnalyzer.cpp @@ -14,21 +14,6 @@ //===----------------------------------------------------------------------===// #include "TokenAnalyzer.h" -#include "AffectedRangeManager.h" -#include "Encoding.h" -#include "FormatToken.h" -#include "FormatTokenLexer.h" -#include "TokenAnnotator.h" -#include "UnwrappedLineParser.h" -#include "clang/Basic/Diagnostic.h" -#include "clang/Basic/DiagnosticOptions.h" -#include "clang/Basic/FileManager.h" -#include "clang/Basic/SourceManager.h" -#include "clang/Format/Format.h" -#include "llvm/ADT/STLExtras.h" -#include "llvm/ADT/SmallVector.h" -#include "llvm/Support/Debug.h" -#include <type_traits> #define DEBUG_TYPE "format-formatter" diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp index 5a715ac8a5f23f..f3458c20a71fac 100644 --- a/clang/lib/Format/TokenAnnotator.cpp +++ b/clang/lib/Format/TokenAnnotator.cpp @@ -13,11 +13,7 @@ //===----------------------------------------------------------------------===// #include "TokenAnnotator.h" -#include "FormatToken.h" -#include "clang/Basic/SourceManager.h" -#include "clang/Basic/TokenKinds.h" #include "llvm/ADT/SmallPtrSet.h" -#include "llvm/Support/Debug.h" #define DEBUG_TYPE "format-token-annotator" diff --git a/clang/lib/Format/UnwrappedLineFormatter.cpp b/clang/lib/Format/UnwrappedLineFormatter.cpp index fb31980ab9f491..bb5841f4e92631 100644 --- a/clang/lib/Format/UnwrappedLineFormatter.cpp +++ b/clang/lib/Format/UnwrappedLineFormatter.cpp @@ -7,10 +7,8 @@ //===----------------------------------------------------------------------===// #include "UnwrappedLineFormatter.h" -#include "FormatToken.h" #include "NamespaceEndCommentsFixer.h" #include "WhitespaceManager.h" -#include "llvm/Support/Debug.h" #include <queue> #define DEBUG_TYPE "format-formatter" diff --git a/clang/lib/Format/UnwrappedLineParser.cpp b/clang/lib/Format/UnwrappedLineParser.cpp index 2b893f7abe4023..6ac4c7dc1a187b 100644 --- a/clang/lib/Format/UnwrappedLineParser.cpp +++ b/clang/lib/Format/UnwrappedLineParser.cpp @@ -13,20 +13,9 @@ //===----------------------------------------------------------------------===// #include "UnwrappedLineParser.h" -#include "FormatToken.h" -#include "FormatTokenLexer.h" #include "FormatTokenSource.h" -#include "Macros.h" #include "TokenAnnotator.h" -#include "clang/Basic/TokenKinds.h" -#include "llvm/ADT/STLExtras.h" -#include "llvm/ADT/StringRef.h" -#include "llvm/Support/Debug.h" #include "llvm/Support/raw_os_ostream.h" -#include "llvm/Support/raw_ostream.h" - -#include <algorithm> -#include <utility> #define DEBUG_TYPE "format-parser" diff --git a/clang/lib/Format/UsingDeclarationsSorter.cpp b/clang/lib/Format/UsingDeclarationsSorter.cpp index 2f4b1e0e462708..3543f86b1a65a5 100644 --- a/clang/lib/Format/UsingDeclarationsSorter.cpp +++ b/clang/lib/Format/UsingDeclarationsSorter.cpp @@ -13,11 +13,6 @@ //===----------------------------------------------------------------------===// #include "UsingDeclarationsSorter.h" -#include "clang/Format/Format.h" -#include "llvm/Support/Debug.h" -#include "llvm/Support/Regex.h" - -#include <algorithm> #define DEBUG_TYPE "using-declarations-sorter" diff --git a/clang/lib/Format/WhitespaceManager.cpp b/clang/lib/Format/WhitespaceManager.cpp index 753be25bfd6758..6577c19cdf7978 100644 --- a/clang/lib/Format/WhitespaceManager.cpp +++ b/clang/lib/Format/WhitespaceManager.cpp @@ -12,9 +12,6 @@ //===----------------------------------------------------------------------===// #include "WhitespaceManager.h" -#include "llvm/ADT/STLExtras.h" -#include "llvm/ADT/SmallVector.h" -#include <algorithm> namespace clang { namespace format { diff --git a/clang/tools/clang-format/ClangFormat.cpp b/clang/tools/clang-format/ClangFormat.cpp index e122cea50f7268..60b0f5d1a0f414 100644 --- a/clang/tools/clang-format/ClangFormat.cpp +++ b/clang/tools/clang-format/ClangFormat.cpp @@ -13,18 +13,12 @@ //===----------------------------------------------------------------------===// #include "../../lib/Format/MatchFilePath.h" -#include "clang/Basic/Diagnostic.h" -#include "clang/Basic/DiagnosticOptions.h" -#include "clang/Basic/FileManager.h" #include "clang/Basic/SourceManager.h" #include "clang/Basic/Version.h" #include "clang/Format/Format.h" #include "clang/Rewrite/Core/Rewriter.h" -#include "llvm/ADT/StringSwitch.h" #include "llvm/Support/CommandLine.h" -#include "llvm/Support/FileSystem.h" #include "llvm/Support/InitLLVM.h" -#include "llvm/Support/Process.h" #include <fstream> using namespace llvm; _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits