[Mlir-commits] [clang] [lld] [llvm] [mlir] [NFC][IWYU] Update Support library with IWYU. (PR #102707)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Fri Aug 9 17:32:52 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-bolt
@llvm/pr-subscribers-backend-risc-v

@llvm/pr-subscribers-lld-elf

Author: Daniil Fukalov (dfukalov)

<details>
<summary>Changes</summary>

Update according IWYU
- include files in lib/ADT and
- both include and cpp files in lib/Support.

Firstly processed the sources by scripts from https://github.com/include-what-you-use/include-what-you-use, then tuned some miscorrections, also taking into account clangd suggestions.

---

Patch is 131.14 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/102707.diff


221 Files Affected:

- (modified) bolt/tools/driver/llvm-bolt.cpp (+1) 
- (modified) bolt/tools/merge-fdata/merge-fdata.cpp (+1) 
- (modified) clang/lib/Driver/ToolChains/SPIRV.cpp (+1) 
- (modified) lld/Common/ErrorHandler.cpp (+1) 
- (modified) lld/MachO/Dwarf.cpp (+1) 
- (modified) lld/MachO/SectionPriorities.cpp (+1) 
- (modified) llvm/include/llvm/ADT/APFixedPoint.h (+7-1) 
- (modified) llvm/include/llvm/ADT/APFloat.h (+13-2) 
- (modified) llvm/include/llvm/ADT/APInt.h (+2) 
- (modified) llvm/include/llvm/ADT/APSInt.h (+9) 
- (modified) llvm/include/llvm/ADT/DynamicAPInt.h (+9-1) 
- (modified) llvm/include/llvm/ADT/FloatingPointMode.h (+4) 
- (modified) llvm/include/llvm/ADT/FoldingSet.h (+2) 
- (modified) llvm/include/llvm/ADT/IntEqClasses.h (+1) 
- (modified) llvm/include/llvm/ADT/IntervalMap.h (+1) 
- (modified) llvm/include/llvm/ADT/SlowDynamicAPInt.h (+4-1) 
- (modified) llvm/include/llvm/ADT/SmallPtrSet.h (+1-1) 
- (modified) llvm/include/llvm/ADT/SmallVector.h (+1-1) 
- (modified) llvm/include/llvm/ADT/Statistic.h (+2-1) 
- (modified) llvm/include/llvm/ADT/StringExtras.h (+8) 
- (modified) llvm/include/llvm/ADT/StringMap.h (+8) 
- (modified) llvm/include/llvm/ADT/StringRef.h (+1) 
- (modified) llvm/include/llvm/ADT/Twine.h (+1) 
- (modified) llvm/include/llvm/Support/ARMAttributeParser.h (+1) 
- (modified) llvm/include/llvm/Support/ARMWinEH.h (+4) 
- (modified) llvm/include/llvm/Support/Atomic.h (+1-1) 
- (modified) llvm/include/llvm/Support/BalancedPartitioning.h (+6-2) 
- (modified) llvm/include/llvm/Support/Base64.h (+2) 
- (modified) llvm/include/llvm/Support/BinaryStreamError.h (+3-1) 
- (modified) llvm/include/llvm/Support/BinaryStreamReader.h (+6-1) 
- (modified) llvm/include/llvm/Support/BinaryStreamRef.h (+6) 
- (modified) llvm/include/llvm/Support/BinaryStreamWriter.h (+2) 
- (modified) llvm/include/llvm/Support/BranchProbability.h (+1-1) 
- (modified) llvm/include/llvm/Support/CRC.h (+1-1) 
- (modified) llvm/include/llvm/Support/CSKYAttributeParser.h (+5) 
- (modified) llvm/include/llvm/Support/CachePruning.h (+4-1) 
- (modified) llvm/include/llvm/Support/Caching.h (+8) 
- (modified) llvm/include/llvm/Support/Chrono.h (+8-5) 
- (modified) llvm/include/llvm/Support/CodeGenCoverage.h (+3) 
- (modified) llvm/include/llvm/Support/CommandLine.h (+4-4) 
- (modified) llvm/include/llvm/Support/Compression.h (+4-2) 
- (modified) llvm/include/llvm/Support/ConvertEBCDIC.h (+2-1) 
- (modified) llvm/include/llvm/Support/DJB.h (+1) 
- (modified) llvm/include/llvm/Support/DataExtractor.h (+5-1) 
- (modified) llvm/include/llvm/Support/DebugCounter.h (+6-1) 
- (modified) llvm/include/llvm/Support/ELFAttributeParser.h (+4-2) 
- (modified) llvm/include/llvm/Support/Error.h (+2-1) 
- (modified) llvm/include/llvm/Support/ExponentialBackoff.h (+1-2) 
- (modified) llvm/include/llvm/Support/FileCollector.h (+8) 
- (modified) llvm/include/llvm/Support/FileOutputBuffer.h (+4-1) 
- (modified) llvm/include/llvm/Support/FileUtilities.h (+4-2) 
- (modified) llvm/include/llvm/Support/FormatVariadic.h (-1) 
- (modified) llvm/include/llvm/Support/FormatVariadicDetails.h (-1) 
- (modified) llvm/include/llvm/Support/FormattedStream.h (+3) 
- (modified) llvm/include/llvm/Support/GlobPattern.h (+1) 
- (modified) llvm/include/llvm/Support/GraphWriter.h (+1) 
- (modified) llvm/include/llvm/Support/HexagonAttributeParser.h (+5) 
- (modified) llvm/include/llvm/Support/InstructionCost.h (+1) 
- (modified) llvm/include/llvm/Support/JSON.h (+21) 
- (modified) llvm/include/llvm/Support/KnownBits.h (+3) 
- (modified) llvm/include/llvm/Support/LEB128.h (+2) 
- (modified) llvm/include/llvm/Support/LineIterator.h (+2-1) 
- (modified) llvm/include/llvm/Support/LockFileManager.h (+2-1) 
- (modified) llvm/include/llvm/Support/MD5.h (+3) 
- (modified) llvm/include/llvm/Support/MSP430AttributeParser.h (+5) 
- (modified) llvm/include/llvm/Support/MathExtras.h (-1) 
- (modified) llvm/include/llvm/Support/Memory.h (+1-1) 
- (modified) llvm/include/llvm/Support/MemoryBuffer.h (+1) 
- (modified) llvm/include/llvm/Support/MemoryBufferRef.h (+1) 
- (modified) llvm/include/llvm/Support/NativeFormatting.h (+1) 
- (modified) llvm/include/llvm/Support/OptimizedStructLayout.h (+3-1) 
- (modified) llvm/include/llvm/Support/PGOOptions.h (+1-1) 
- (modified) llvm/include/llvm/Support/Parallel.h (+9-1) 
- (modified) llvm/include/llvm/Support/Path.h (+5-1) 
- (modified) llvm/include/llvm/Support/PrettyStackTrace.h (-1) 
- (modified) llvm/include/llvm/Support/Process.h (+4-1) 
- (modified) llvm/include/llvm/Support/Program.h (+8-1) 
- (modified) llvm/include/llvm/Support/RISCVAttributeParser.h (+5) 
- (modified) llvm/include/llvm/Support/RandomNumberGenerator.h (+1-2) 
- (modified) llvm/include/llvm/Support/ScaledNumber.h (+3) 
- (modified) llvm/include/llvm/Support/ScopedPrinter.h (+5-1) 
- (modified) llvm/include/llvm/Support/SourceMgr.h (+11) 
- (modified) llvm/include/llvm/Support/SpecialCaseList.h (+3-1) 
- (modified) llvm/include/llvm/Support/StringSaver.h (+1) 
- (modified) llvm/include/llvm/Support/SuffixTree.h (+2) 
- (modified) llvm/include/llvm/Support/TarWriter.h (+2) 
- (modified) llvm/include/llvm/Support/ThreadPool.h (+5-5) 
- (modified) llvm/include/llvm/Support/Threading.h (+3-2) 
- (modified) llvm/include/llvm/Support/TimeProfiler.h (+2) 
- (modified) llvm/include/llvm/Support/Timer.h (+2-1) 
- (modified) llvm/include/llvm/Support/ToolOutputFile.h (+8) 
- (modified) llvm/include/llvm/Support/TypeSize.h (+1-2) 
- (modified) llvm/include/llvm/Support/Unicode.h (+3) 
- (modified) llvm/include/llvm/Support/VersionTuple.h (+1) 
- (modified) llvm/include/llvm/Support/VirtualFileSystem.h (+9-5) 
- (modified) llvm/include/llvm/Support/Watchdog.h (-2) 
- (modified) llvm/include/llvm/Support/WithColor.h (+1-1) 
- (modified) llvm/include/llvm/Support/YAMLParser.h (+1) 
- (modified) llvm/include/llvm/Support/YAMLTraits.h (+12) 
- (modified) llvm/include/llvm/Support/circular_raw_ostream.h (+2) 
- (modified) llvm/include/llvm/Support/raw_os_ostream.h (+2) 
- (modified) llvm/include/llvm/Support/raw_ostream.h (+7-1) 
- (modified) llvm/include/llvm/Support/raw_socket_stream.h (+5-1) 
- (modified) llvm/include/llvm/Support/xxhash.h (+1) 
- (modified) llvm/lib/DebugInfo/DWARF/DWARFLocationExpression.cpp (+1) 
- (modified) llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp (+2) 
- (modified) llvm/lib/FileCheck/FileCheck.cpp (+2-1) 
- (modified) llvm/lib/Support/AMDGPUMetadata.cpp (+2) 
- (modified) llvm/lib/Support/APFixedPoint.cpp (+3-1) 
- (modified) llvm/lib/Support/APFloat.cpp (+6-2) 
- (modified) llvm/lib/Support/APInt.cpp (+5-1) 
- (modified) llvm/lib/Support/APSInt.cpp (+1) 
- (modified) llvm/lib/Support/ARMAttributeParser.cpp (+11) 
- (modified) llvm/lib/Support/ARMBuildAttrs.cpp (+1-4) 
- (modified) llvm/lib/Support/BalancedPartitioning.cpp (+9) 
- (modified) llvm/lib/Support/Base64.cpp (+2) 
- (modified) llvm/lib/Support/BinaryStreamReader.cpp (+9-1) 
- (modified) llvm/lib/Support/BinaryStreamRef.cpp (+4) 
- (modified) llvm/lib/Support/BinaryStreamWriter.cpp (+8-1) 
- (modified) llvm/lib/Support/BranchProbability.cpp (+1-1) 
- (modified) llvm/lib/Support/BuryPointer.cpp (+1) 
- (modified) llvm/lib/Support/CRC.cpp (+3-2) 
- (modified) llvm/lib/Support/CSKYAttributeParser.cpp (+5) 
- (modified) llvm/lib/Support/CachePruning.cpp (+14-3) 
- (modified) llvm/lib/Support/Caching.cpp (+4-1) 
- (modified) llvm/lib/Support/Chrono.cpp (+1) 
- (modified) llvm/lib/Support/CodeGenCoverage.cpp (+7-1) 
- (modified) llvm/lib/Support/CommandLine.cpp (+13-2) 
- (modified) llvm/lib/Support/Compression.cpp (+3-1) 
- (modified) llvm/lib/Support/ConvertEBCDIC.cpp (+3) 
- (modified) llvm/lib/Support/ConvertUTFWrapper.cpp (+5-1) 
- (modified) llvm/lib/Support/CrashRecoveryContext.cpp (+4) 
- (modified) llvm/lib/Support/DAGDeltaAlgorithm.cpp (+1-1) 
- (modified) llvm/lib/Support/DJB.cpp (+3-1) 
- (modified) llvm/lib/Support/DataExtractor.cpp (+4) 
- (modified) llvm/lib/Support/Debug.cpp (+4-2) 
- (modified) llvm/lib/Support/DebugCounter.cpp (+6-2) 
- (modified) llvm/lib/Support/DivisionByConstantInfo.cpp (+2) 
- (modified) llvm/lib/Support/DynamicAPInt.cpp (+1) 
- (modified) llvm/lib/Support/DynamicLibrary.cpp (+6) 
- (modified) llvm/lib/Support/ELFAttributeParser.cpp (+6) 
- (modified) llvm/lib/Support/ELFAttributes.cpp (+1) 
- (modified) llvm/lib/Support/Error.cpp (+1) 
- (modified) llvm/lib/Support/ErrorHandling.cpp (+6-4) 
- (modified) llvm/lib/Support/ExponentialBackoff.cpp (+1) 
- (modified) llvm/lib/Support/FileCollector.cpp (+6) 
- (modified) llvm/lib/Support/FileOutputBuffer.cpp (+4-1) 
- (modified) llvm/lib/Support/FloatingPointMode.cpp (+2) 
- (modified) llvm/lib/Support/FoldingSet.cpp (+5-1) 
- (modified) llvm/lib/Support/FormatVariadic.cpp (+2) 
- (modified) llvm/lib/Support/FormattedStream.cpp (+2) 
- (modified) llvm/lib/Support/GlobPattern.cpp (+6) 
- (modified) llvm/lib/Support/GraphWriter.cpp (+3-4) 
- (modified) llvm/lib/Support/InitLLVM.cpp (-3) 
- (modified) llvm/lib/Support/JSON.cpp (+4) 
- (modified) llvm/lib/Support/KnownBits.cpp (+4) 
- (modified) llvm/lib/Support/LineIterator.cpp (+2) 
- (modified) llvm/lib/Support/LockFileManager.cpp (+1-4) 
- (modified) llvm/lib/Support/MD5.cpp (+4) 
- (modified) llvm/lib/Support/MSP430AttributeParser.cpp (-1) 
- (modified) llvm/lib/Support/ManagedStatic.cpp (+1-1) 
- (modified) llvm/lib/Support/MemoryBuffer.cpp (+3-1) 
- (modified) llvm/lib/Support/NativeFormatting.cpp (+7-2) 
- (modified) llvm/lib/Support/OptimizedStructLayout.cpp (+6) 
- (modified) llvm/lib/Support/PGOOptions.cpp (+2) 
- (modified) llvm/lib/Support/Parallel.cpp (+3-1) 
- (modified) llvm/lib/Support/Path.cpp (+14-1) 
- (modified) llvm/lib/Support/PluginLoader.cpp (+2) 
- (modified) llvm/lib/Support/Process.cpp (+6-2) 
- (modified) llvm/lib/Support/Program.cpp (+3) 
- (modified) llvm/lib/Support/RISCVAttributeParser.cpp (+3) 
- (modified) llvm/lib/Support/RISCVISAUtils.cpp (+1) 
- (modified) llvm/lib/Support/RandomNumberGenerator.cpp (+5-3) 
- (modified) llvm/lib/Support/SHA1.cpp (+3) 
- (modified) llvm/lib/Support/SHA256.cpp (+3) 
- (modified) llvm/lib/Support/ScaledNumber.cpp (+3) 
- (modified) llvm/lib/Support/ScopedPrinter.cpp (+3-1) 
- (modified) llvm/lib/Support/Signals.cpp (+12-3) 
- (modified) llvm/lib/Support/SipHash.cpp (+1) 
- (modified) llvm/lib/Support/SlowDynamicAPInt.cpp (+4) 
- (modified) llvm/lib/Support/SmallPtrSet.cpp (+1) 
- (modified) llvm/lib/Support/SmallVector.cpp (+2) 
- (modified) llvm/lib/Support/SourceMgr.cpp (+1) 
- (modified) llvm/lib/Support/SpecialCaseList.cpp (+8) 
- (modified) llvm/lib/Support/Statistic.cpp (+7-4) 
- (modified) llvm/lib/Support/StringExtras.cpp (+1) 
- (modified) llvm/lib/Support/StringMap.cpp (+2) 
- (modified) llvm/lib/Support/StringRef.cpp (+4) 
- (modified) llvm/lib/Support/StringSaver.cpp (+2-1) 
- (modified) llvm/lib/Support/SuffixTree.cpp (+6) 
- (modified) llvm/lib/Support/SuffixTreeNode.cpp (+1-1) 
- (modified) llvm/lib/Support/TarWriter.cpp (+6) 
- (modified) llvm/lib/Support/ThreadPool.cpp (+5-2) 
- (modified) llvm/lib/Support/Threading.cpp (+1-5) 
- (modified) llvm/lib/Support/TimeProfiler.cpp (+10) 
- (modified) llvm/lib/Support/Timer.cpp (+10-2) 
- (modified) llvm/lib/Support/Twine.cpp (+1-1) 
- (modified) llvm/lib/Support/TypeSize.cpp (+3-2) 
- (modified) llvm/lib/Support/Unicode.cpp (+2) 
- (modified) llvm/lib/Support/UnicodeNameToCodepoint.cpp (+13) 
- (modified) llvm/lib/Support/UnicodeNameToCodepointGenerated.cpp (+1-1) 
- (modified) llvm/lib/Support/Unix/Process.inc (+1-1) 
- (modified) llvm/lib/Support/Unix/Unix.h (+1-1) 
- (modified) llvm/lib/Support/VirtualFileSystem.cpp (+4-4) 
- (modified) llvm/lib/Support/WithColor.cpp (+2-2) 
- (modified) llvm/lib/Support/YAMLParser.cpp (+4) 
- (modified) llvm/lib/Support/YAMLTraits.cpp (+2-1) 
- (modified) llvm/lib/Support/Z3Solver.cpp (+6-3) 
- (modified) llvm/lib/Support/circular_raw_ostream.cpp (+2) 
- (modified) llvm/lib/Support/raw_ostream.cpp (+7-1) 
- (modified) llvm/lib/Support/raw_socket_stream.cpp (+4-2) 
- (modified) llvm/lib/Support/xxhash.cpp (+2-1) 
- (modified) llvm/tools/llvm-objdump/MachODump.cpp (+1) 
- (modified) llvm/tools/llvm-rc/llvm-rc.cpp (+1) 
- (modified) llvm/tools/llvm-xray/xray-account.cpp (+1) 
- (modified) llvm/tools/llvm-xray/xray-graph-diff.cpp (+1) 
- (modified) llvm/tools/llvm-xray/xray-graph.cpp (+1) 
- (modified) llvm/unittests/Support/ThreadPool.cpp (+1) 
- (modified) llvm/unittests/TargetParser/Host.cpp (+1) 
- (modified) llvm/utils/FileCheck/FileCheck.cpp (+1) 
- (modified) mlir/include/mlir/Analysis/Presburger/Fraction.h (+1) 


``````````diff
diff --git a/bolt/tools/driver/llvm-bolt.cpp b/bolt/tools/driver/llvm-bolt.cpp
index 9b03524e9f18e8..4408b8ce824a7a 100644
--- a/bolt/tools/driver/llvm-bolt.cpp
+++ b/bolt/tools/driver/llvm-bolt.cpp
@@ -21,6 +21,7 @@
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/Errc.h"
 #include "llvm/Support/Error.h"
+#include "llvm/Support/FileSystem.h"
 #include "llvm/Support/ManagedStatic.h"
 #include "llvm/Support/Path.h"
 #include "llvm/Support/PrettyStackTrace.h"
diff --git a/bolt/tools/merge-fdata/merge-fdata.cpp b/bolt/tools/merge-fdata/merge-fdata.cpp
index f2ac5ad4492ee5..6d68b0535ac8bc 100644
--- a/bolt/tools/merge-fdata/merge-fdata.cpp
+++ b/bolt/tools/merge-fdata/merge-fdata.cpp
@@ -21,6 +21,7 @@
 #include "llvm/Support/PrettyStackTrace.h"
 #include "llvm/Support/Signals.h"
 #include "llvm/Support/ThreadPool.h"
+#include "llvm/Support/thread.h"
 #include <algorithm>
 #include <mutex>
 #include <unordered_map>
diff --git a/clang/lib/Driver/ToolChains/SPIRV.cpp b/clang/lib/Driver/ToolChains/SPIRV.cpp
index ce900600cbee51..2010d1b4f2835c 100644
--- a/clang/lib/Driver/ToolChains/SPIRV.cpp
+++ b/clang/lib/Driver/ToolChains/SPIRV.cpp
@@ -12,6 +12,7 @@
 #include "clang/Driver/Driver.h"
 #include "clang/Driver/InputInfo.h"
 #include "clang/Driver/Options.h"
+#include "llvm/Support/FileSystem.h"
 
 using namespace clang::driver;
 using namespace clang::driver::toolchains;
diff --git a/lld/Common/ErrorHandler.cpp b/lld/Common/ErrorHandler.cpp
index 4e3a1bc31ade50..7cf619c3deb67f 100644
--- a/lld/Common/ErrorHandler.cpp
+++ b/lld/Common/ErrorHandler.cpp
@@ -11,6 +11,7 @@
 #include "llvm/Support/Parallel.h"
 
 #include "lld/Common/CommonLinkerContext.h"
+#include "llvm/ADT/SmallString.h"
 #include "llvm/ADT/Twine.h"
 #include "llvm/IR/DiagnosticInfo.h"
 #include "llvm/IR/DiagnosticPrinter.h"
diff --git a/lld/MachO/Dwarf.cpp b/lld/MachO/Dwarf.cpp
index 47dc51e6196d12..cc817b621570c6 100644
--- a/lld/MachO/Dwarf.cpp
+++ b/lld/MachO/Dwarf.cpp
@@ -10,6 +10,7 @@
 #include "InputFiles.h"
 #include "InputSection.h"
 #include "OutputSegment.h"
+#include "llvm/ADT/StringSwitch.h"
 
 #include <memory>
 
diff --git a/lld/MachO/SectionPriorities.cpp b/lld/MachO/SectionPriorities.cpp
index 69c301d8ff8a71..3d77f7f7dc36f2 100644
--- a/lld/MachO/SectionPriorities.cpp
+++ b/lld/MachO/SectionPriorities.cpp
@@ -23,6 +23,7 @@
 #include "lld/Common/ErrorHandler.h"
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/MapVector.h"
+#include "llvm/ADT/StringSwitch.h"
 #include "llvm/Support/Path.h"
 #include "llvm/Support/TimeProfiler.h"
 #include "llvm/Support/raw_ostream.h"
diff --git a/llvm/include/llvm/ADT/APFixedPoint.h b/llvm/include/llvm/ADT/APFixedPoint.h
index 0c014e76aa7126..6c004936ce0867 100644
--- a/llvm/include/llvm/ADT/APFixedPoint.h
+++ b/llvm/include/llvm/ADT/APFixedPoint.h
@@ -16,16 +16,22 @@
 #ifndef LLVM_ADT_APFIXEDPOINT_H
 #define LLVM_ADT_APFIXEDPOINT_H
 
+#include "llvm/ADT/APInt.h"
 #include "llvm/ADT/APSInt.h"
-#include "llvm/ADT/DenseMapInfo.h"
 #include "llvm/ADT/Hashing.h"
 #include "llvm/ADT/SmallString.h"
+#include "llvm/ADT/bit.h"
 #include "llvm/Support/raw_ostream.h"
+#include <algorithm>
+#include <assert.h>
+#include <stdint.h>
+#include <string>
 
 namespace llvm {
 
 class APFloat;
 struct fltSemantics;
+template <typename T> class SmallVectorImpl;
 
 /// The fixed point semantics work similarly to fltSemantics. The width
 /// specifies the whole bit width of the underlying scaled integer (with padding
diff --git a/llvm/include/llvm/ADT/APFloat.h b/llvm/include/llvm/ADT/APFloat.h
index 7039e961bff82d..48e560c7d9a315 100644
--- a/llvm/include/llvm/ADT/APFloat.h
+++ b/llvm/include/llvm/ADT/APFloat.h
@@ -18,9 +18,22 @@
 #include "llvm/ADT/APInt.h"
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/FloatingPointMode.h"
+#include "llvm/ADT/Hashing.h"
+#include "llvm/Support/Compiler.h"
+#include "llvm/Support/Error.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/float128.h"
+#include <assert.h>
+#include <limits.h>
 #include <memory>
+#include <new>
+#include <stdint.h>
+#include <type_traits>
+#include <utility>
+
+namespace llvm {
+class FoldingSetNodeID;
+} // namespace llvm
 
 #define APFLOAT_DISPATCH_ON_SEMANTICS(METHOD_CALL)                             \
   do {                                                                         \
@@ -38,8 +51,6 @@ class APSInt;
 class StringRef;
 class APFloat;
 class raw_ostream;
-
-template <typename T> class Expected;
 template <typename T> class SmallVectorImpl;
 
 /// Enum that represents what fraction of the LSB truncated bits of an fp number
diff --git a/llvm/include/llvm/ADT/APInt.h b/llvm/include/llvm/ADT/APInt.h
index 108df7e0eaeaa3..5a8f8227228654 100644
--- a/llvm/include/llvm/ADT/APInt.h
+++ b/llvm/include/llvm/ADT/APInt.h
@@ -15,6 +15,7 @@
 #ifndef LLVM_ADT_APINT_H
 #define LLVM_ADT_APINT_H
 
+#include "llvm/ADT/bit.h"
 #include "llvm/Support/Compiler.h"
 #include "llvm/Support/MathExtras.h"
 #include "llvm/Support/float128.h"
@@ -22,6 +23,7 @@
 #include <climits>
 #include <cstring>
 #include <optional>
+#include <stdint.h>
 #include <utility>
 
 namespace llvm {
diff --git a/llvm/include/llvm/ADT/APSInt.h b/llvm/include/llvm/ADT/APSInt.h
index 90b988875a24dc..e90f580d3cd237 100644
--- a/llvm/include/llvm/ADT/APSInt.h
+++ b/llvm/include/llvm/ADT/APSInt.h
@@ -16,8 +16,17 @@
 #define LLVM_ADT_APSINT_H
 
 #include "llvm/ADT/APInt.h"
+#include "llvm/ADT/StringRef.h"
+#include <assert.h>
+#include <optional>
+#include <stdint.h>
+#include <utility>
 
 namespace llvm {
+class FoldingSetNodeID;
+class raw_ostream;
+template <typename T, typename Enable> struct DenseMapInfo;
+template <typename T> class SmallVectorImpl;
 
 /// An arbitrary precision integer that knows its signedness.
 class [[nodiscard]] APSInt : public APInt {
diff --git a/llvm/include/llvm/ADT/DynamicAPInt.h b/llvm/include/llvm/ADT/DynamicAPInt.h
index 4444d52527def1..d233ff760b2a13 100644
--- a/llvm/include/llvm/ADT/DynamicAPInt.h
+++ b/llvm/include/llvm/ADT/DynamicAPInt.h
@@ -16,12 +16,20 @@
 #ifndef LLVM_ADT_DYNAMICAPINT_H
 #define LLVM_ADT_DYNAMICAPINT_H
 
+#include "llvm/ADT/APInt.h"
+#include "llvm/ADT/Hashing.h"
 #include "llvm/ADT/SlowDynamicAPInt.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/MathExtras.h"
-#include "llvm/Support/raw_ostream.h"
+#include <assert.h>
+#include <limits>
+#include <new>
 #include <numeric>
+#include <stdint.h>
 
 namespace llvm {
+class raw_ostream;
+
 /// This class provides support for dynamic arbitrary-precision arithmetic.
 ///
 /// Unlike APInt, this extends the precision as necessary to prevent overflows
diff --git a/llvm/include/llvm/ADT/FloatingPointMode.h b/llvm/include/llvm/ADT/FloatingPointMode.h
index 639d931ef88fec..7bae2dff81b1da 100644
--- a/llvm/include/llvm/ADT/FloatingPointMode.h
+++ b/llvm/include/llvm/ADT/FloatingPointMode.h
@@ -16,8 +16,12 @@
 #define LLVM_ADT_FLOATINGPOINTMODE_H
 
 #include "llvm/ADT/BitmaskEnum.h"
+#include "llvm/ADT/StringRef.h"
 #include "llvm/ADT/StringSwitch.h"
 #include "llvm/Support/raw_ostream.h"
+#include <stdint.h>
+#include <string>
+#include <tuple>
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/ADT/FoldingSet.h b/llvm/include/llvm/ADT/FoldingSet.h
index 3c2eaade57e475..7610d06f469d55 100644
--- a/llvm/include/llvm/ADT/FoldingSet.h
+++ b/llvm/include/llvm/ADT/FoldingSet.h
@@ -16,11 +16,13 @@
 #ifndef LLVM_ADT_FOLDINGSET_H
 #define LLVM_ADT_FOLDINGSET_H
 
+#include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/Hashing.h"
 #include "llvm/ADT/STLForwardCompat.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/iterator.h"
 #include "llvm/Support/Allocator.h"
+#include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/xxhash.h"
 #include <cassert>
 #include <cstddef>
diff --git a/llvm/include/llvm/ADT/IntEqClasses.h b/llvm/include/llvm/ADT/IntEqClasses.h
index 9ee8a46be411ee..0bc1cceffacc83 100644
--- a/llvm/include/llvm/ADT/IntEqClasses.h
+++ b/llvm/include/llvm/ADT/IntEqClasses.h
@@ -22,6 +22,7 @@
 #define LLVM_ADT_INTEQCLASSES_H
 
 #include "llvm/ADT/SmallVector.h"
+#include <assert.h>
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/ADT/IntervalMap.h b/llvm/include/llvm/ADT/IntervalMap.h
index 99bf3087722337..805f3123a777cc 100644
--- a/llvm/include/llvm/ADT/IntervalMap.h
+++ b/llvm/include/llvm/ADT/IntervalMap.h
@@ -110,6 +110,7 @@
 #include "llvm/Support/RecyclingAllocator.h"
 #include <algorithm>
 #include <cassert>
+#include <cstddef>
 #include <iterator>
 #include <new>
 #include <utility>
diff --git a/llvm/include/llvm/ADT/SlowDynamicAPInt.h b/llvm/include/llvm/ADT/SlowDynamicAPInt.h
index cda5f39eb98c35..b22e2bb0abea8e 100644
--- a/llvm/include/llvm/ADT/SlowDynamicAPInt.h
+++ b/llvm/include/llvm/ADT/SlowDynamicAPInt.h
@@ -19,10 +19,13 @@
 #define LLVM_ADT_SLOWDYNAMICAPINT_H
 
 #include "llvm/ADT/APInt.h"
-#include "llvm/Support/raw_ostream.h"
+#include "llvm/ADT/Hashing.h"
+#include "llvm/Support/Compiler.h"
+#include <stdint.h>
 
 namespace llvm {
 class DynamicAPInt;
+class raw_ostream;
 } // namespace llvm
 
 namespace llvm::detail {
diff --git a/llvm/include/llvm/ADT/SmallPtrSet.h b/llvm/include/llvm/ADT/SmallPtrSet.h
index 78383f495b6a58..a8d8527c8d8e0c 100644
--- a/llvm/include/llvm/ADT/SmallPtrSet.h
+++ b/llvm/include/llvm/ADT/SmallPtrSet.h
@@ -16,7 +16,6 @@
 #define LLVM_ADT_SMALLPTRSET_H
 
 #include "llvm/ADT/EpochTracker.h"
-#include "llvm/Support/Compiler.h"
 #include "llvm/Support/MathExtras.h"
 #include "llvm/Support/ReverseIteration.h"
 #include "llvm/Support/type_traits.h"
@@ -31,6 +30,7 @@
 #include <utility>
 
 namespace llvm {
+template <typename T> struct PointerLikeTypeTraits;
 
 /// SmallPtrSetImplBase - This is the common code shared among all the
 /// SmallPtrSet<>'s, which is almost everything.  SmallPtrSet has two modes, one
diff --git a/llvm/include/llvm/ADT/SmallVector.h b/llvm/include/llvm/ADT/SmallVector.h
index 17444147b102a9..a8ac07bd0fce1e 100644
--- a/llvm/include/llvm/ADT/SmallVector.h
+++ b/llvm/include/llvm/ADT/SmallVector.h
@@ -15,7 +15,6 @@
 #define LLVM_ADT_SMALLVECTOR_H
 
 #include "llvm/Support/Compiler.h"
-#include "llvm/Support/type_traits.h"
 #include <algorithm>
 #include <cassert>
 #include <cstddef>
@@ -28,6 +27,7 @@
 #include <limits>
 #include <memory>
 #include <new>
+#include <stdint.h>
 #include <type_traits>
 #include <utility>
 
diff --git a/llvm/include/llvm/ADT/Statistic.h b/llvm/include/llvm/ADT/Statistic.h
index 9475b6697031a4..58f0653f947eac 100644
--- a/llvm/include/llvm/ADT/Statistic.h
+++ b/llvm/include/llvm/ADT/Statistic.h
@@ -27,9 +27,10 @@
 #define LLVM_ADT_STATISTIC_H
 
 #include "llvm/Config/llvm-config.h"
-#include "llvm/Support/Compiler.h"
 #include <atomic>
 #include <memory>
+#include <stdint.h>
+#include <utility>
 #include <vector>
 
 // Determine whether statistics should be enabled. We must do it here rather
diff --git a/llvm/include/llvm/ADT/StringExtras.h b/llvm/include/llvm/ADT/StringExtras.h
index 20e6ad1f68f996..0fcdae42d4f5fc 100644
--- a/llvm/include/llvm/ADT/StringExtras.h
+++ b/llvm/include/llvm/ADT/StringExtras.h
@@ -14,11 +14,16 @@
 #ifndef LLVM_ADT_STRINGEXTRAS_H
 #define LLVM_ADT_STRINGEXTRAS_H
 
+#include "llvm/ADT/APInt.h"
 #include "llvm/ADT/APSInt.h"
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/SmallString.h"
+#include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/ADT/Twine.h"
+#include "llvm/ADT/iterator.h"
+#include "llvm/ADT/iterator_range.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <cstddef>
 #include <cstdint>
@@ -26,7 +31,10 @@
 #include <cstring>
 #include <iterator>
 #include <string>
+#include <tuple>
+#include <type_traits>
 #include <utility>
+#include <vector>
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/ADT/StringMap.h b/llvm/include/llvm/ADT/StringMap.h
index 9b58af73273913..d9811b5a654d31 100644
--- a/llvm/include/llvm/ADT/StringMap.h
+++ b/llvm/include/llvm/ADT/StringMap.h
@@ -15,11 +15,19 @@
 #define LLVM_ADT_STRINGMAP_H
 
 #include "llvm/ADT/StringMapEntry.h"
+#include "llvm/ADT/StringRef.h"
 #include "llvm/ADT/iterator.h"
+#include "llvm/ADT/iterator_range.h"
 #include "llvm/Support/AllocatorBase.h"
 #include "llvm/Support/PointerLikeTypeTraits.h"
+#include <assert.h>
 #include <initializer_list>
 #include <iterator>
+#include <optional>
+#include <stdint.h>
+#include <stdlib.h>
+#include <type_traits>
+#include <utility>
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/ADT/StringRef.h b/llvm/include/llvm/ADT/StringRef.h
index 049f22b03e46e8..1677ba827df2ae 100644
--- a/llvm/include/llvm/ADT/StringRef.h
+++ b/llvm/include/llvm/ADT/StringRef.h
@@ -18,6 +18,7 @@
 #include <cstddef>
 #include <cstring>
 #include <limits>
+#include <stdint.h>
 #include <string>
 #include <string_view>
 #include <type_traits>
diff --git a/llvm/include/llvm/ADT/Twine.h b/llvm/include/llvm/ADT/Twine.h
index 1f1fd1967efbc9..bbe911038bb2f4 100644
--- a/llvm/include/llvm/ADT/Twine.h
+++ b/llvm/include/llvm/ADT/Twine.h
@@ -13,6 +13,7 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/ErrorHandling.h"
 #include <cassert>
+#include <cstddef>
 #include <cstdint>
 #include <string>
 #include <string_view>
diff --git a/llvm/include/llvm/Support/ARMAttributeParser.h b/llvm/include/llvm/Support/ARMAttributeParser.h
index d1d953120ae7ed..59f479f68ffb3c 100644
--- a/llvm/include/llvm/Support/ARMAttributeParser.h
+++ b/llvm/include/llvm/Support/ARMAttributeParser.h
@@ -13,6 +13,7 @@
 #include "ELFAttributeParser.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/Error.h"
+#include <stdint.h>
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Support/ARMWinEH.h b/llvm/include/llvm/Support/ARMWinEH.h
index b6710cca95650d..a9888936b521f5 100644
--- a/llvm/include/llvm/Support/ARMWinEH.h
+++ b/llvm/include/llvm/Support/ARMWinEH.h
@@ -11,6 +11,10 @@
 
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/Support/Endian.h"
+#include <assert.h>
+#include <stddef.h>
+#include <stdint.h>
+#include <utility>
 
 namespace llvm {
 namespace ARM {
diff --git a/llvm/include/llvm/Support/Atomic.h b/llvm/include/llvm/Support/Atomic.h
index a8445fddc1a855..44a521dc21f883 100644
--- a/llvm/include/llvm/Support/Atomic.h
+++ b/llvm/include/llvm/Support/Atomic.h
@@ -17,7 +17,7 @@
 #ifndef LLVM_SUPPORT_ATOMIC_H
 #define LLVM_SUPPORT_ATOMIC_H
 
-#include "llvm/Support/DataTypes.h"
+#include <stdint.h>
 
 // Windows will at times define MemoryFence.
 #ifdef MemoryFence
diff --git a/llvm/include/llvm/Support/BalancedPartitioning.h b/llvm/include/llvm/Support/BalancedPartitioning.h
index 539d157343fbe3..d7a15db5218e54 100644
--- a/llvm/include/llvm/Support/BalancedPartitioning.h
+++ b/llvm/include/llvm/Support/BalancedPartitioning.h
@@ -39,18 +39,22 @@
 #ifndef LLVM_SUPPORT_BALANCED_PARTITIONING_H
 #define LLVM_SUPPORT_BALANCED_PARTITIONING_H
 
-#include "raw_ostream.h"
 #include "llvm/ADT/ArrayRef.h"
-
+#include "llvm/ADT/SmallVector.h"
+#include "llvm/ADT/iterator_range.h"
 #include <atomic>
 #include <condition_variable>
 #include <mutex>
+#include <optional>
 #include <random>
+#include <stdint.h>
 #include <vector>
 
 namespace llvm {
 
 class ThreadPoolInterface;
+class raw_ostream;
+
 /// A function with a set of utility nodes where it is beneficial to order two
 /// functions close together if they have similar utility nodes
 class BPFunctionNode {
diff --git a/llvm/include/llvm/Support/Base64.h b/llvm/include/llvm/Support/Base64.h
index 3d96884749b32f..fc3d9fcaf32c5d 100644
--- a/llvm/include/llvm/Support/Base64.h
+++ b/llvm/include/llvm/Support/Base64.h
@@ -15,10 +15,12 @@
 
 #include "llvm/Support/Error.h"
 #include <cstdint>
+#include <stddef.h>
 #include <string>
 #include <vector>
 
 namespace llvm {
+class StringRef;
 
 template <class InputBytes> std::string encodeBase64(InputBytes const &Bytes) {
   static const char Table[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
diff --git a/llvm/include/llvm/Support/BinaryStreamError.h b/llvm/include/llvm/Support/BinaryStreamError.h
index cf6e034ffd2ceb..d4bebae72048c4 100644
--- a/llvm/include/llvm/Support/BinaryStreamError.h
+++ b/llvm/include/llvm/Support/BinaryStreamError.h
@@ -11,10 +11,12 @@
 
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/Error.h"
-
 #include <string>
+#include <system_error>
 
 namespace llvm {
+class raw_ostream;
+
 enum class stream_error_code {
   unspecified,
   stream_too_short,
diff --git a/llvm/include/llvm/Support/BinaryStreamReader.h b/llvm/include/llvm/Support/BinaryStreamReader.h
index ca99388c5d03af..a15e5426b103a4 100644
--- a/llvm/include/llvm/Support/BinaryStreamReader.h
+++ b/llvm/include/llvm/Support/BinaryStreamReader.h
@@ -11,15 +11,20 @@
 
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/StringRef.h"
-#include "llvm/Support/Alignment.h"
 #include "llvm/Support/BinaryStreamArray.h"
+#include "llvm/Support/BinaryStreamError.h"
 #include "llvm/Support/BinaryStreamRef.h"
 #include "llvm/Support/ConvertUTF.h"
 #include "llvm/Support/Endian.h"
 #include "llvm/Support/Error.h"
+#include <assert.h>
+#include <stdint.h>
 #include <type_traits>
+#include <utility>
 
 namespace llvm {
+class BinaryStream;
+enum class endianness;
 
 /// Provides read only access to a subclass of `BinaryStream`.  Provides
 /// bounds checking and helpers for writing certain common data types such as
diff --git a/llvm/include/llvm/Support/BinaryStreamRef.h b/llvm/include/llvm/Support/BinaryStreamRef.h
index fdc46f5fd56057..aaa8184ddc0d62 100644
--- a/llvm/include/llvm/Support/BinaryStreamRef.h
+++ b/llvm/include/llvm/Support/BinaryStreamRef.h
@@ -10,14 +10,20 @@
 #define LLVM_SUPPORT_BINARYSTREAMREF_H
 
 #include "llvm/ADT/ArrayRef.h"
+#include "llvm/ADT/BitmaskEnum.h"
+#include "llvm/ADT/StringRef.h"
 #include "llvm/Support/BinaryStream.h"
 #include "llvm/Support/BinaryStreamError.h"
 #include "llvm/Support/Error.h"
+#include <algorithm>
+#include <assert.h>
 #include <cstdint>
 #include <memory>
 #include <optional>
+#include <utility>
 
 namespace llvm {
+enum class endianness;
 
 /// Common stuff for mutable and immutable StreamRefs.
 template <class RefType, class StreamType> class BinaryStreamRefBase {
diff --git a/llvm/include/llvm/Support/BinaryStreamWriter.h b/llvm/include/llvm/Support/BinaryStreamWriter.h
index bc1d7949841d6f..2bd6d30f09d477 100644
--- a/llvm/include/llvm/Support/BinaryStreamWriter.h
+++ b/llvm/include/llvm/Support/BinaryStreamWriter.h
@@ -21,6 +21,8 @@
 #include <utility>
 
 namespace llvm {
+class WritableBinaryStream;
+enum class endianness;
 
 /// Provides write only access to a subclass of `WritableBinaryStream`.
 /// Provides bounds checking and helpers for writing certain common data types
diff --git a/llvm/include/llvm/Support/BranchProbability.h b/llvm/include/llvm/Support/BranchProbability.h
index 79d70cf611d415..894837790d5bef 100644
--- a/llvm/include/llvm/Support/BranchProbability.h
+++ b/llvm/include/llvm/Support/BranchProbability.h
@@ -13,11 +13,11 @@
 #ifndef LLVM_SUPPORT_BRANCHPROBABILITY_H
 #define LLVM_SUPPORT_BRANCHPROBABILITY_H
 
-#include "llvm/Support/DataTypes.h"
 #include <algorithm>
 #include <cassert>
 #include <iterator>
 #include <numeric>
+#include <stdint.h>
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Support/CRC.h b/llvm/include/llvm/Support/CRC.h
index 210890ae06d47c..a055835d835870 100644
--- a/llvm/include/llvm/Support/CRC.h
+++ b/llvm/include/llvm/Support/CRC.h
@@ -13,7 +13,7 @@
 #ifndef LLVM_SUPPORT_CRC_H
 #define LLVM_SUPPORT_CRC_H
 
-#include "llvm/Support/DataTypes.h"
+#include <stdint.h>
 
 namespace llvm {
 template <typename T> class ArrayRef;
diff --git a/llvm/include/llvm/Support/CSKYAttributeParser.h b/llvm/include/llvm/Support/CSKYAttributeParser.h
index e926ebe5e306e3..e1023c37ae9e6a 100644
--- a/llvm/include/llvm/Support/CSKYAttributeParser.h
+++ b/llvm/include/llvm/Support/CSKYAttributeParser.h
@@ -9,10 +9,15 @@
 #ifndef LLVM_SUPPORT_CSKYATTRIBUTEPARSER_H
 #define LLVM_SUPPORT_CSKYATTRIBUTEPARSER_H
 
+#include "llvm/ADT/StringRef.h"
 #include "llvm/Support/CSKYAttributes.h"
 #include "llvm/Support/ELFAttributeParser.h"
+#include "llvm/Support/Error.h"
+#include <stdint.h>
 
 namespace llvm {
+class ScopedPrinter;
+
 class CSKYAttributeParser : public ELFAttributeParser {
   struct DisplayHandler {
     CSKYAttrs::AttrType attribute;
diff --git a/llvm/include/llvm/Support/CachePruning.h b/llvm/include/llvm/Support/CachePruning.h
index 17e148830a73f9..fc12fdecd46783 100644
--- a/llvm/include/llvm/Support/CachePruning.h
+++...
[truncated]

``````````

</details>


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


More information about the Mlir-commits mailing list