From 33b41672f056c757cacdb048ee9ff36b7bbcfce3 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Mon, 18 Nov 2024 15:44:18 -0800 Subject: [PATCH 1/4] [Support] Remove unused includes (NFC) Identified with misc-include-cleaner. --- llvm/lib/Support/ARMBuildAttrs.cpp | 4 ---- llvm/lib/Support/ConvertUTFWrapper.cpp | 1 - llvm/lib/Support/DAGDeltaAlgorithm.cpp | 1 - llvm/lib/Support/ErrorHandling.cpp | 3 --- llvm/lib/Support/InitLLVM.cpp | 4 ---- llvm/lib/Support/LockFileManager.cpp | 1 - llvm/lib/Support/MSP430AttributeParser.cpp | 1 - llvm/lib/Support/MemoryBuffer.cpp | 1 - llvm/lib/Support/NativeFormatting.cpp | 1 - llvm/lib/Support/Parallel.cpp | 1 - llvm/lib/Support/Path.cpp | 1 - llvm/lib/Support/Process.cpp | 1 - llvm/lib/Support/RWMutex.cpp | 1 - llvm/lib/Support/SuffixTreeNode.cpp | 1 - llvm/lib/Support/Threading.cpp | 2 -- llvm/lib/Support/VirtualFileSystem.cpp | 1 - llvm/lib/Support/YAMLTraits.cpp | 1 - llvm/lib/Support/Z3Solver.cpp | 2 -- llvm/lib/Support/raw_ostream.cpp | 1 - llvm/lib/Support/raw_socket_stream.cpp | 1 - 20 files changed, 30 deletions(-) diff --git a/llvm/lib/Support/ARMBuildAttrs.cpp b/llvm/lib/Support/ARMBuildAttrs.cpp index 6ff74e02820da..815cfc62a4b0e 100644 --- a/llvm/lib/Support/ARMBuildAttrs.cpp +++ b/llvm/lib/Support/ARMBuildAttrs.cpp @@ -7,10 +7,6 @@ //===----------------------------------------------------------------------===// #include "llvm/Support/ARMBuildAttributes.h" -#include "llvm/ADT/Twine.h" -#include "llvm/Support/LEB128.h" -#include -#include using namespace llvm; diff --git a/llvm/lib/Support/ConvertUTFWrapper.cpp b/llvm/lib/Support/ConvertUTFWrapper.cpp index 3fa7365e72d34..4952fe65d7767 100644 --- a/llvm/lib/Support/ConvertUTFWrapper.cpp +++ b/llvm/lib/Support/ConvertUTFWrapper.cpp @@ -10,7 +10,6 @@ #include "llvm/ADT/StringRef.h" #include "llvm/Support/ConvertUTF.h" #include "llvm/Support/ErrorHandling.h" -#include "llvm/Support/SwapByteOrder.h" #include #include diff --git a/llvm/lib/Support/DAGDeltaAlgorithm.cpp b/llvm/lib/Support/DAGDeltaAlgorithm.cpp index f1b730e2b58c4..8b23b05913291 100644 --- a/llvm/lib/Support/DAGDeltaAlgorithm.cpp +++ b/llvm/lib/Support/DAGDeltaAlgorithm.cpp @@ -35,7 +35,6 @@ #include "llvm/Support/Debug.h" #include "llvm/Support/Format.h" #include "llvm/Support/raw_ostream.h" -#include #include #include using namespace llvm; diff --git a/llvm/lib/Support/ErrorHandling.cpp b/llvm/lib/Support/ErrorHandling.cpp index 8659f9492d5a3..d26149be4d789 100644 --- a/llvm/lib/Support/ErrorHandling.cpp +++ b/llvm/lib/Support/ErrorHandling.cpp @@ -18,12 +18,9 @@ #include "llvm/Config/config.h" #include "llvm/Config/llvm-config.h" // for LLVM_ENABLE_THREADS #include "llvm/Support/Debug.h" -#include "llvm/Support/Errc.h" -#include "llvm/Support/Error.h" #include "llvm/Support/Process.h" #include "llvm/Support/Signals.h" #include "llvm/Support/Threading.h" -#include "llvm/Support/WindowsError.h" #include "llvm/Support/raw_ostream.h" #include #include diff --git a/llvm/lib/Support/InitLLVM.cpp b/llvm/lib/Support/InitLLVM.cpp index 2b3ddd39b0879..bd346fda07c63 100644 --- a/llvm/lib/Support/InitLLVM.cpp +++ b/llvm/lib/Support/InitLLVM.cpp @@ -8,13 +8,9 @@ #include "llvm/Support/InitLLVM.h" #include "llvm/ADT/StringRef.h" -#include "llvm/Support/AutoConvert.h" -#include "llvm/Support/Error.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/ManagedStatic.h" -#include "llvm/Support/PrettyStackTrace.h" #include "llvm/Support/Signals.h" -#include "llvm/Support/SwapByteOrder.h" #ifdef _WIN32 #include "llvm/Support/Windows/WindowsSupport.h" diff --git a/llvm/lib/Support/LockFileManager.cpp b/llvm/lib/Support/LockFileManager.cpp index 4a8dd89b7619b..9a45a9966458e 100644 --- a/llvm/lib/Support/LockFileManager.cpp +++ b/llvm/lib/Support/LockFileManager.cpp @@ -25,7 +25,6 @@ #include #include #include -#include #include #ifdef _WIN32 diff --git a/llvm/lib/Support/MSP430AttributeParser.cpp b/llvm/lib/Support/MSP430AttributeParser.cpp index 27694b8f60f36..bfc69cb2bb3ce 100644 --- a/llvm/lib/Support/MSP430AttributeParser.cpp +++ b/llvm/lib/Support/MSP430AttributeParser.cpp @@ -8,7 +8,6 @@ #include "llvm/Support/MSP430AttributeParser.h" #include "llvm/ADT/ArrayRef.h" -#include "llvm/Support/ErrorHandling.h" using namespace llvm; using namespace llvm::MSP430Attrs; diff --git a/llvm/lib/Support/MemoryBuffer.cpp b/llvm/lib/Support/MemoryBuffer.cpp index aea81964ba9fd..7ea68ee4cafd7 100644 --- a/llvm/lib/Support/MemoryBuffer.cpp +++ b/llvm/lib/Support/MemoryBuffer.cpp @@ -19,7 +19,6 @@ #include "llvm/Support/Error.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/FileSystem.h" -#include "llvm/Support/MathExtras.h" #include "llvm/Support/Process.h" #include "llvm/Support/Program.h" #include "llvm/Support/SmallVectorMemoryBuffer.h" diff --git a/llvm/lib/Support/NativeFormatting.cpp b/llvm/lib/Support/NativeFormatting.cpp index 3b9273e1eaadb..7a64730434193 100644 --- a/llvm/lib/Support/NativeFormatting.cpp +++ b/llvm/lib/Support/NativeFormatting.cpp @@ -11,7 +11,6 @@ #include "llvm/ADT/SmallString.h" #include "llvm/ADT/StringExtras.h" #include "llvm/Support/Format.h" -#include "llvm/Support/MathExtras.h" #include "llvm/Support/raw_ostream.h" #include diff --git a/llvm/lib/Support/Parallel.cpp b/llvm/lib/Support/Parallel.cpp index 2ba02b73dd8f1..36ab8fdd29d4d 100644 --- a/llvm/lib/Support/Parallel.cpp +++ b/llvm/lib/Support/Parallel.cpp @@ -8,7 +8,6 @@ #include "llvm/Support/Parallel.h" #include "llvm/Config/llvm-config.h" -#include "llvm/Support/ManagedStatic.h" #include "llvm/Support/Threading.h" #include diff --git a/llvm/lib/Support/Path.cpp b/llvm/lib/Support/Path.cpp index 4db9bc80b415b..d775285197103 100644 --- a/llvm/lib/Support/Path.cpp +++ b/llvm/lib/Support/Path.cpp @@ -16,7 +16,6 @@ #include "llvm/ADT/StringExtras.h" #include "llvm/Config/config.h" #include "llvm/Config/llvm-config.h" -#include "llvm/Support/Endian.h" #include "llvm/Support/Errc.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/FileSystem.h" diff --git a/llvm/lib/Support/Process.cpp b/llvm/lib/Support/Process.cpp index 54462f23c8424..57bcc2d116dad 100644 --- a/llvm/lib/Support/Process.cpp +++ b/llvm/lib/Support/Process.cpp @@ -18,7 +18,6 @@ #include "llvm/Support/CrashRecoveryContext.h" #include "llvm/Support/FileSystem.h" #include "llvm/Support/Path.h" -#include "llvm/Support/Program.h" #include #include // for _Exit diff --git a/llvm/lib/Support/RWMutex.cpp b/llvm/lib/Support/RWMutex.cpp index 4294c4356f476..83adef5bcd97d 100644 --- a/llvm/lib/Support/RWMutex.cpp +++ b/llvm/lib/Support/RWMutex.cpp @@ -13,7 +13,6 @@ #include "llvm/Support/RWMutex.h" #include "llvm/Config/config.h" #include "llvm/Config/llvm-config.h" // for LLVM_ENABLE_THREADS -#include "llvm/Support/Allocator.h" #if defined(LLVM_USE_RW_MUTEX_IMPL) using namespace llvm; diff --git a/llvm/lib/Support/SuffixTreeNode.cpp b/llvm/lib/Support/SuffixTreeNode.cpp index 9f1f94a39895e..dee8c5816b8bb 100644 --- a/llvm/lib/Support/SuffixTreeNode.cpp +++ b/llvm/lib/Support/SuffixTreeNode.cpp @@ -12,7 +12,6 @@ //===----------------------------------------------------------------------===// #include "llvm/Support/SuffixTreeNode.h" -#include "llvm/Support/Casting.h" using namespace llvm; diff --git a/llvm/lib/Support/Threading.cpp b/llvm/lib/Support/Threading.cpp index 7cc7ba44cc72d..693de0e6400fb 100644 --- a/llvm/lib/Support/Threading.cpp +++ b/llvm/lib/Support/Threading.cpp @@ -16,10 +16,8 @@ #include "llvm/Config/llvm-config.h" #include -#include #include #include -#include using namespace llvm; diff --git a/llvm/lib/Support/VirtualFileSystem.cpp b/llvm/lib/Support/VirtualFileSystem.cpp index b3cdaa3eefc90..5febdf992fbfe 100644 --- a/llvm/lib/Support/VirtualFileSystem.cpp +++ b/llvm/lib/Support/VirtualFileSystem.cpp @@ -37,7 +37,6 @@ #include "llvm/Support/SourceMgr.h" #include "llvm/Support/YAMLParser.h" #include "llvm/Support/raw_ostream.h" -#include #include #include #include diff --git a/llvm/lib/Support/YAMLTraits.cpp b/llvm/lib/Support/YAMLTraits.cpp index 56b557646100b..d259da65c5cf7 100644 --- a/llvm/lib/Support/YAMLTraits.cpp +++ b/llvm/lib/Support/YAMLTraits.cpp @@ -21,7 +21,6 @@ #include "llvm/Support/VersionTuple.h" #include "llvm/Support/YAMLParser.h" #include "llvm/Support/raw_ostream.h" -#include #include #include #include diff --git a/llvm/lib/Support/Z3Solver.cpp b/llvm/lib/Support/Z3Solver.cpp index 9aece099b0629..d4ce98dffe52a 100644 --- a/llvm/lib/Support/Z3Solver.cpp +++ b/llvm/lib/Support/Z3Solver.cpp @@ -6,9 +6,7 @@ // //===----------------------------------------------------------------------===// -#include "llvm/ADT/ScopeExit.h" #include "llvm/Config/config.h" -#include "llvm/Support/NativeFormatting.h" #include "llvm/Support/SMTAPI.h" using namespace llvm; diff --git a/llvm/lib/Support/raw_ostream.cpp b/llvm/lib/Support/raw_ostream.cpp index 5d30c797ebf5b..91fb4dbf16720 100644 --- a/llvm/lib/Support/raw_ostream.cpp +++ b/llvm/lib/Support/raw_ostream.cpp @@ -13,7 +13,6 @@ #include "llvm/Support/raw_ostream.h" #include "llvm/ADT/StringExtras.h" #include "llvm/Config/config.h" -#include "llvm/Support/AutoConvert.h" #include "llvm/Support/Compiler.h" #include "llvm/Support/Duration.h" #include "llvm/Support/ErrorHandling.h" diff --git a/llvm/lib/Support/raw_socket_stream.cpp b/llvm/lib/Support/raw_socket_stream.cpp index 04b3233084a41..7a4be5759f900 100644 --- a/llvm/lib/Support/raw_socket_stream.cpp +++ b/llvm/lib/Support/raw_socket_stream.cpp @@ -19,7 +19,6 @@ #include #include #include -#include #ifndef _WIN32 #include From 0da11e14cb91847fed654a11cb711fc7d3ace164 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Tue, 19 Nov 2024 08:20:57 -0800 Subject: [PATCH 2/4] Remove the bits for Z3Solver.cpp. --- llvm/lib/Support/Z3Solver.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/llvm/lib/Support/Z3Solver.cpp b/llvm/lib/Support/Z3Solver.cpp index d4ce98dffe52a..9aece099b0629 100644 --- a/llvm/lib/Support/Z3Solver.cpp +++ b/llvm/lib/Support/Z3Solver.cpp @@ -6,7 +6,9 @@ // //===----------------------------------------------------------------------===// +#include "llvm/ADT/ScopeExit.h" #include "llvm/Config/config.h" +#include "llvm/Support/NativeFormatting.h" #include "llvm/Support/SMTAPI.h" using namespace llvm; From 47272d98ae41bc8d8c74ad34e539e119d496fdb9 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Tue, 19 Nov 2024 08:34:57 -0800 Subject: [PATCH 3/4] Remove the bits for ErrorHandling.cpp. --- llvm/lib/Support/ErrorHandling.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/llvm/lib/Support/ErrorHandling.cpp b/llvm/lib/Support/ErrorHandling.cpp index d26149be4d789..8659f9492d5a3 100644 --- a/llvm/lib/Support/ErrorHandling.cpp +++ b/llvm/lib/Support/ErrorHandling.cpp @@ -18,9 +18,12 @@ #include "llvm/Config/config.h" #include "llvm/Config/llvm-config.h" // for LLVM_ENABLE_THREADS #include "llvm/Support/Debug.h" +#include "llvm/Support/Errc.h" +#include "llvm/Support/Error.h" #include "llvm/Support/Process.h" #include "llvm/Support/Signals.h" #include "llvm/Support/Threading.h" +#include "llvm/Support/WindowsError.h" #include "llvm/Support/raw_ostream.h" #include #include From 7b4789c892d131aa119b653ec305834378e57427 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Tue, 19 Nov 2024 09:04:08 -0800 Subject: [PATCH 4/4] Restore ManagedStatic.h in Parallel.cpp. Restore Error.h in InitLLVM.cpp. --- llvm/lib/Support/InitLLVM.cpp | 1 + llvm/lib/Support/Parallel.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/llvm/lib/Support/InitLLVM.cpp b/llvm/lib/Support/InitLLVM.cpp index bd346fda07c63..eb89f6f8915cb 100644 --- a/llvm/lib/Support/InitLLVM.cpp +++ b/llvm/lib/Support/InitLLVM.cpp @@ -8,6 +8,7 @@ #include "llvm/Support/InitLLVM.h" #include "llvm/ADT/StringRef.h" +#include "llvm/Support/Error.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/ManagedStatic.h" #include "llvm/Support/Signals.h" diff --git a/llvm/lib/Support/Parallel.cpp b/llvm/lib/Support/Parallel.cpp index 36ab8fdd29d4d..2ba02b73dd8f1 100644 --- a/llvm/lib/Support/Parallel.cpp +++ b/llvm/lib/Support/Parallel.cpp @@ -8,6 +8,7 @@ #include "llvm/Support/Parallel.h" #include "llvm/Config/llvm-config.h" +#include "llvm/Support/ManagedStatic.h" #include "llvm/Support/Threading.h" #include