[Mlir-commits] [clang] [lld] [llvm] [mlir] [NFC][IWYU] Update Support library with IWYU. (PR #102707)
Daniil Fukalov
llvmlistbot at llvm.org
Mon Aug 12 07:16:35 PDT 2024
https://github.com/dfukalov updated https://github.com/llvm/llvm-project/pull/102707
>From 920c363eb1b32543e09b4bafcb960e9d44c99731 Mon Sep 17 00:00:00 2001
From: dfukalov <1671137+dfukalov at users.noreply.github.com>
Date: Wed, 7 Aug 2024 02:09:07 +0200
Subject: [PATCH 1/2] [NFC][IWYU] Update Support library with IWYU.
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.
---
bolt/tools/driver/llvm-bolt.cpp | 1 +
bolt/tools/merge-fdata/merge-fdata.cpp | 1 +
clang/lib/Driver/ToolChains/SPIRV.cpp | 1 +
lld/Common/ErrorHandler.cpp | 1 +
lld/MachO/Dwarf.cpp | 1 +
lld/MachO/SectionPriorities.cpp | 1 +
llvm/include/llvm/ADT/APFixedPoint.h | 8 ++++++-
llvm/include/llvm/ADT/APFloat.h | 15 +++++++++++--
llvm/include/llvm/ADT/APInt.h | 2 ++
llvm/include/llvm/ADT/APSInt.h | 9 ++++++++
llvm/include/llvm/ADT/DynamicAPInt.h | 10 ++++++++-
llvm/include/llvm/ADT/FloatingPointMode.h | 4 ++++
llvm/include/llvm/ADT/FoldingSet.h | 2 ++
llvm/include/llvm/ADT/IntEqClasses.h | 1 +
llvm/include/llvm/ADT/IntervalMap.h | 1 +
llvm/include/llvm/ADT/SlowDynamicAPInt.h | 5 ++++-
llvm/include/llvm/ADT/SmallPtrSet.h | 2 +-
llvm/include/llvm/ADT/SmallVector.h | 2 +-
llvm/include/llvm/ADT/Statistic.h | 3 ++-
llvm/include/llvm/ADT/StringExtras.h | 8 +++++++
llvm/include/llvm/ADT/StringMap.h | 8 +++++++
llvm/include/llvm/ADT/StringRef.h | 1 +
llvm/include/llvm/ADT/Twine.h | 1 +
.../include/llvm/Support/ARMAttributeParser.h | 1 +
llvm/include/llvm/Support/ARMWinEH.h | 4 ++++
llvm/include/llvm/Support/Atomic.h | 2 +-
.../llvm/Support/BalancedPartitioning.h | 8 +++++--
llvm/include/llvm/Support/Base64.h | 2 ++
llvm/include/llvm/Support/BinaryStreamError.h | 4 +++-
.../include/llvm/Support/BinaryStreamReader.h | 7 ++++++-
llvm/include/llvm/Support/BinaryStreamRef.h | 6 ++++++
.../include/llvm/Support/BinaryStreamWriter.h | 2 ++
llvm/include/llvm/Support/BranchProbability.h | 2 +-
llvm/include/llvm/Support/CRC.h | 2 +-
.../llvm/Support/CSKYAttributeParser.h | 5 +++++
llvm/include/llvm/Support/CachePruning.h | 5 ++++-
llvm/include/llvm/Support/Caching.h | 8 +++++++
llvm/include/llvm/Support/Chrono.h | 13 +++++++-----
llvm/include/llvm/Support/CodeGenCoverage.h | 3 +++
llvm/include/llvm/Support/CommandLine.h | 8 +++----
llvm/include/llvm/Support/Compression.h | 6 ++++--
llvm/include/llvm/Support/ConvertEBCDIC.h | 3 ++-
llvm/include/llvm/Support/DJB.h | 1 +
llvm/include/llvm/Support/DataExtractor.h | 6 +++++-
llvm/include/llvm/Support/DebugCounter.h | 7 ++++++-
.../include/llvm/Support/ELFAttributeParser.h | 6 ++++--
llvm/include/llvm/Support/Error.h | 3 ++-
.../include/llvm/Support/ExponentialBackoff.h | 3 +--
llvm/include/llvm/Support/FileCollector.h | 8 +++++++
llvm/include/llvm/Support/FileOutputBuffer.h | 5 ++++-
llvm/include/llvm/Support/FileUtilities.h | 6 ++++--
llvm/include/llvm/Support/FormatVariadic.h | 1 -
.../llvm/Support/FormatVariadicDetails.h | 1 -
llvm/include/llvm/Support/FormattedStream.h | 3 +++
llvm/include/llvm/Support/GlobPattern.h | 1 +
llvm/include/llvm/Support/GraphWriter.h | 1 +
.../llvm/Support/HexagonAttributeParser.h | 5 +++++
llvm/include/llvm/Support/InstructionCost.h | 1 +
llvm/include/llvm/Support/JSON.h | 21 +++++++++++++++++++
llvm/include/llvm/Support/KnownBits.h | 3 +++
llvm/include/llvm/Support/LEB128.h | 2 ++
llvm/include/llvm/Support/LineIterator.h | 3 ++-
llvm/include/llvm/Support/LockFileManager.h | 3 ++-
llvm/include/llvm/Support/MD5.h | 3 +++
.../llvm/Support/MSP430AttributeParser.h | 5 +++++
llvm/include/llvm/Support/MathExtras.h | 1 -
llvm/include/llvm/Support/Memory.h | 2 +-
llvm/include/llvm/Support/MemoryBuffer.h | 1 +
llvm/include/llvm/Support/MemoryBufferRef.h | 1 +
llvm/include/llvm/Support/NativeFormatting.h | 1 +
.../llvm/Support/OptimizedStructLayout.h | 4 +++-
llvm/include/llvm/Support/PGOOptions.h | 2 +-
llvm/include/llvm/Support/Parallel.h | 10 ++++++++-
llvm/include/llvm/Support/Path.h | 6 +++++-
llvm/include/llvm/Support/PrettyStackTrace.h | 1 -
llvm/include/llvm/Support/Process.h | 5 ++++-
llvm/include/llvm/Support/Program.h | 9 +++++++-
.../llvm/Support/RISCVAttributeParser.h | 5 +++++
.../llvm/Support/RandomNumberGenerator.h | 3 +--
llvm/include/llvm/Support/ScaledNumber.h | 3 +++
llvm/include/llvm/Support/ScopedPrinter.h | 6 +++++-
llvm/include/llvm/Support/SourceMgr.h | 11 ++++++++++
llvm/include/llvm/Support/SpecialCaseList.h | 4 +++-
llvm/include/llvm/Support/StringSaver.h | 1 +
llvm/include/llvm/Support/SuffixTree.h | 2 ++
llvm/include/llvm/Support/TarWriter.h | 2 ++
llvm/include/llvm/Support/ThreadPool.h | 10 ++++-----
llvm/include/llvm/Support/Threading.h | 5 +++--
llvm/include/llvm/Support/TimeProfiler.h | 2 ++
llvm/include/llvm/Support/Timer.h | 3 ++-
llvm/include/llvm/Support/ToolOutputFile.h | 8 +++++++
llvm/include/llvm/Support/TypeSize.h | 3 +--
llvm/include/llvm/Support/Unicode.h | 3 +++
llvm/include/llvm/Support/VersionTuple.h | 1 +
llvm/include/llvm/Support/VirtualFileSystem.h | 14 ++++++++-----
llvm/include/llvm/Support/Watchdog.h | 2 --
llvm/include/llvm/Support/WithColor.h | 2 +-
llvm/include/llvm/Support/YAMLParser.h | 1 +
llvm/include/llvm/Support/YAMLTraits.h | 12 +++++++++++
.../llvm/Support/circular_raw_ostream.h | 2 ++
llvm/include/llvm/Support/raw_os_ostream.h | 2 ++
llvm/include/llvm/Support/raw_ostream.h | 8 ++++++-
llvm/include/llvm/Support/raw_socket_stream.h | 6 +++++-
llvm/include/llvm/Support/xxhash.h | 1 +
.../DWARF/DWARFLocationExpression.cpp | 1 +
llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp | 2 ++
llvm/lib/FileCheck/FileCheck.cpp | 3 ++-
llvm/lib/Support/AMDGPUMetadata.cpp | 2 ++
llvm/lib/Support/APFixedPoint.cpp | 4 +++-
llvm/lib/Support/APFloat.cpp | 8 +++++--
llvm/lib/Support/APInt.cpp | 6 +++++-
llvm/lib/Support/APSInt.cpp | 1 +
llvm/lib/Support/ARMAttributeParser.cpp | 11 ++++++++++
llvm/lib/Support/ARMBuildAttrs.cpp | 5 +----
llvm/lib/Support/BalancedPartitioning.cpp | 9 ++++++++
llvm/lib/Support/Base64.cpp | 2 ++
llvm/lib/Support/BinaryStreamReader.cpp | 10 ++++++++-
llvm/lib/Support/BinaryStreamRef.cpp | 4 ++++
llvm/lib/Support/BinaryStreamWriter.cpp | 9 +++++++-
llvm/lib/Support/BranchProbability.cpp | 2 +-
llvm/lib/Support/BuryPointer.cpp | 1 +
llvm/lib/Support/CRC.cpp | 5 +++--
llvm/lib/Support/CSKYAttributeParser.cpp | 5 +++++
llvm/lib/Support/CachePruning.cpp | 17 ++++++++++++---
llvm/lib/Support/Caching.cpp | 5 ++++-
llvm/lib/Support/Chrono.cpp | 1 +
llvm/lib/Support/CodeGenCoverage.cpp | 8 ++++++-
llvm/lib/Support/CommandLine.cpp | 15 +++++++++++--
llvm/lib/Support/Compression.cpp | 4 +++-
llvm/lib/Support/ConvertEBCDIC.cpp | 3 +++
llvm/lib/Support/ConvertUTFWrapper.cpp | 6 +++++-
llvm/lib/Support/CrashRecoveryContext.cpp | 4 ++++
llvm/lib/Support/DAGDeltaAlgorithm.cpp | 2 +-
llvm/lib/Support/DJB.cpp | 4 +++-
llvm/lib/Support/DataExtractor.cpp | 4 ++++
llvm/lib/Support/Debug.cpp | 6 ++++--
llvm/lib/Support/DebugCounter.cpp | 8 +++++--
llvm/lib/Support/DivisionByConstantInfo.cpp | 2 ++
llvm/lib/Support/DynamicAPInt.cpp | 1 +
llvm/lib/Support/DynamicLibrary.cpp | 6 ++++++
llvm/lib/Support/ELFAttributeParser.cpp | 6 ++++++
llvm/lib/Support/ELFAttributes.cpp | 1 +
llvm/lib/Support/Error.cpp | 1 +
llvm/lib/Support/ErrorHandling.cpp | 10 +++++----
llvm/lib/Support/ExponentialBackoff.cpp | 1 +
llvm/lib/Support/FileCollector.cpp | 6 ++++++
llvm/lib/Support/FileOutputBuffer.cpp | 5 ++++-
llvm/lib/Support/FloatingPointMode.cpp | 2 ++
llvm/lib/Support/FoldingSet.cpp | 6 +++++-
llvm/lib/Support/FormatVariadic.cpp | 2 ++
llvm/lib/Support/FormattedStream.cpp | 2 ++
llvm/lib/Support/GlobPattern.cpp | 6 ++++++
llvm/lib/Support/GraphWriter.cpp | 7 +++----
llvm/lib/Support/InitLLVM.cpp | 3 ---
llvm/lib/Support/JSON.cpp | 4 ++++
llvm/lib/Support/KnownBits.cpp | 4 ++++
llvm/lib/Support/LineIterator.cpp | 2 ++
llvm/lib/Support/LockFileManager.cpp | 5 +----
llvm/lib/Support/MD5.cpp | 4 ++++
llvm/lib/Support/MSP430AttributeParser.cpp | 1 -
llvm/lib/Support/ManagedStatic.cpp | 2 +-
llvm/lib/Support/MemoryBuffer.cpp | 4 +++-
llvm/lib/Support/NativeFormatting.cpp | 9 ++++++--
llvm/lib/Support/OptimizedStructLayout.cpp | 6 ++++++
llvm/lib/Support/PGOOptions.cpp | 2 ++
llvm/lib/Support/Parallel.cpp | 4 +++-
llvm/lib/Support/Path.cpp | 15 ++++++++++++-
llvm/lib/Support/PluginLoader.cpp | 2 ++
llvm/lib/Support/Process.cpp | 8 +++++--
llvm/lib/Support/Program.cpp | 3 +++
llvm/lib/Support/RISCVAttributeParser.cpp | 3 +++
llvm/lib/Support/RISCVISAUtils.cpp | 1 +
llvm/lib/Support/RandomNumberGenerator.cpp | 8 ++++---
llvm/lib/Support/SHA1.cpp | 3 +++
llvm/lib/Support/SHA256.cpp | 3 +++
llvm/lib/Support/ScaledNumber.cpp | 3 +++
llvm/lib/Support/ScopedPrinter.cpp | 4 +++-
llvm/lib/Support/Signals.cpp | 15 ++++++++++---
llvm/lib/Support/SipHash.cpp | 1 +
llvm/lib/Support/SlowDynamicAPInt.cpp | 4 ++++
llvm/lib/Support/SmallPtrSet.cpp | 1 +
llvm/lib/Support/SmallVector.cpp | 2 ++
llvm/lib/Support/SourceMgr.cpp | 1 +
llvm/lib/Support/SpecialCaseList.cpp | 8 +++++++
llvm/lib/Support/Statistic.cpp | 11 ++++++----
llvm/lib/Support/StringExtras.cpp | 1 +
llvm/lib/Support/StringMap.cpp | 2 ++
llvm/lib/Support/StringRef.cpp | 4 ++++
llvm/lib/Support/StringSaver.cpp | 3 ++-
llvm/lib/Support/SuffixTree.cpp | 6 ++++++
llvm/lib/Support/SuffixTreeNode.cpp | 2 +-
llvm/lib/Support/TarWriter.cpp | 6 ++++++
llvm/lib/Support/ThreadPool.cpp | 7 +++++--
llvm/lib/Support/Threading.cpp | 6 +-----
llvm/lib/Support/TimeProfiler.cpp | 10 +++++++++
llvm/lib/Support/Timer.cpp | 12 +++++++++--
llvm/lib/Support/Twine.cpp | 2 +-
llvm/lib/Support/TypeSize.cpp | 5 +++--
llvm/lib/Support/Unicode.cpp | 2 ++
llvm/lib/Support/UnicodeNameToCodepoint.cpp | 13 ++++++++++++
.../UnicodeNameToCodepointGenerated.cpp | 2 +-
llvm/lib/Support/Unix/Process.inc | 2 +-
llvm/lib/Support/Unix/Unix.h | 2 +-
llvm/lib/Support/VirtualFileSystem.cpp | 8 +++----
llvm/lib/Support/WithColor.cpp | 4 ++--
llvm/lib/Support/YAMLParser.cpp | 4 ++++
llvm/lib/Support/YAMLTraits.cpp | 3 ++-
llvm/lib/Support/Z3Solver.cpp | 9 +++++---
llvm/lib/Support/circular_raw_ostream.cpp | 2 ++
llvm/lib/Support/raw_ostream.cpp | 8 ++++++-
llvm/lib/Support/raw_socket_stream.cpp | 6 ++++--
llvm/lib/Support/xxhash.cpp | 3 ++-
llvm/tools/llvm-objdump/MachODump.cpp | 1 +
llvm/tools/llvm-rc/llvm-rc.cpp | 1 +
llvm/tools/llvm-xray/xray-account.cpp | 1 +
llvm/tools/llvm-xray/xray-graph-diff.cpp | 1 +
llvm/tools/llvm-xray/xray-graph.cpp | 1 +
llvm/unittests/Support/ThreadPool.cpp | 1 +
llvm/unittests/TargetParser/Host.cpp | 1 +
llvm/utils/FileCheck/FileCheck.cpp | 1 +
.../mlir/Analysis/Presburger/Fraction.h | 1 +
221 files changed, 800 insertions(+), 172 deletions(-)
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
+++ b/llvm/include/llvm/Support/CachePruning.h
@@ -14,14 +14,17 @@
#ifndef LLVM_SUPPORT_CACHEPRUNING_H
#define LLVM_SUPPORT_CACHEPRUNING_H
-#include "llvm/Support/MemoryBuffer.h"
#include <chrono>
+#include <memory>
#include <optional>
+#include <stdint.h>
+#include <vector>
namespace llvm {
template <typename T> class Expected;
class StringRef;
+class MemoryBuffer;
/// Policy for the pruneCache() function. A default constructed
/// CachePruningPolicy provides a reasonable default policy.
diff --git a/llvm/include/llvm/Support/Caching.h b/llvm/include/llvm/Support/Caching.h
index 4fa57cc92e51f7..7876c3ef472269 100644
--- a/llvm/include/llvm/Support/Caching.h
+++ b/llvm/include/llvm/Support/Caching.h
@@ -15,7 +15,15 @@
#ifndef LLVM_SUPPORT_CACHING_H
#define LLVM_SUPPORT_CACHING_H
+#include "llvm/ADT/StringRef.h"
+#include "llvm/ADT/Twine.h"
#include "llvm/Support/Error.h"
+#include "llvm/Support/raw_ostream.h"
+#include <functional>
+#include <memory>
+#include <stddef.h>
+#include <string>
+#include <utility>
namespace llvm {
diff --git a/llvm/include/llvm/Support/Chrono.h b/llvm/include/llvm/Support/Chrono.h
index 71859af7c7e4a5..31fb04f4062439 100644
--- a/llvm/include/llvm/Support/Chrono.h
+++ b/llvm/include/llvm/Support/Chrono.h
@@ -9,17 +9,20 @@
#ifndef LLVM_SUPPORT_CHRONO_H
#define LLVM_SUPPORT_CHRONO_H
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/FormatProviders.h"
-
+#include "llvm/ADT/StringRef.h"
+#include "llvm/Support/FormatVariadicDetails.h"
+#include "llvm/Support/raw_ostream.h"
+#include <assert.h>
#include <chrono>
#include <ctime>
#include <ratio>
+#include <stdint.h>
+#include <tuple>
+#include <type_traits>
+#include <utility>
namespace llvm {
-class raw_ostream;
-
namespace sys {
/// A time point on the system clock. This is provided for two reasons:
diff --git a/llvm/include/llvm/Support/CodeGenCoverage.h b/llvm/include/llvm/Support/CodeGenCoverage.h
index 2acdd6a36a514c..df81824325ef67 100644
--- a/llvm/include/llvm/Support/CodeGenCoverage.h
+++ b/llvm/include/llvm/Support/CodeGenCoverage.h
@@ -12,6 +12,9 @@
#define LLVM_SUPPORT_CODEGENCOVERAGE_H
#include "llvm/ADT/BitVector.h"
+#include "llvm/ADT/StringRef.h"
+#include "llvm/ADT/iterator_range.h"
+#include <stdint.h>
namespace llvm {
class MemoryBuffer;
diff --git a/llvm/include/llvm/Support/CommandLine.h b/llvm/include/llvm/Support/CommandLine.h
index 5d60bb64bbb205..ad96cb11b9bc98 100644
--- a/llvm/include/llvm/Support/CommandLine.h
+++ b/llvm/include/llvm/Support/CommandLine.h
@@ -20,22 +20,24 @@
#define LLVM_SUPPORT_COMMANDLINE_H
#include "llvm/ADT/ArrayRef.h"
-#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/Twine.h"
#include "llvm/ADT/iterator_range.h"
+#include "llvm/Support/Allocator.h"
+#include "llvm/Support/Error.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/StringSaver.h"
#include "llvm/Support/raw_ostream.h"
#include <cassert>
-#include <climits>
#include <cstddef>
#include <functional>
#include <initializer_list>
+#include <stdint.h>
#include <string>
+#include <tuple>
#include <type_traits>
#include <vector>
@@ -45,8 +47,6 @@ namespace vfs {
class FileSystem;
}
-class StringSaver;
-
/// This namespace contains all of the command line option processing machinery.
/// It is intentionally a short name to make qualified usage concise.
namespace cl {
diff --git a/llvm/include/llvm/Support/Compression.h b/llvm/include/llvm/Support/Compression.h
index 2a8da9e96d356f..b4294b06e8c679 100644
--- a/llvm/include/llvm/Support/Compression.h
+++ b/llvm/include/llvm/Support/Compression.h
@@ -13,10 +13,12 @@
#ifndef LLVM_SUPPORT_COMPRESSION_H
#define LLVM_SUPPORT_COMPRESSION_H
-#include "llvm/ADT/ArrayRef.h"
-#include "llvm/Support/DataTypes.h"
+#include "llvm/Support/ErrorHandling.h"
+#include <stddef.h>
+#include <stdint.h>
namespace llvm {
+template <typename T> class ArrayRef;
template <typename T> class SmallVectorImpl;
class Error;
diff --git a/llvm/include/llvm/Support/ConvertEBCDIC.h b/llvm/include/llvm/Support/ConvertEBCDIC.h
index ea761b31e022b7..218ce6e460f934 100644
--- a/llvm/include/llvm/Support/ConvertEBCDIC.h
+++ b/llvm/include/llvm/Support/ConvertEBCDIC.h
@@ -13,11 +13,12 @@
///
//===----------------------------------------------------------------------===//
-#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include <system_error>
namespace llvm {
+template <typename T> class SmallVectorImpl;
+
namespace ConverterEBCDIC {
std::error_code convertToEBCDIC(StringRef Source,
SmallVectorImpl<char> &Result);
diff --git a/llvm/include/llvm/Support/DJB.h b/llvm/include/llvm/Support/DJB.h
index 8a04a324a5dc6c..dd97816be977ca 100644
--- a/llvm/include/llvm/Support/DJB.h
+++ b/llvm/include/llvm/Support/DJB.h
@@ -14,6 +14,7 @@
#define LLVM_SUPPORT_DJB_H
#include "llvm/ADT/StringRef.h"
+#include <stdint.h>
namespace llvm {
diff --git a/llvm/include/llvm/Support/DataExtractor.h b/llvm/include/llvm/Support/DataExtractor.h
index f4f5905d4bccd6..8e2aa21909c730 100644
--- a/llvm/include/llvm/Support/DataExtractor.h
+++ b/llvm/include/llvm/Support/DataExtractor.h
@@ -9,9 +9,13 @@
#ifndef LLVM_SUPPORT_DATAEXTRACTOR_H
#define LLVM_SUPPORT_DATAEXTRACTOR_H
+#include "llvm/ADT/ArrayRef.h"
+#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
-#include "llvm/Support/DataTypes.h"
#include "llvm/Support/Error.h"
+#include <stddef.h>
+#include <stdint.h>
+#include <utility>
namespace llvm {
diff --git a/llvm/include/llvm/Support/DebugCounter.h b/llvm/include/llvm/Support/DebugCounter.h
index e4345e5739e99d..9e45be181f8819 100644
--- a/llvm/include/llvm/Support/DebugCounter.h
+++ b/llvm/include/llvm/Support/DebugCounter.h
@@ -42,16 +42,21 @@
#ifndef LLVM_SUPPORT_DEBUGCOUNTER_H
#define LLVM_SUPPORT_DEBUGCOUNTER_H
-#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/DenseMap.h"
+#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/UniqueVector.h"
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/Debug.h"
+#include <assert.h>
+#include <stdint.h>
#include <string>
+#include <utility>
namespace llvm {
class raw_ostream;
+template <typename T> class ArrayRef;
class DebugCounter {
public:
diff --git a/llvm/include/llvm/Support/ELFAttributeParser.h b/llvm/include/llvm/Support/ELFAttributeParser.h
index ffb92468fb37eb..b8f09d4a67985c 100644
--- a/llvm/include/llvm/Support/ELFAttributeParser.h
+++ b/llvm/include/llvm/Support/ELFAttributeParser.h
@@ -11,15 +11,17 @@
#include "ELFAttributes.h"
#include "llvm/ADT/ArrayRef.h"
+#include "llvm/ADT/StringRef.h"
#include "llvm/Support/DataExtractor.h"
#include "llvm/Support/Error.h"
-
#include <optional>
+#include <stdint.h>
#include <unordered_map>
namespace llvm {
-class StringRef;
class ScopedPrinter;
+enum class endianness;
+template <typename T> class SmallVectorImpl;
class ELFAttributeParser {
StringRef vendor;
diff --git a/llvm/include/llvm/Support/Error.h b/llvm/include/llvm/Support/Error.h
index cb06ac19f0bb7d..e0b90a3175bced 100644
--- a/llvm/include/llvm/Support/Error.h
+++ b/llvm/include/llvm/Support/Error.h
@@ -14,6 +14,7 @@
#define LLVM_SUPPORT_ERROR_H
#include "llvm-c/Error.h"
+#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/Twine.h"
#include "llvm/Config/abi-breaking.h"
#include "llvm/Support/AlignOf.h"
@@ -24,8 +25,8 @@
#include "llvm/Support/Format.h"
#include "llvm/Support/raw_ostream.h"
#include <cassert>
-#include <cstdint>
#include <cstdlib>
+#include <errno.h>
#include <functional>
#include <memory>
#include <new>
diff --git a/llvm/include/llvm/Support/ExponentialBackoff.h b/llvm/include/llvm/Support/ExponentialBackoff.h
index 8208a748eac2a6..1a4f4fc95f46f1 100644
--- a/llvm/include/llvm/Support/ExponentialBackoff.h
+++ b/llvm/include/llvm/Support/ExponentialBackoff.h
@@ -12,10 +12,9 @@
#ifndef LLVM_EXPONENTIALBACKOFF_H
#define LLVM_EXPONENTIALBACKOFF_H
-#include "llvm/ADT/STLExtras.h"
-#include "llvm/Support/Error.h"
#include <chrono>
#include <random>
+#include <stdint.h>
namespace llvm {
diff --git a/llvm/include/llvm/Support/FileCollector.h b/llvm/include/llvm/Support/FileCollector.h
index 232dc8658aa382..8e5bf106e04a95 100644
--- a/llvm/include/llvm/Support/FileCollector.h
+++ b/llvm/include/llvm/Support/FileCollector.h
@@ -9,15 +9,23 @@
#ifndef LLVM_SUPPORT_FILECOLLECTOR_H
#define LLVM_SUPPORT_FILECOLLECTOR_H
+#include "llvm/ADT/IntrusiveRefCntPtr.h"
+#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringMap.h"
+#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/StringSet.h"
+#include "llvm/Support/FileSystem.h"
#include "llvm/Support/VirtualFileSystem.h"
+#include <memory>
#include <mutex>
#include <string>
+#include <system_error>
+#include <utility>
namespace llvm {
class FileCollectorFileSystem;
class Twine;
+template <typename T> class SmallVectorImpl;
class FileCollectorBase {
public:
diff --git a/llvm/include/llvm/Support/FileOutputBuffer.h b/llvm/include/llvm/Support/FileOutputBuffer.h
index d4b73522115dbf..07f03115e8daa3 100644
--- a/llvm/include/llvm/Support/FileOutputBuffer.h
+++ b/llvm/include/llvm/Support/FileOutputBuffer.h
@@ -14,8 +14,11 @@
#define LLVM_SUPPORT_FILEOUTPUTBUFFER_H
#include "llvm/ADT/StringRef.h"
-#include "llvm/Support/DataTypes.h"
#include "llvm/Support/Error.h"
+#include <memory>
+#include <stddef.h>
+#include <stdint.h>
+#include <string>
namespace llvm {
/// FileOutputBuffer - This interface provides simple way to create an in-memory
diff --git a/llvm/include/llvm/Support/FileUtilities.h b/llvm/include/llvm/Support/FileUtilities.h
index 9707724d631708..04b761aac1844e 100644
--- a/llvm/include/llvm/Support/FileUtilities.h
+++ b/llvm/include/llvm/Support/FileUtilities.h
@@ -14,11 +14,13 @@
#ifndef LLVM_SUPPORT_FILEUTILITIES_H
#define LLVM_SUPPORT_FILEUTILITIES_H
+#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringRef.h"
+#include "llvm/ADT/Twine.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/FileSystem.h"
-
-#include <system_error>
+#include <optional>
+#include <string>
namespace llvm {
diff --git a/llvm/include/llvm/Support/FormatVariadic.h b/llvm/include/llvm/Support/FormatVariadic.h
index 595f2cf559a428..65dbcad430300d 100644
--- a/llvm/include/llvm/Support/FormatVariadic.h
+++ b/llvm/include/llvm/Support/FormatVariadic.h
@@ -26,7 +26,6 @@
#define LLVM_SUPPORT_FORMATVARIADIC_H
#include "llvm/ADT/ArrayRef.h"
-#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
diff --git a/llvm/include/llvm/Support/FormatVariadicDetails.h b/llvm/include/llvm/Support/FormatVariadicDetails.h
index a221fcadbd3c74..60d4221540dd61 100644
--- a/llvm/include/llvm/Support/FormatVariadicDetails.h
+++ b/llvm/include/llvm/Support/FormatVariadicDetails.h
@@ -10,7 +10,6 @@
#define LLVM_SUPPORT_FORMATVARIADICDETAILS_H
#include "llvm/ADT/StringRef.h"
-#include "llvm/ADT/STLExtras.h"
#include "llvm/Support/raw_ostream.h"
#include <type_traits>
diff --git a/llvm/include/llvm/Support/FormattedStream.h b/llvm/include/llvm/Support/FormattedStream.h
index 850a18dbb94121..d98ad4b744f984 100644
--- a/llvm/include/llvm/Support/FormattedStream.h
+++ b/llvm/include/llvm/Support/FormattedStream.h
@@ -16,6 +16,9 @@
#include "llvm/ADT/SmallString.h"
#include "llvm/Support/raw_ostream.h"
+#include <assert.h>
+#include <stddef.h>
+#include <stdint.h>
#include <utility>
namespace llvm {
diff --git a/llvm/include/llvm/Support/GlobPattern.h b/llvm/include/llvm/Support/GlobPattern.h
index 1a722e65bed802..be430ff1236131 100644
--- a/llvm/include/llvm/Support/GlobPattern.h
+++ b/llvm/include/llvm/Support/GlobPattern.h
@@ -18,6 +18,7 @@
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Error.h"
#include <optional>
+#include <stddef.h>
namespace llvm {
diff --git a/llvm/include/llvm/Support/GraphWriter.h b/llvm/include/llvm/Support/GraphWriter.h
index 359b608626dffa..0bb2e8633d904a 100644
--- a/llvm/include/llvm/Support/GraphWriter.h
+++ b/llvm/include/llvm/Support/GraphWriter.h
@@ -30,6 +30,7 @@
#include "llvm/Support/raw_ostream.h"
#include <iterator>
#include <string>
+#include <system_error>
#include <type_traits>
#include <vector>
diff --git a/llvm/include/llvm/Support/HexagonAttributeParser.h b/llvm/include/llvm/Support/HexagonAttributeParser.h
index 1116dd42b1ad01..ecfc93b82739c4 100644
--- a/llvm/include/llvm/Support/HexagonAttributeParser.h
+++ b/llvm/include/llvm/Support/HexagonAttributeParser.h
@@ -9,10 +9,15 @@
#ifndef LLVM_SUPPORT_HEXAGONATTRIBUTEPARSER_H
#define LLVM_SUPPORT_HEXAGONATTRIBUTEPARSER_H
+#include "llvm/ADT/StringRef.h"
#include "llvm/Support/ELFAttributeParser.h"
+#include "llvm/Support/Error.h"
#include "llvm/Support/HexagonAttributes.h"
+#include <stdint.h>
namespace llvm {
+class ScopedPrinter;
+
class HexagonAttributeParser : public ELFAttributeParser {
struct DisplayHandler {
HexagonAttrs::AttrType Attribute;
diff --git a/llvm/include/llvm/Support/InstructionCost.h b/llvm/include/llvm/Support/InstructionCost.h
index ada0b8962881d3..ee027c5f0ba88d 100644
--- a/llvm/include/llvm/Support/InstructionCost.h
+++ b/llvm/include/llvm/Support/InstructionCost.h
@@ -21,6 +21,7 @@
#include "llvm/Support/MathExtras.h"
#include <limits>
#include <optional>
+#include <stdint.h>
namespace llvm {
diff --git a/llvm/include/llvm/Support/JSON.h b/llvm/include/llvm/Support/JSON.h
index 14a5c7142ed8ce..65b3fc3e7ba8b3 100644
--- a/llvm/include/llvm/Support/JSON.h
+++ b/llvm/include/llvm/Support/JSON.h
@@ -50,15 +50,34 @@
#include "llvm/ADT/STLFunctionalExtras.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
+#include "llvm/Support/AlignOf.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/Error.h"
+#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/FormatVariadic.h"
#include "llvm/Support/raw_ostream.h"
+#include <assert.h>
#include <cmath>
+#include <cstddef>
+#include <initializer_list>
+#include <limits>
#include <map>
+#include <memory>
+#include <new>
+#include <optional>
+#include <stdint.h>
+#include <string>
+#include <system_error>
+#include <type_traits>
+#include <utility>
+#include <vector>
namespace llvm {
namespace json {
+class Array;
+class Object;
+class ObjectKey;
+class Value;
// === String encodings ===
//
@@ -91,6 +110,7 @@ std::string fixUTF8(llvm::StringRef S);
class Array;
class ObjectKey;
class Value;
+
template <typename T> Value toJSON(const std::optional<T> &Opt);
/// An Object is a JSON object, which maps strings to heterogenous JSON values.
@@ -110,6 +130,7 @@ class Object {
// KV is a trivial key-value struct for list-initialization.
// (using std::pair forces extra copies).
struct KV;
+
explicit Object(std::initializer_list<KV> Properties);
iterator begin() { return M.begin(); }
diff --git a/llvm/include/llvm/Support/KnownBits.h b/llvm/include/llvm/Support/KnownBits.h
index 7ed3d525bd8fbf..489c8026018675 100644
--- a/llvm/include/llvm/Support/KnownBits.h
+++ b/llvm/include/llvm/Support/KnownBits.h
@@ -15,9 +15,12 @@
#define LLVM_SUPPORT_KNOWNBITS_H
#include "llvm/ADT/APInt.h"
+#include <assert.h>
#include <optional>
+#include <utility>
namespace llvm {
+class raw_ostream;
// Struct for tracking the known zeros and ones of a value.
struct KnownBits {
diff --git a/llvm/include/llvm/Support/LEB128.h b/llvm/include/llvm/Support/LEB128.h
index a15b73bc14dcde..63533164f13bab 100644
--- a/llvm/include/llvm/Support/LEB128.h
+++ b/llvm/include/llvm/Support/LEB128.h
@@ -14,7 +14,9 @@
#ifndef LLVM_SUPPORT_LEB128_H
#define LLVM_SUPPORT_LEB128_H
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/raw_ostream.h"
+#include <stdint.h>
namespace llvm {
diff --git a/llvm/include/llvm/Support/LineIterator.h b/llvm/include/llvm/Support/LineIterator.h
index fc6871baf99a65..0f910c69cfab6d 100644
--- a/llvm/include/llvm/Support/LineIterator.h
+++ b/llvm/include/llvm/Support/LineIterator.h
@@ -10,10 +10,11 @@
#define LLVM_SUPPORT_LINEITERATOR_H
#include "llvm/ADT/StringRef.h"
-#include "llvm/Support/DataTypes.h"
#include "llvm/Support/MemoryBufferRef.h"
+#include <cstddef>
#include <iterator>
#include <optional>
+#include <stdint.h>
namespace llvm {
diff --git a/llvm/include/llvm/Support/LockFileManager.h b/llvm/include/llvm/Support/LockFileManager.h
index 92c7ceed6a929f..50d38f8ed3e356 100644
--- a/llvm/include/llvm/Support/LockFileManager.h
+++ b/llvm/include/llvm/Support/LockFileManager.h
@@ -9,12 +9,13 @@
#define LLVM_SUPPORT_LOCKFILEMANAGER_H
#include "llvm/ADT/SmallString.h"
+#include "llvm/ADT/StringRef.h"
#include <optional>
+#include <string>
#include <system_error>
#include <utility> // for std::pair
namespace llvm {
-class StringRef;
/// Class that manages the creation of a lock file to aid
/// implicit coordination between different processes.
diff --git a/llvm/include/llvm/Support/MD5.h b/llvm/include/llvm/Support/MD5.h
index 0e9f22d3bfdb46..d1327c93ee8036 100644
--- a/llvm/include/llvm/Support/MD5.h
+++ b/llvm/include/llvm/Support/MD5.h
@@ -29,14 +29,17 @@
#define LLVM_SUPPORT_MD5_H
#include "llvm/ADT/StringRef.h"
+#include "llvm/ADT/bit.h"
#include "llvm/Support/Endian.h"
#include <array>
#include <cstdint>
+#include <utility>
namespace llvm {
template <unsigned N> class SmallString;
template <typename T> class ArrayRef;
+template <typename T> class SmallVectorImpl;
class MD5 {
public:
diff --git a/llvm/include/llvm/Support/MSP430AttributeParser.h b/llvm/include/llvm/Support/MSP430AttributeParser.h
index bc9b214944708f..57186a6286d79d 100644
--- a/llvm/include/llvm/Support/MSP430AttributeParser.h
+++ b/llvm/include/llvm/Support/MSP430AttributeParser.h
@@ -15,9 +15,14 @@
#define LLVM_SUPPORT_MSP430ATTRIBUTEPARSER_H
#include "llvm/Support/ELFAttributeParser.h"
+#include "llvm/Support/Error.h"
#include "llvm/Support/MSP430Attributes.h"
+#include <array>
+#include <stdint.h>
namespace llvm {
+class ScopedPrinter;
+
class MSP430AttributeParser : public ELFAttributeParser {
struct DisplayHandler {
MSP430Attrs::AttrType Attribute;
diff --git a/llvm/include/llvm/Support/MathExtras.h b/llvm/include/llvm/Support/MathExtras.h
index e568e42afcf4d2..9d67d356e0718e 100644
--- a/llvm/include/llvm/Support/MathExtras.h
+++ b/llvm/include/llvm/Support/MathExtras.h
@@ -14,7 +14,6 @@
#define LLVM_SUPPORT_MATHEXTRAS_H
#include "llvm/ADT/bit.h"
-#include "llvm/Support/Compiler.h"
#include <cassert>
#include <climits>
#include <cstdint>
diff --git a/llvm/include/llvm/Support/Memory.h b/llvm/include/llvm/Support/Memory.h
index d7d60371d315f0..33cd02d7fdeaed 100644
--- a/llvm/include/llvm/Support/Memory.h
+++ b/llvm/include/llvm/Support/Memory.h
@@ -13,7 +13,7 @@
#ifndef LLVM_SUPPORT_MEMORY_H
#define LLVM_SUPPORT_MEMORY_H
-#include "llvm/Support/DataTypes.h"
+#include <stddef.h>
#include <system_error>
namespace llvm {
diff --git a/llvm/include/llvm/Support/MemoryBuffer.h b/llvm/include/llvm/Support/MemoryBuffer.h
index b3477f1db0e9a6..ebd076f2e8a8f4 100644
--- a/llvm/include/llvm/Support/MemoryBuffer.h
+++ b/llvm/include/llvm/Support/MemoryBuffer.h
@@ -24,6 +24,7 @@
#include <cstddef>
#include <cstdint>
#include <memory>
+#include <optional>
namespace llvm {
namespace sys {
diff --git a/llvm/include/llvm/Support/MemoryBufferRef.h b/llvm/include/llvm/Support/MemoryBufferRef.h
index b38a1f3b65651a..72c15715442052 100644
--- a/llvm/include/llvm/Support/MemoryBufferRef.h
+++ b/llvm/include/llvm/Support/MemoryBufferRef.h
@@ -14,6 +14,7 @@
#define LLVM_SUPPORT_MEMORYBUFFERREF_H
#include "llvm/ADT/StringRef.h"
+#include <stddef.h>
namespace llvm {
diff --git a/llvm/include/llvm/Support/NativeFormatting.h b/llvm/include/llvm/Support/NativeFormatting.h
index ab85ae20161c20..2b369aec8c719d 100644
--- a/llvm/include/llvm/Support/NativeFormatting.h
+++ b/llvm/include/llvm/Support/NativeFormatting.h
@@ -11,6 +11,7 @@
#include <cstdint>
#include <optional>
+#include <stddef.h>
namespace llvm {
class raw_ostream;
diff --git a/llvm/include/llvm/Support/OptimizedStructLayout.h b/llvm/include/llvm/Support/OptimizedStructLayout.h
index 619990d132beba..11eaad346f6b3a 100644
--- a/llvm/include/llvm/Support/OptimizedStructLayout.h
+++ b/llvm/include/llvm/Support/OptimizedStructLayout.h
@@ -35,8 +35,10 @@
#ifndef LLVM_SUPPORT_OPTIMIZEDSTRUCTLAYOUT_H
#define LLVM_SUPPORT_OPTIMIZEDSTRUCTLAYOUT_H
-#include "llvm/Support/Alignment.h"
#include "llvm/ADT/ArrayRef.h"
+#include "llvm/Support/Alignment.h"
+#include <assert.h>
+#include <stdint.h>
#include <utility>
namespace llvm {
diff --git a/llvm/include/llvm/Support/PGOOptions.h b/llvm/include/llvm/Support/PGOOptions.h
index de981abf187058..981b5057ec5f67 100644
--- a/llvm/include/llvm/Support/PGOOptions.h
+++ b/llvm/include/llvm/Support/PGOOptions.h
@@ -15,7 +15,7 @@
#define LLVM_SUPPORT_PGOOPTIONS_H
#include "llvm/ADT/IntrusiveRefCntPtr.h"
-#include "llvm/Support/Error.h"
+#include <string>
namespace llvm {
diff --git a/llvm/include/llvm/Support/Parallel.h b/llvm/include/llvm/Support/Parallel.h
index 8170da98f15a8c..7e3ac48ab6fa0e 100644
--- a/llvm/include/llvm/Support/Parallel.h
+++ b/llvm/include/llvm/Support/Parallel.h
@@ -9,18 +9,26 @@
#ifndef LLVM_SUPPORT_PARALLEL_H
#define LLVM_SUPPORT_PARALLEL_H
+#include "llvm-c/Error.h"
+#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/Config/llvm-config.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/Threading.h"
-
#include <algorithm>
+#include <assert.h>
#include <condition_variable>
#include <functional>
+#include <iterator>
+#include <limits.h>
#include <mutex>
+#include <stddef.h>
+#include <stdint.h>
+#include <vector>
namespace llvm {
+template <typename Fn> class function_ref;
namespace parallel {
diff --git a/llvm/include/llvm/Support/Path.h b/llvm/include/llvm/Support/Path.h
index ce69f32b6cc81b..f77271256deb67 100644
--- a/llvm/include/llvm/Support/Path.h
+++ b/llvm/include/llvm/Support/Path.h
@@ -15,12 +15,16 @@
#ifndef LLVM_SUPPORT_PATH_H
#define LLVM_SUPPORT_PATH_H
+#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/Twine.h"
#include "llvm/ADT/iterator.h"
-#include "llvm/Support/DataTypes.h"
#include <iterator>
+#include <stddef.h>
+#include <string>
namespace llvm {
+template <typename T> class SmallVectorImpl;
+
namespace sys {
namespace path {
diff --git a/llvm/include/llvm/Support/PrettyStackTrace.h b/llvm/include/llvm/Support/PrettyStackTrace.h
index ac25cffde051c9..602470bc00bece 100644
--- a/llvm/include/llvm/Support/PrettyStackTrace.h
+++ b/llvm/include/llvm/Support/PrettyStackTrace.h
@@ -16,7 +16,6 @@
#define LLVM_SUPPORT_PRETTYSTACKTRACE_H
#include "llvm/ADT/SmallVector.h"
-#include "llvm/Support/Compiler.h"
namespace llvm {
class raw_ostream;
diff --git a/llvm/include/llvm/Support/Process.h b/llvm/include/llvm/Support/Process.h
index 83f1fcd8b2abca..d05a10844af6e7 100644
--- a/llvm/include/llvm/Support/Process.h
+++ b/llvm/include/llvm/Support/Process.h
@@ -25,10 +25,13 @@
#define LLVM_SUPPORT_PROCESS_H
#include "llvm/Support/Chrono.h"
-#include "llvm/Support/DataTypes.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/Program.h"
+#include <chrono>
#include <optional>
+#include <stddef.h>
+#include <stdint.h>
+#include <string>
#include <system_error>
namespace llvm {
diff --git a/llvm/include/llvm/Support/Program.h b/llvm/include/llvm/Support/Program.h
index 9df94eb604c7d6..171e18fd5a2686 100644
--- a/llvm/include/llvm/Support/Program.h
+++ b/llvm/include/llvm/Support/Program.h
@@ -17,14 +17,21 @@
#include "llvm/ADT/StringRef.h"
#include "llvm/Config/llvm-config.h"
#include "llvm/Support/ErrorOr.h"
-#include "llvm/Support/FileSystem.h"
#include <chrono>
#include <optional>
+#include <stdint.h>
+#include <string>
+#include <sys/types.h>
#include <system_error>
namespace llvm {
class BitVector;
+class raw_ostream;
+
namespace sys {
+namespace fs {
+enum OpenFlags : unsigned int;
+} // namespace fs
/// This is the OS-specific separator for PATH like environment variables:
// a colon on Unix or a semicolon on Windows.
diff --git a/llvm/include/llvm/Support/RISCVAttributeParser.h b/llvm/include/llvm/Support/RISCVAttributeParser.h
index 9f295504de959e..bce236b8c8d163 100644
--- a/llvm/include/llvm/Support/RISCVAttributeParser.h
+++ b/llvm/include/llvm/Support/RISCVAttributeParser.h
@@ -9,10 +9,15 @@
#ifndef LLVM_SUPPORT_RISCVATTRIBUTEPARSER_H
#define LLVM_SUPPORT_RISCVATTRIBUTEPARSER_H
+#include "llvm/ADT/StringRef.h"
#include "llvm/Support/ELFAttributeParser.h"
+#include "llvm/Support/Error.h"
#include "llvm/Support/RISCVAttributes.h"
+#include <stdint.h>
namespace llvm {
+class ScopedPrinter;
+
class RISCVAttributeParser : public ELFAttributeParser {
struct DisplayHandler {
RISCVAttrs::AttrType attribute;
diff --git a/llvm/include/llvm/Support/RandomNumberGenerator.h b/llvm/include/llvm/Support/RandomNumberGenerator.h
index 55d6876cc5e41f..d510cd8a0d6e8b 100644
--- a/llvm/include/llvm/Support/RandomNumberGenerator.h
+++ b/llvm/include/llvm/Support/RandomNumberGenerator.h
@@ -15,9 +15,8 @@
#ifndef LLVM_SUPPORT_RANDOMNUMBERGENERATOR_H_
#define LLVM_SUPPORT_RANDOMNUMBERGENERATOR_H_
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/DataTypes.h" // Needed for uint64_t on Windows.
#include <random>
+#include <stddef.h>
#include <system_error>
namespace llvm {
diff --git a/llvm/include/llvm/Support/ScaledNumber.h b/llvm/include/llvm/Support/ScaledNumber.h
index faf3ce351c3e52..f19863eaf2f303 100644
--- a/llvm/include/llvm/Support/ScaledNumber.h
+++ b/llvm/include/llvm/Support/ScaledNumber.h
@@ -21,8 +21,10 @@
#ifndef LLVM_SUPPORT_SCALEDNUMBER_H
#define LLVM_SUPPORT_SCALEDNUMBER_H
+#include "llvm/ADT/bit.h"
#include "llvm/Support/MathExtras.h"
#include <algorithm>
+#include <assert.h>
#include <cstdint>
#include <limits>
#include <string>
@@ -417,6 +419,7 @@ inline std::pair<uint64_t, int16_t> getDifference64(uint64_t LDigits,
namespace llvm {
class raw_ostream;
+
class ScaledNumberBase {
public:
static constexpr int DefaultPrecision = 10;
diff --git a/llvm/include/llvm/Support/ScopedPrinter.h b/llvm/include/llvm/Support/ScopedPrinter.h
index 419ab97366796e..2c481345bb6aaf 100644
--- a/llvm/include/llvm/Support/ScopedPrinter.h
+++ b/llvm/include/llvm/Support/ScopedPrinter.h
@@ -11,13 +11,17 @@
#include "llvm/ADT/APSInt.h"
#include "llvm/ADT/ArrayRef.h"
+#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringRef.h"
-#include "llvm/Support/DataTypes.h"
#include "llvm/Support/Endian.h"
+#include "llvm/Support/Format.h"
#include "llvm/Support/JSON.h"
#include "llvm/Support/raw_ostream.h"
+#include <memory>
+#include <stdint.h>
+#include <string>
namespace llvm {
diff --git a/llvm/include/llvm/Support/SourceMgr.h b/llvm/include/llvm/Support/SourceMgr.h
index 7a4b6de1162da4..fc6cb212919c86 100644
--- a/llvm/include/llvm/Support/SourceMgr.h
+++ b/llvm/include/llvm/Support/SourceMgr.h
@@ -15,9 +15,20 @@
#ifndef LLVM_SUPPORT_SOURCEMGR_H
#define LLVM_SUPPORT_SOURCEMGR_H
+#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/SmallVector.h"
+#include "llvm/ADT/StringRef.h"
+#include "llvm/ADT/Twine.h"
+#include "llvm/Support/ErrorOr.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/SMLoc.h"
+#include <algorithm>
+#include <assert.h>
+#include <iterator>
+#include <memory>
+#include <stddef.h>
+#include <string>
+#include <utility>
#include <vector>
namespace llvm {
diff --git a/llvm/include/llvm/Support/SpecialCaseList.h b/llvm/include/llvm/Support/SpecialCaseList.h
index 6dc1a29c5a281d..d2b9aa0954d37c 100644
--- a/llvm/include/llvm/Support/SpecialCaseList.h
+++ b/llvm/include/llvm/Support/SpecialCaseList.h
@@ -13,15 +13,17 @@
#define LLVM_SUPPORT_SPECIALCASELIST_H
#include "llvm/ADT/StringMap.h"
+#include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Error.h"
#include "llvm/Support/GlobPattern.h"
#include "llvm/Support/Regex.h"
#include <memory>
#include <string>
+#include <utility>
#include <vector>
namespace llvm {
class MemoryBuffer;
-class StringRef;
namespace vfs {
class FileSystem;
diff --git a/llvm/include/llvm/Support/StringSaver.h b/llvm/include/llvm/Support/StringSaver.h
index 95ace0e0e29a02..28dfcc2bda2174 100644
--- a/llvm/include/llvm/Support/StringSaver.h
+++ b/llvm/include/llvm/Support/StringSaver.h
@@ -13,6 +13,7 @@
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/Twine.h"
#include "llvm/Support/Allocator.h"
+#include <string>
namespace llvm {
diff --git a/llvm/include/llvm/Support/SuffixTree.h b/llvm/include/llvm/Support/SuffixTree.h
index 37b73666404300..589b978f639a4f 100644
--- a/llvm/include/llvm/Support/SuffixTree.h
+++ b/llvm/include/llvm/Support/SuffixTree.h
@@ -33,8 +33,10 @@
#define LLVM_SUPPORT_SUFFIXTREE_H
#include "llvm/ADT/ArrayRef.h"
+#include "llvm/ADT/SmallVector.h"
#include "llvm/Support/Allocator.h"
#include "llvm/Support/SuffixTreeNode.h"
+#include <vector>
namespace llvm {
class SuffixTree {
diff --git a/llvm/include/llvm/Support/TarWriter.h b/llvm/include/llvm/Support/TarWriter.h
index 48d810ac65e351..7313dff0293103 100644
--- a/llvm/include/llvm/Support/TarWriter.h
+++ b/llvm/include/llvm/Support/TarWriter.h
@@ -13,6 +13,8 @@
#include "llvm/ADT/StringSet.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/raw_ostream.h"
+#include <memory>
+#include <string>
namespace llvm {
class TarWriter {
diff --git a/llvm/include/llvm/Support/ThreadPool.h b/llvm/include/llvm/Support/ThreadPool.h
index 014b7a09d7c8ba..680676abee7efd 100644
--- a/llvm/include/llvm/Support/ThreadPool.h
+++ b/llvm/include/llvm/Support/ThreadPool.h
@@ -15,22 +15,22 @@
#include "llvm/ADT/DenseMap.h"
#include "llvm/Config/llvm-config.h"
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/RWMutex.h"
#include "llvm/Support/Threading.h"
-#include "llvm/Support/thread.h"
-
-#include <future>
-
+#include <assert.h>
#include <condition_variable>
#include <deque>
#include <functional>
-#include <memory>
+#include <future>
#include <mutex>
#include <utility>
+#include <vector>
namespace llvm {
class ThreadPoolTaskGroup;
+class thread;
/// This defines the abstract base interface for a ThreadPool allowing
/// asynchronous parallel execution on a defined number of threads.
diff --git a/llvm/include/llvm/Support/Threading.h b/llvm/include/llvm/Support/Threading.h
index ba6c531ab4db21..56f32d7efe5656 100644
--- a/llvm/include/llvm/Support/Threading.h
+++ b/llvm/include/llvm/Support/Threading.h
@@ -17,9 +17,9 @@
#include "llvm/ADT/BitVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Config/llvm-config.h" // for LLVM_ON_UNIX
-#include "llvm/Support/Compiler.h"
-#include <ciso646> // So we can check the C++ standard lib macros.
#include <optional>
+#include <stdint.h>
+#include <utility>
#if defined(_MSC_VER)
// MSVC's call_once implementation worked since VS 2015, which is the minimum
@@ -47,6 +47,7 @@
namespace llvm {
class Twine;
+template <typename T> class SmallVectorImpl;
/// Returns true if LLVM is compiled with support for multi-threading, and
/// false otherwise.
diff --git a/llvm/include/llvm/Support/TimeProfiler.h b/llvm/include/llvm/Support/TimeProfiler.h
index 9e2ba31991f542..c5f6fed6cc801c 100644
--- a/llvm/include/llvm/Support/TimeProfiler.h
+++ b/llvm/include/llvm/Support/TimeProfiler.h
@@ -78,10 +78,12 @@
#include "llvm/ADT/STLFunctionalExtras.h"
#include "llvm/Support/Error.h"
+#include <string>
namespace llvm {
class raw_pwrite_stream;
+class StringRef;
struct TimeTraceMetadata {
std::string Detail;
diff --git a/llvm/include/llvm/Support/Timer.h b/llvm/include/llvm/Support/Timer.h
index 1a32832b6c6536..8facc422d5699f 100644
--- a/llvm/include/llvm/Support/Timer.h
+++ b/llvm/include/llvm/Support/Timer.h
@@ -11,10 +11,11 @@
#include "llvm/ADT/StringMap.h"
#include "llvm/ADT/StringRef.h"
-#include "llvm/Support/DataTypes.h"
#include <cassert>
#include <memory>
+#include <stdint.h>
#include <string>
+#include <sys/types.h>
#include <vector>
namespace llvm {
diff --git a/llvm/include/llvm/Support/ToolOutputFile.h b/llvm/include/llvm/Support/ToolOutputFile.h
index c16fb03d9b22b9..d7a2903a36e8ec 100644
--- a/llvm/include/llvm/Support/ToolOutputFile.h
+++ b/llvm/include/llvm/Support/ToolOutputFile.h
@@ -13,10 +13,18 @@
#ifndef LLVM_SUPPORT_TOOLOUTPUTFILE_H
#define LLVM_SUPPORT_TOOLOUTPUTFILE_H
+#include "llvm/ADT/StringRef.h"
#include "llvm/Support/raw_ostream.h"
#include <optional>
+#include <string>
+#include <system_error>
namespace llvm {
+namespace sys {
+namespace fs {
+enum OpenFlags : unsigned int;
+} // namespace fs
+} // namespace sys
class CleanupInstaller {
public:
diff --git a/llvm/include/llvm/Support/TypeSize.h b/llvm/include/llvm/Support/TypeSize.h
index bae833ecca7d49..c41173119ad95a 100644
--- a/llvm/include/llvm/Support/TypeSize.h
+++ b/llvm/include/llvm/Support/TypeSize.h
@@ -15,10 +15,9 @@
#ifndef LLVM_SUPPORT_TYPESIZE_H
#define LLVM_SUPPORT_TYPESIZE_H
+#include "llvm/ADT/DenseMapInfo.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/raw_ostream.h"
-
-#include <algorithm>
#include <cassert>
#include <cstdint>
#include <type_traits>
diff --git a/llvm/include/llvm/Support/Unicode.h b/llvm/include/llvm/Support/Unicode.h
index 861548728d4f85..01610e67eb8b3f 100644
--- a/llvm/include/llvm/Support/Unicode.h
+++ b/llvm/include/llvm/Support/Unicode.h
@@ -15,7 +15,10 @@
#define LLVM_SUPPORT_UNICODE_H
#include "llvm/ADT/SmallString.h"
+#include "llvm/ADT/SmallVector.h"
+#include <cstddef>
#include <optional>
+#include <stdint.h>
#include <string>
namespace llvm {
diff --git a/llvm/include/llvm/Support/VersionTuple.h b/llvm/include/llvm/Support/VersionTuple.h
index 0a4623f049d288..e8448e512c77d5 100644
--- a/llvm/include/llvm/Support/VersionTuple.h
+++ b/llvm/include/llvm/Support/VersionTuple.h
@@ -24,6 +24,7 @@ namespace llvm {
template <typename HasherT, llvm::endianness Endianness> class HashBuilder;
class raw_ostream;
class StringRef;
+enum class endianness;
/// Represents a version number in the form major[.minor[.subminor[.build]]].
class VersionTuple {
diff --git a/llvm/include/llvm/Support/VirtualFileSystem.h b/llvm/include/llvm/Support/VirtualFileSystem.h
index f7cfcd4058e722..e704fef2809f0d 100644
--- a/llvm/include/llvm/Support/VirtualFileSystem.h
+++ b/llvm/include/llvm/Support/VirtualFileSystem.h
@@ -15,17 +15,24 @@
#define LLVM_SUPPORT_VIRTUALFILESYSTEM_H
#include "llvm/ADT/IntrusiveRefCntPtr.h"
+#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/STLFunctionalExtras.h"
+#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
+#include "llvm/ADT/iterator_range.h"
+#include "llvm/Support/Casting.h"
#include "llvm/Support/Chrono.h"
#include "llvm/Support/Errc.h"
-#include "llvm/Support/Error.h"
+#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/ErrorOr.h"
#include "llvm/Support/ExtensibleRTTI.h"
#include "llvm/Support/FileSystem.h"
+#include "llvm/Support/FileSystem/UniqueID.h"
+#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/SourceMgr.h"
+#include "llvm/Support/raw_ostream.h"
#include <cassert>
#include <cstdint>
#include <ctime>
@@ -38,9 +45,9 @@
namespace llvm {
-class MemoryBuffer;
class MemoryBufferRef;
class Twine;
+template <typename T> class ArrayRef;
namespace vfs {
@@ -658,9 +665,6 @@ struct YAMLVFSEntry {
bool IsDirectory = false;
};
-class RedirectingFSDirIterImpl;
-class RedirectingFileSystemParser;
-
/// A virtual file system parsed from a YAML file.
///
/// Currently, this class allows creating virtual files and directories. Virtual
diff --git a/llvm/include/llvm/Support/Watchdog.h b/llvm/include/llvm/Support/Watchdog.h
index 281595e8f27225..b27cda39d09e76 100644
--- a/llvm/include/llvm/Support/Watchdog.h
+++ b/llvm/include/llvm/Support/Watchdog.h
@@ -13,8 +13,6 @@
#ifndef LLVM_SUPPORT_WATCHDOG_H
#define LLVM_SUPPORT_WATCHDOG_H
-#include "llvm/Support/Compiler.h"
-
namespace llvm {
namespace sys {
diff --git a/llvm/include/llvm/Support/WithColor.h b/llvm/include/llvm/Support/WithColor.h
index e80e5d469363db..64f4deedc75f1e 100644
--- a/llvm/include/llvm/Support/WithColor.h
+++ b/llvm/include/llvm/Support/WithColor.h
@@ -9,13 +9,13 @@
#ifndef LLVM_SUPPORT_WITHCOLOR_H
#define LLVM_SUPPORT_WITHCOLOR_H
+#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/raw_ostream.h"
namespace llvm {
class Error;
-class StringRef;
namespace cl {
class OptionCategory;
diff --git a/llvm/include/llvm/Support/YAMLParser.h b/llvm/include/llvm/Support/YAMLParser.h
index 9d95a1e13a0dff..3c58cded8bea59 100644
--- a/llvm/include/llvm/Support/YAMLParser.h
+++ b/llvm/include/llvm/Support/YAMLParser.h
@@ -54,6 +54,7 @@ namespace llvm {
class MemoryBufferRef;
class raw_ostream;
class Twine;
+template <typename T> class SmallVectorImpl;
namespace yaml {
diff --git a/llvm/include/llvm/Support/YAMLTraits.h b/llvm/include/llvm/Support/YAMLTraits.h
index 1d04783753d5cd..873f3a34b91bcf 100644
--- a/llvm/include/llvm/Support/YAMLTraits.h
+++ b/llvm/include/llvm/Support/YAMLTraits.h
@@ -11,6 +11,7 @@
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/BitVector.h"
+#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringMap.h"
@@ -18,26 +19,37 @@
#include "llvm/ADT/Twine.h"
#include "llvm/Support/AlignOf.h"
#include "llvm/Support/Allocator.h"
+#include "llvm/Support/Casting.h"
#include "llvm/Support/Endian.h"
+#include "llvm/Support/MemoryBufferRef.h"
#include "llvm/Support/SMLoc.h"
#include "llvm/Support/SourceMgr.h"
#include "llvm/Support/YAMLParser.h"
#include "llvm/Support/raw_ostream.h"
#include <cassert>
+#include <cstring>
#include <map>
#include <memory>
#include <new>
#include <optional>
+#include <stdint.h>
#include <string>
#include <system_error>
#include <type_traits>
+#include <utility>
#include <vector>
namespace llvm {
class VersionTuple;
+enum class endianness;
+template <typename T, T> struct SameType;
namespace yaml {
+struct Hex16;
+struct Hex32;
+struct Hex64;
+struct Hex8;
enum class NodeKind : uint8_t {
Scalar,
diff --git a/llvm/include/llvm/Support/circular_raw_ostream.h b/llvm/include/llvm/Support/circular_raw_ostream.h
index 17fb8fa0e476f6..0d14dbcee98d50 100644
--- a/llvm/include/llvm/Support/circular_raw_ostream.h
+++ b/llvm/include/llvm/Support/circular_raw_ostream.h
@@ -15,6 +15,8 @@
#define LLVM_SUPPORT_CIRCULAR_RAW_OSTREAM_H
#include "llvm/Support/raw_ostream.h"
+#include <stddef.h>
+#include <stdint.h>
namespace llvm {
/// circular_raw_ostream - A raw_ostream which *can* save its data
diff --git a/llvm/include/llvm/Support/raw_os_ostream.h b/llvm/include/llvm/Support/raw_os_ostream.h
index c51a94da3a28d2..e3db48cb7c778c 100644
--- a/llvm/include/llvm/Support/raw_os_ostream.h
+++ b/llvm/include/llvm/Support/raw_os_ostream.h
@@ -15,6 +15,8 @@
#include "llvm/Support/raw_ostream.h"
#include <iosfwd>
+#include <stddef.h>
+#include <stdint.h>
namespace llvm {
diff --git a/llvm/include/llvm/Support/raw_ostream.h b/llvm/include/llvm/Support/raw_ostream.h
index df9ee2e5a78586..895eac0d6d2a27 100644
--- a/llvm/include/llvm/Support/raw_ostream.h
+++ b/llvm/include/llvm/Support/raw_ostream.h
@@ -16,18 +16,22 @@
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/DataTypes.h"
-#include <cassert>
#include <cstddef>
#include <cstdint>
#include <cstring>
+#include <functional>
+#include <memory>
#include <optional>
#include <string>
#include <string_view>
+#include <sys/types.h>
#include <system_error>
#include <type_traits>
+#include <utility>
namespace llvm {
+class APInt;
class Duration;
class formatv_object_base;
class format_object_base;
@@ -35,6 +39,8 @@ class FormattedString;
class FormattedNumber;
class FormattedBytes;
template <class T> class [[nodiscard]] Expected;
+class raw_string_ostream;
+class raw_svector_ostream;
namespace sys {
namespace fs {
diff --git a/llvm/include/llvm/Support/raw_socket_stream.h b/llvm/include/llvm/Support/raw_socket_stream.h
index 6c65a66dec9a4a..e05857a4ce6f1a 100644
--- a/llvm/include/llvm/Support/raw_socket_stream.h
+++ b/llvm/include/llvm/Support/raw_socket_stream.h
@@ -14,11 +14,15 @@
#ifndef LLVM_SUPPORT_RAW_SOCKET_STREAM_H
#define LLVM_SUPPORT_RAW_SOCKET_STREAM_H
+#include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Error.h"
#include "llvm/Support/Threading.h"
#include "llvm/Support/raw_ostream.h"
-
#include <atomic>
#include <chrono>
+#include <memory>
+#include <stdint.h>
+#include <string>
namespace llvm {
diff --git a/llvm/include/llvm/Support/xxhash.h b/llvm/include/llvm/Support/xxhash.h
index 5f8a7ab360abe2..defeca9a0e81d6 100644
--- a/llvm/include/llvm/Support/xxhash.h
+++ b/llvm/include/llvm/Support/xxhash.h
@@ -40,6 +40,7 @@
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/StringRef.h"
+#include <stdint.h>
namespace llvm {
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFLocationExpression.cpp b/llvm/lib/DebugInfo/DWARF/DWARFLocationExpression.cpp
index 1cf73a6667786e..bcc999069cbf27 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFLocationExpression.cpp
+++ b/llvm/lib/DebugInfo/DWARF/DWARFLocationExpression.cpp
@@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
#include "llvm/DebugInfo/DWARF/DWARFLocationExpression.h"
+#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/iterator_range.h"
#include "llvm/Support/FormatVariadic.h"
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp b/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp
index 8ff6ebd2300250..b128ee25b213d8 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp
+++ b/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp
@@ -9,6 +9,8 @@
#include "llvm/ADT/IntervalMap.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallSet.h"
+#include "llvm/ADT/StringRef.h"
+#include "llvm/ADT/iterator_range.h"
#include "llvm/BinaryFormat/Dwarf.h"
#include "llvm/DebugInfo/DWARF/DWARFAbbreviationDeclaration.h"
#include "llvm/DebugInfo/DWARF/DWARFAttribute.h"
diff --git a/llvm/lib/FileCheck/FileCheck.cpp b/llvm/lib/FileCheck/FileCheck.cpp
index df5f7f4697c5c4..8d6eea2880fca4 100644
--- a/llvm/lib/FileCheck/FileCheck.cpp
+++ b/llvm/lib/FileCheck/FileCheck.cpp
@@ -16,10 +16,11 @@
#include "llvm/FileCheck/FileCheck.h"
#include "FileCheckImpl.h"
#include "llvm/ADT/STLExtras.h"
+#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringSet.h"
+#include "llvm/ADT/StringSwitch.h"
#include "llvm/ADT/Twine.h"
-#include "llvm/Support/CheckedArithmetic.h"
#include "llvm/Support/FormatVariadic.h"
#include <cstdint>
#include <list>
diff --git a/llvm/lib/Support/AMDGPUMetadata.cpp b/llvm/lib/Support/AMDGPUMetadata.cpp
index e24cbde38795b0..281576ca355080 100644
--- a/llvm/lib/Support/AMDGPUMetadata.cpp
+++ b/llvm/lib/Support/AMDGPUMetadata.cpp
@@ -14,6 +14,8 @@
#include "llvm/Support/AMDGPUMetadata.h"
#include "llvm/Support/YAMLTraits.h"
+#include "llvm/Support/raw_ostream.h"
+#include <limits>
#include <optional>
using namespace llvm::AMDGPU;
diff --git a/llvm/lib/Support/APFixedPoint.cpp b/llvm/lib/Support/APFixedPoint.cpp
index 249c4f1e2153da..35125613fad518 100644
--- a/llvm/lib/Support/APFixedPoint.cpp
+++ b/llvm/lib/Support/APFixedPoint.cpp
@@ -13,7 +13,9 @@
#include "llvm/ADT/APFixedPoint.h"
#include "llvm/ADT/APFloat.h"
-
+#include "llvm/ADT/SmallVector.h"
+#include "llvm/Support/Compiler.h"
+#include "llvm/Support/ErrorHandling.h"
#include <cmath>
namespace llvm {
diff --git a/llvm/lib/Support/APFloat.cpp b/llvm/lib/Support/APFloat.cpp
index 7f68c5ab9b7cf7..35ddece140623b 100644
--- a/llvm/lib/Support/APFloat.cpp
+++ b/llvm/lib/Support/APFloat.cpp
@@ -18,14 +18,18 @@
#include "llvm/ADT/FoldingSet.h"
#include "llvm/ADT/Hashing.h"
#include "llvm/ADT/STLExtras.h"
+#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringRef.h"
-#include "llvm/Config/llvm-config.h"
-#include "llvm/Support/Debug.h"
+#include "llvm/ADT/Twine.h"
+#include "llvm/ADT/bit.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/raw_ostream.h"
+#include <algorithm>
+#include <array>
#include <cstring>
+#include <ctype.h>
#include <limits.h>
#define APFLOAT_DISPATCH_ON_SEMANTICS(METHOD_CALL) \
diff --git a/llvm/lib/Support/APInt.cpp b/llvm/lib/Support/APInt.cpp
index 24e136fcb9c7f7..6d27b3e24ee555 100644
--- a/llvm/lib/Support/APInt.cpp
+++ b/llvm/lib/Support/APInt.cpp
@@ -16,15 +16,19 @@
#include "llvm/ADT/FoldingSet.h"
#include "llvm/ADT/Hashing.h"
#include "llvm/ADT/SmallString.h"
+#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/bit.h"
-#include "llvm/Config/llvm-config.h"
#include "llvm/Support/Alignment.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/MathExtras.h"
+#include "llvm/Support/SwapByteOrder.h"
#include "llvm/Support/raw_ostream.h"
+#include <algorithm>
#include <cmath>
+#include <iterator>
+#include <limits>
#include <optional>
using namespace llvm;
diff --git a/llvm/lib/Support/APSInt.cpp b/llvm/lib/Support/APSInt.cpp
index 5a9f44f304a279..533a09f682c0bb 100644
--- a/llvm/lib/Support/APSInt.cpp
+++ b/llvm/lib/Support/APSInt.cpp
@@ -14,6 +14,7 @@
#include "llvm/ADT/APSInt.h"
#include "llvm/ADT/FoldingSet.h"
#include "llvm/ADT/StringRef.h"
+#include <algorithm>
#include <cassert>
using namespace llvm;
diff --git a/llvm/lib/Support/ARMAttributeParser.cpp b/llvm/lib/Support/ARMAttributeParser.cpp
index 43a11730b67ea9..899cfecafce2ff 100644
--- a/llvm/lib/Support/ARMAttributeParser.cpp
+++ b/llvm/lib/Support/ARMAttributeParser.cpp
@@ -7,11 +7,22 @@
//===----------------------------------------------------------------------===//
#include "llvm/Support/ARMAttributeParser.h"
+#include "llvm/ADT/ArrayRef.h"
+#include "llvm/ADT/STLExtras.h"
+#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringExtras.h"
+#include "llvm/ADT/Twine.h"
#include "llvm/Support/ARMBuildAttributes.h"
+#include "llvm/Support/DataExtractor.h"
+#include "llvm/Support/ELFAttributes.h"
#include "llvm/Support/Errc.h"
#include "llvm/Support/ScopedPrinter.h"
+#include "llvm/Support/raw_ostream.h"
+#include <iterator>
#include <optional>
+#include <string>
+#include <system_error>
+#include <utility>
using namespace llvm;
using namespace llvm::ARMBuildAttrs;
diff --git a/llvm/lib/Support/ARMBuildAttrs.cpp b/llvm/lib/Support/ARMBuildAttrs.cpp
index 6ff74e02820daa..7dfc1e73116ec4 100644
--- a/llvm/lib/Support/ARMBuildAttrs.cpp
+++ b/llvm/lib/Support/ARMBuildAttrs.cpp
@@ -7,10 +7,7 @@
//===----------------------------------------------------------------------===//
#include "llvm/Support/ARMBuildAttributes.h"
-#include "llvm/ADT/Twine.h"
-#include "llvm/Support/LEB128.h"
-#include <iomanip>
-#include <sstream>
+#include "llvm/Support/ELFAttributes.h"
using namespace llvm;
diff --git a/llvm/lib/Support/BalancedPartitioning.cpp b/llvm/lib/Support/BalancedPartitioning.cpp
index 141f0034a23f04..35dd69e5c2f3a4 100644
--- a/llvm/lib/Support/BalancedPartitioning.cpp
+++ b/llvm/lib/Support/BalancedPartitioning.cpp
@@ -12,10 +12,19 @@
//===----------------------------------------------------------------------===//
#include "llvm/Support/BalancedPartitioning.h"
+#include "llvm/ADT/DenseMap.h"
+#include "llvm/ADT/STLExtras.h"
+#include "llvm/Config/llvm-config.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/FormatVariadic.h"
#include "llvm/Support/ThreadPool.h"
+#include "llvm/Support/raw_ostream.h"
+#include <algorithm>
+#include <assert.h>
+#include <cmath>
+#include <iterator>
+#include <utility>
using namespace llvm;
#define DEBUG_TYPE "balanced-partitioning"
diff --git a/llvm/lib/Support/Base64.cpp b/llvm/lib/Support/Base64.cpp
index 5dab5795497812..96aa229135ec3e 100644
--- a/llvm/lib/Support/Base64.cpp
+++ b/llvm/lib/Support/Base64.cpp
@@ -8,6 +8,8 @@
#define INVALID_BASE64_BYTE 64
#include "llvm/Support/Base64.h"
+#include <inttypes.h>
+#include <system_error>
static char decodeBase64Byte(uint8_t Ch) {
constexpr char Inv = INVALID_BASE64_BYTE;
diff --git a/llvm/lib/Support/BinaryStreamReader.cpp b/llvm/lib/Support/BinaryStreamReader.cpp
index afc00864a5fb60..c11675c7c2f6c8 100644
--- a/llvm/lib/Support/BinaryStreamReader.cpp
+++ b/llvm/lib/Support/BinaryStreamReader.cpp
@@ -7,10 +7,18 @@
//===----------------------------------------------------------------------===//
#include "llvm/Support/BinaryStreamReader.h"
-
+#include "llvm/ADT/SmallVector.h"
#include "llvm/Support/BinaryStreamError.h"
#include "llvm/Support/BinaryStreamRef.h"
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/LEB128.h"
+#include "llvm/Support/MathExtras.h"
+#include <stddef.h>
+
+namespace llvm {
+class BinaryStream;
+enum class endianness;
+} // namespace llvm
using namespace llvm;
diff --git a/llvm/lib/Support/BinaryStreamRef.cpp b/llvm/lib/Support/BinaryStreamRef.cpp
index a6d0bfa10b757c..8656bdf4ca6340 100644
--- a/llvm/lib/Support/BinaryStreamRef.cpp
+++ b/llvm/lib/Support/BinaryStreamRef.cpp
@@ -9,6 +9,10 @@
#include "llvm/Support/BinaryStreamRef.h"
#include "llvm/Support/BinaryByteStream.h"
+namespace llvm {
+enum class endianness;
+} // namespace llvm
+
using namespace llvm;
namespace {
diff --git a/llvm/lib/Support/BinaryStreamWriter.cpp b/llvm/lib/Support/BinaryStreamWriter.cpp
index dff08fee3fefaa..f83c8e7e0c7762 100644
--- a/llvm/lib/Support/BinaryStreamWriter.cpp
+++ b/llvm/lib/Support/BinaryStreamWriter.cpp
@@ -7,11 +7,18 @@
//===----------------------------------------------------------------------===//
#include "llvm/Support/BinaryStreamWriter.h"
-
#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/BinaryStreamReader.h"
#include "llvm/Support/BinaryStreamRef.h"
#include "llvm/Support/LEB128.h"
+#include "llvm/Support/MathExtras.h"
+#include <algorithm>
+#include <assert.h>
+
+namespace llvm {
+class WritableBinaryStream;
+enum class endianness;
+} // namespace llvm
using namespace llvm;
diff --git a/llvm/lib/Support/BranchProbability.cpp b/llvm/lib/Support/BranchProbability.cpp
index e3763449d16cb9..653d7fc59606c2 100644
--- a/llvm/lib/Support/BranchProbability.cpp
+++ b/llvm/lib/Support/BranchProbability.cpp
@@ -11,12 +11,12 @@
//===----------------------------------------------------------------------===//
#include "llvm/Support/BranchProbability.h"
-#include "llvm/Config/llvm-config.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/raw_ostream.h"
#include <cassert>
#include <cmath>
+#include <inttypes.h>
using namespace llvm;
diff --git a/llvm/lib/Support/BuryPointer.cpp b/llvm/lib/Support/BuryPointer.cpp
index 87d2406bbfd1fd..b538ab04837896 100644
--- a/llvm/lib/Support/BuryPointer.cpp
+++ b/llvm/lib/Support/BuryPointer.cpp
@@ -9,6 +9,7 @@
#include "llvm/Support/BuryPointer.h"
#include "llvm/Support/Compiler.h"
#include <atomic>
+#include <stddef.h>
namespace llvm {
diff --git a/llvm/lib/Support/CRC.cpp b/llvm/lib/Support/CRC.cpp
index 2bc668beed3223..212beaf89d8d68 100644
--- a/llvm/lib/Support/CRC.cpp
+++ b/llvm/lib/Support/CRC.cpp
@@ -19,9 +19,8 @@
//===----------------------------------------------------------------------===//
#include "llvm/Support/CRC.h"
-
#include "llvm/ADT/ArrayRef.h"
-#include "llvm/Config/config.h"
+#include "llvm/Config/llvm-config.h"
using namespace llvm;
@@ -83,7 +82,9 @@ uint32_t llvm::crc32(uint32_t CRC, ArrayRef<uint8_t> Data) {
#else
+#include <zconf.h>
#include <zlib.h>
+
uint32_t llvm::crc32(uint32_t CRC, ArrayRef<uint8_t> Data) {
// Zlib's crc32() only takes a 32-bit length, so we have to iterate for larger
// sizes. One could use crc32_z() instead, but that's a recent (2017) addition
diff --git a/llvm/lib/Support/CSKYAttributeParser.cpp b/llvm/lib/Support/CSKYAttributeParser.cpp
index 40ee617b981b2c..06a57ff451baa3 100644
--- a/llvm/lib/Support/CSKYAttributeParser.cpp
+++ b/llvm/lib/Support/CSKYAttributeParser.cpp
@@ -7,8 +7,13 @@
//===----------------------------------------------------------------------===//
#include "llvm/Support/CSKYAttributeParser.h"
+#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/StringExtras.h"
+#include "llvm/ADT/Twine.h"
+#include "llvm/Support/DataExtractor.h"
#include "llvm/Support/Errc.h"
+#include <string>
+#include <system_error>
using namespace llvm;
diff --git a/llvm/lib/Support/CachePruning.cpp b/llvm/lib/Support/CachePruning.cpp
index 4eae08b18c9b53..ba37b0732a7e53 100644
--- a/llvm/lib/Support/CachePruning.cpp
+++ b/llvm/lib/Support/CachePruning.cpp
@@ -11,19 +11,30 @@
//===----------------------------------------------------------------------===//
#include "llvm/Support/CachePruning.h"
+#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringRef.h"
+#include "llvm/ADT/Twine.h"
+#include "llvm/Support/Chrono.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/Errc.h"
#include "llvm/Support/Error.h"
+#include "llvm/Support/ErrorHandling.h"
+#include "llvm/Support/ErrorOr.h"
#include "llvm/Support/FileSystem.h"
+#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/WithColor.h"
#include "llvm/Support/raw_ostream.h"
-
-#define DEBUG_TYPE "cache-pruning"
-
+#include <algorithm>
+#include <ctype.h>
#include <set>
+#include <stddef.h>
+#include <string>
#include <system_error>
+#include <tuple>
+#include <utility>
+
+#define DEBUG_TYPE "cache-pruning"
using namespace llvm;
diff --git a/llvm/lib/Support/Caching.cpp b/llvm/lib/Support/Caching.cpp
index 1ef51db218e89c..295c9e2f21883e 100644
--- a/llvm/lib/Support/Caching.cpp
+++ b/llvm/lib/Support/Caching.cpp
@@ -13,13 +13,16 @@
//===----------------------------------------------------------------------===//
#include "llvm/Support/Caching.h"
+#include "llvm/ADT/SmallString.h"
#include "llvm/Support/Errc.h"
+#include "llvm/Support/ErrorHandling.h"
+#include "llvm/Support/ErrorOr.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/Path.h"
+#include <system_error>
#if !defined(_MSC_VER) && !defined(__MINGW32__)
-#include <unistd.h>
#else
#include <io.h>
#endif
diff --git a/llvm/lib/Support/Chrono.cpp b/llvm/lib/Support/Chrono.cpp
index 993d200675fe57..408d230ed93abd 100644
--- a/llvm/lib/Support/Chrono.cpp
+++ b/llvm/lib/Support/Chrono.cpp
@@ -10,6 +10,7 @@
#include "llvm/Config/llvm-config.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/raw_ostream.h"
+#include <string>
namespace llvm {
diff --git a/llvm/lib/Support/CodeGenCoverage.cpp b/llvm/lib/Support/CodeGenCoverage.cpp
index 2e35019e12c168..58f990079cf301 100644
--- a/llvm/lib/Support/CodeGenCoverage.cpp
+++ b/llvm/lib/Support/CodeGenCoverage.cpp
@@ -10,7 +10,8 @@
//===----------------------------------------------------------------------===//
#include "llvm/Support/CodeGenCoverage.h"
-
+#include "llvm/ADT/Twine.h"
+#include "llvm/ADT/bit.h"
#include "llvm/Support/Endian.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/MemoryBuffer.h"
@@ -18,6 +19,11 @@
#include "llvm/Support/Process.h"
#include "llvm/Support/ScopedPrinter.h"
#include "llvm/Support/ToolOutputFile.h"
+#include "llvm/Support/raw_ostream.h"
+#include <iterator>
+#include <memory>
+#include <string>
+#include <system_error>
using namespace llvm;
diff --git a/llvm/lib/Support/CommandLine.cpp b/llvm/lib/Support/CommandLine.cpp
index ecc487a17cccae..82c45bfeae09c8 100644
--- a/llvm/lib/Support/CommandLine.cpp
+++ b/llvm/lib/Support/CommandLine.cpp
@@ -16,23 +16,29 @@
//===----------------------------------------------------------------------===//
#include "llvm/Support/CommandLine.h"
-
#include "DebugOptions.h"
-
#include "llvm-c/Support.h"
#include "llvm/ADT/ArrayRef.h"
+#include "llvm/ADT/DenseMap.h"
+#include "llvm/ADT/IntrusiveRefCntPtr.h"
+#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/STLFunctionalExtras.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringMap.h"
+#include "llvm/ADT/StringMapEntry.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/Twine.h"
+#include "llvm/ADT/iterator.h"
#include "llvm/Config/config.h"
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/ConvertUTF.h"
#include "llvm/Support/Debug.h"
+#include "llvm/Support/Errc.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/ErrorHandling.h"
+#include "llvm/Support/ErrorOr.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/MemoryBuffer.h"
@@ -41,9 +47,14 @@
#include "llvm/Support/StringSaver.h"
#include "llvm/Support/VirtualFileSystem.h"
#include "llvm/Support/raw_ostream.h"
+#include <algorithm>
#include <cstdlib>
+#include <memory>
#include <optional>
+#include <string.h>
#include <string>
+#include <system_error>
+
using namespace llvm;
using namespace cl;
diff --git a/llvm/lib/Support/Compression.cpp b/llvm/lib/Support/Compression.cpp
index badaf68ab59cd0..5273bf5b447bc9 100644
--- a/llvm/lib/Support/Compression.cpp
+++ b/llvm/lib/Support/Compression.cpp
@@ -11,12 +11,14 @@
//===----------------------------------------------------------------------===//
#include "llvm/Support/Compression.h"
+#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
-#include "llvm/Config/config.h"
+#include "llvm/Config/llvm-config.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/ErrorHandling.h"
+#include <assert.h>
#if LLVM_ENABLE_ZLIB
#include <zlib.h>
#endif
diff --git a/llvm/lib/Support/ConvertEBCDIC.cpp b/llvm/lib/Support/ConvertEBCDIC.cpp
index 08eeaa52a6c97f..80786cda853c82 100644
--- a/llvm/lib/Support/ConvertEBCDIC.cpp
+++ b/llvm/lib/Support/ConvertEBCDIC.cpp
@@ -14,6 +14,9 @@
//===----------------------------------------------------------------------===//
#include "llvm/Support/ConvertEBCDIC.h"
+#include "llvm/ADT/SmallVector.h"
+#include <assert.h>
+#include <stddef.h>
using namespace llvm;
diff --git a/llvm/lib/Support/ConvertUTFWrapper.cpp b/llvm/lib/Support/ConvertUTFWrapper.cpp
index 3fa7365e72d34a..40ba57043ca1e2 100644
--- a/llvm/lib/Support/ConvertUTFWrapper.cpp
+++ b/llvm/lib/Support/ConvertUTFWrapper.cpp
@@ -7,10 +7,14 @@
//===----------------------------------------------------------------------===//
#include "llvm/ADT/ArrayRef.h"
+#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
+#include "llvm/ADT/bit.h"
#include "llvm/Support/ConvertUTF.h"
#include "llvm/Support/ErrorHandling.h"
-#include "llvm/Support/SwapByteOrder.h"
+#include <assert.h>
+#include <stdint.h>
+#include <string.h>
#include <string>
#include <vector>
diff --git a/llvm/lib/Support/CrashRecoveryContext.cpp b/llvm/lib/Support/CrashRecoveryContext.cpp
index f53aea177d6127..feba93e2a3768b 100644
--- a/llvm/lib/Support/CrashRecoveryContext.cpp
+++ b/llvm/lib/Support/CrashRecoveryContext.cpp
@@ -8,13 +8,17 @@
#include "llvm/Support/CrashRecoveryContext.h"
#include "llvm/Config/llvm-config.h"
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/ExitCodes.h"
#include "llvm/Support/Signals.h"
#include "llvm/Support/thread.h"
#include <cassert>
+#include <iterator>
#include <mutex>
+#include <optional>
#include <setjmp.h>
+#include <stdint.h>
using namespace llvm;
diff --git a/llvm/lib/Support/DAGDeltaAlgorithm.cpp b/llvm/lib/Support/DAGDeltaAlgorithm.cpp
index f1b730e2b58c43..2682e5ddab5c68 100644
--- a/llvm/lib/Support/DAGDeltaAlgorithm.cpp
+++ b/llvm/lib/Support/DAGDeltaAlgorithm.cpp
@@ -35,9 +35,9 @@
#include "llvm/Support/Debug.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/raw_ostream.h"
-#include <algorithm>
#include <cassert>
#include <map>
+
using namespace llvm;
#define DEBUG_TYPE "dag-delta"
diff --git a/llvm/lib/Support/DJB.cpp b/llvm/lib/Support/DJB.cpp
index b9d159cdb3a624..cd226884959d28 100644
--- a/llvm/lib/Support/DJB.cpp
+++ b/llvm/lib/Support/DJB.cpp
@@ -12,9 +12,11 @@
#include "llvm/Support/DJB.h"
#include "llvm/ADT/ArrayRef.h"
-#include "llvm/Support/Compiler.h"
#include "llvm/Support/ConvertUTF.h"
#include "llvm/Support/Unicode.h"
+#include <array>
+#include <assert.h>
+#include <optional>
using namespace llvm;
diff --git a/llvm/lib/Support/DataExtractor.cpp b/llvm/lib/Support/DataExtractor.cpp
index eac3c32cfd3b79..eeeb3032e19240 100644
--- a/llvm/lib/Support/DataExtractor.cpp
+++ b/llvm/lib/Support/DataExtractor.cpp
@@ -12,6 +12,10 @@
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/LEB128.h"
#include "llvm/Support/SwapByteOrder.h"
+#include <assert.h>
+#include <cstring>
+#include <inttypes.h>
+#include <system_error>
using namespace llvm;
diff --git a/llvm/lib/Support/Debug.cpp b/llvm/lib/Support/Debug.cpp
index 98a9ac4722b50e..c0d35a66085fa2 100644
--- a/llvm/lib/Support/Debug.cpp
+++ b/llvm/lib/Support/Debug.cpp
@@ -24,13 +24,15 @@
//===----------------------------------------------------------------------===//
#include "llvm/Support/Debug.h"
+#include "DebugOptions.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/Signals.h"
#include "llvm/Support/circular_raw_ostream.h"
#include "llvm/Support/raw_ostream.h"
-
-#include "DebugOptions.h"
+#include <stddef.h>
+#include <string>
+#include <vector>
#undef isCurrentDebugType
#undef setCurrentDebugType
diff --git a/llvm/lib/Support/DebugCounter.cpp b/llvm/lib/Support/DebugCounter.cpp
index a5d8a704bdd213..4d463aa2abfcbd 100644
--- a/llvm/lib/Support/DebugCounter.cpp
+++ b/llvm/lib/Support/DebugCounter.cpp
@@ -1,9 +1,13 @@
#include "llvm/Support/DebugCounter.h"
-
#include "DebugOptions.h"
-
+#include "llvm/ADT/ArrayRef.h"
+#include "llvm/ADT/STLExtras.h"
+#include "llvm/ADT/STLFunctionalExtras.h"
#include "llvm/Support/CommandLine.h"
+#include "llvm/Support/Debug.h"
#include "llvm/Support/Format.h"
+#include "llvm/Support/raw_ostream.h"
+#include <stddef.h>
using namespace llvm;
diff --git a/llvm/lib/Support/DivisionByConstantInfo.cpp b/llvm/lib/Support/DivisionByConstantInfo.cpp
index b0e503003a6803..d9d06c3a05f4e9 100644
--- a/llvm/lib/Support/DivisionByConstantInfo.cpp
+++ b/llvm/lib/Support/DivisionByConstantInfo.cpp
@@ -11,6 +11,8 @@
//===----------------------------------------------------------------------===//
#include "llvm/Support/DivisionByConstantInfo.h"
+#include <assert.h>
+#include <utility>
using namespace llvm;
diff --git a/llvm/lib/Support/DynamicAPInt.cpp b/llvm/lib/Support/DynamicAPInt.cpp
index bfcb97e0cc96a0..086bc999d9afc6 100644
--- a/llvm/lib/Support/DynamicAPInt.cpp
+++ b/llvm/lib/Support/DynamicAPInt.cpp
@@ -9,6 +9,7 @@
#include "llvm/ADT/Hashing.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
+#include <stddef.h>
using namespace llvm;
diff --git a/llvm/lib/Support/DynamicLibrary.cpp b/llvm/lib/Support/DynamicLibrary.cpp
index 531c035ab92666..ae9ba4a3c8509c 100644
--- a/llvm/lib/Support/DynamicLibrary.cpp
+++ b/llvm/lib/Support/DynamicLibrary.cpp
@@ -12,10 +12,16 @@
#include "llvm/Support/DynamicLibrary.h"
#include "llvm-c/Support.h"
+#include "llvm-c/Types.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringMap.h"
+#include "llvm/ADT/StringMapEntry.h"
+#include "llvm/ADT/StringRef.h"
+#include "llvm/ADT/iterator.h"
#include "llvm/Config/config.h"
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/Mutex.h"
+#include <assert.h>
#include <vector>
using namespace llvm;
diff --git a/llvm/lib/Support/ELFAttributeParser.cpp b/llvm/lib/Support/ELFAttributeParser.cpp
index 26c3d54e17ade8..c857091bde098e 100644
--- a/llvm/lib/Support/ELFAttributeParser.cpp
+++ b/llvm/lib/Support/ELFAttributeParser.cpp
@@ -7,9 +7,15 @@
//===----------------------------------------------------------------------===//
#include "llvm/Support/ELFAttributeParser.h"
+#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringExtras.h"
+#include "llvm/ADT/Twine.h"
+#include "llvm/ADT/bit.h"
+#include "llvm/Support/ELFAttributes.h"
#include "llvm/Support/Errc.h"
#include "llvm/Support/ScopedPrinter.h"
+#include "llvm/Support/raw_ostream.h"
+#include <system_error>
using namespace llvm;
using namespace llvm::ELFAttrs;
diff --git a/llvm/lib/Support/ELFAttributes.cpp b/llvm/lib/Support/ELFAttributes.cpp
index 63d14486444660..0718ccb596139c 100644
--- a/llvm/lib/Support/ELFAttributes.cpp
+++ b/llvm/lib/Support/ELFAttributes.cpp
@@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
#include "llvm/Support/ELFAttributes.h"
+#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringRef.h"
using namespace llvm;
diff --git a/llvm/lib/Support/Error.cpp b/llvm/lib/Support/Error.cpp
index baa3c322e9dae1..be8b625407eea9 100644
--- a/llvm/lib/Support/Error.cpp
+++ b/llvm/lib/Support/Error.cpp
@@ -11,6 +11,7 @@
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/Twine.h"
#include "llvm/Support/ErrorHandling.h"
+#include <string.h>
#include <system_error>
using namespace llvm;
diff --git a/llvm/lib/Support/ErrorHandling.cpp b/llvm/lib/Support/ErrorHandling.cpp
index cb42e28c04a86d..46b8188f7b138d 100644
--- a/llvm/lib/Support/ErrorHandling.cpp
+++ b/llvm/lib/Support/ErrorHandling.cpp
@@ -14,20 +14,20 @@
#include "llvm/Support/ErrorHandling.h"
#include "llvm-c/ErrorHandling.h"
#include "llvm/ADT/SmallVector.h"
+#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/Twine.h"
#include "llvm/Config/config.h"
#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 <cassert>
#include <cstdlib>
#include <mutex>
#include <new>
+#include <string.h>
+#include <string>
+#include <sys/types.h>
#if defined(HAVE_UNISTD_H)
# include <unistd.h>
@@ -236,8 +236,10 @@ void LLVMResetFatalErrorHandler() {
#ifdef _WIN32
+#include "llvm/Support/Errc.h"
#define WIN32_NO_STATUS
#include "llvm/Support/Windows/WindowsSupport.h"
+
#undef WIN32_NO_STATUS
#include <ntstatus.h>
#include <winerror.h>
diff --git a/llvm/lib/Support/ExponentialBackoff.cpp b/llvm/lib/Support/ExponentialBackoff.cpp
index 7e68cf67ad3857..54c422421c51e7 100644
--- a/llvm/lib/Support/ExponentialBackoff.cpp
+++ b/llvm/lib/Support/ExponentialBackoff.cpp
@@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
#include "llvm/Support/ExponentialBackoff.h"
+#include <algorithm>
#include <thread>
using namespace llvm;
diff --git a/llvm/lib/Support/FileCollector.cpp b/llvm/lib/Support/FileCollector.cpp
index 29436f85c2f23c..f669a7371bcb94 100644
--- a/llvm/lib/Support/FileCollector.cpp
+++ b/llvm/lib/Support/FileCollector.cpp
@@ -8,10 +8,16 @@
#include "llvm/Support/FileCollector.h"
#include "llvm/ADT/SmallString.h"
+#include "llvm/ADT/SmallVector.h"
+#include "llvm/ADT/StringMapEntry.h"
#include "llvm/ADT/Twine.h"
+#include "llvm/ADT/iterator.h"
+#include "llvm/Support/ErrorOr.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/Process.h"
+#include "llvm/Support/raw_ostream.h"
+#include <assert.h>
using namespace llvm;
diff --git a/llvm/lib/Support/FileOutputBuffer.cpp b/llvm/lib/Support/FileOutputBuffer.cpp
index 58a06a34e8cf39..452bd880aeee8d 100644
--- a/llvm/lib/Support/FileOutputBuffer.cpp
+++ b/llvm/lib/Support/FileOutputBuffer.cpp
@@ -11,14 +11,17 @@
//===----------------------------------------------------------------------===//
#include "llvm/Support/FileOutputBuffer.h"
+#include "llvm/ADT/Twine.h"
#include "llvm/Support/Errc.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Memory.h"
#include "llvm/Support/TimeProfiler.h"
+#include "llvm/Support/raw_ostream.h"
+#include <cstddef>
#include <system_error>
+#include <utility>
#if !defined(_MSC_VER) && !defined(__MINGW32__)
-#include <unistd.h>
#else
#include <io.h>
#endif
diff --git a/llvm/lib/Support/FloatingPointMode.cpp b/llvm/lib/Support/FloatingPointMode.cpp
index 5a2836eb824342..72cd3df9763f37 100644
--- a/llvm/lib/Support/FloatingPointMode.cpp
+++ b/llvm/lib/Support/FloatingPointMode.cpp
@@ -8,6 +8,8 @@
#include "llvm/ADT/FloatingPointMode.h"
#include "llvm/ADT/StringExtras.h"
+#include <assert.h>
+#include <utility>
using namespace llvm;
diff --git a/llvm/lib/Support/FoldingSet.cpp b/llvm/lib/Support/FoldingSet.cpp
index 419bf67407684f..fc85278ffe6c26 100644
--- a/llvm/lib/Support/FoldingSet.cpp
+++ b/llvm/lib/Support/FoldingSet.cpp
@@ -13,12 +13,16 @@
#include "llvm/ADT/FoldingSet.h"
#include "llvm/ADT/StringRef.h"
+#include "llvm/ADT/bit.h"
#include "llvm/Support/Allocator.h"
-#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/MathExtras.h"
+#include "llvm/Support/MemAlloc.h"
#include "llvm/Support/SwapByteOrder.h"
#include <cassert>
#include <cstring>
+#include <memory>
+#include <stdlib.h>
+
using namespace llvm;
//===----------------------------------------------------------------------===//
diff --git a/llvm/lib/Support/FormatVariadic.cpp b/llvm/lib/Support/FormatVariadic.cpp
index 3c07a80a00ae6d..c4017ad4322ed3 100644
--- a/llvm/lib/Support/FormatVariadic.cpp
+++ b/llvm/lib/Support/FormatVariadic.cpp
@@ -6,6 +6,8 @@
//===----------------------------------------------------------------------===//
#include "llvm/Support/FormatVariadic.h"
+#include "llvm/ADT/STLFunctionalExtras.h"
+#include "llvm/Support/Compiler.h"
#include <cassert>
#include <optional>
diff --git a/llvm/lib/Support/FormattedStream.cpp b/llvm/lib/Support/FormattedStream.cpp
index c50530e76efc0a..458ff59e78dea1 100644
--- a/llvm/lib/Support/FormattedStream.cpp
+++ b/llvm/lib/Support/FormattedStream.cpp
@@ -11,6 +11,8 @@
//===----------------------------------------------------------------------===//
#include "llvm/Support/FormattedStream.h"
+#include "llvm/ADT/SmallVector.h"
+#include "llvm/ADT/StringRef.h"
#include "llvm/Support/ConvertUTF.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/Unicode.h"
diff --git a/llvm/lib/Support/GlobPattern.cpp b/llvm/lib/Support/GlobPattern.cpp
index 7004adf461a0cc..73e70576db271c 100644
--- a/llvm/lib/Support/GlobPattern.cpp
+++ b/llvm/lib/Support/GlobPattern.cpp
@@ -11,8 +11,14 @@
//===----------------------------------------------------------------------===//
#include "llvm/Support/GlobPattern.h"
+#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringRef.h"
+#include "llvm/ADT/Twine.h"
#include "llvm/Support/Errc.h"
+#include <limits>
+#include <stdint.h>
+#include <string>
+#include <utility>
using namespace llvm;
diff --git a/llvm/lib/Support/GraphWriter.cpp b/llvm/lib/Support/GraphWriter.cpp
index e353ab86b5e807..08e9b4d0288ca6 100644
--- a/llvm/lib/Support/GraphWriter.cpp
+++ b/llvm/lib/Support/GraphWriter.cpp
@@ -11,14 +11,11 @@
//===----------------------------------------------------------------------===//
#include "llvm/Support/GraphWriter.h"
-
#include "DebugOptions.h"
-
+#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
-#include "llvm/Config/config.h"
-#include "llvm/Support/Compiler.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/ErrorOr.h"
#include "llvm/Support/FileSystem.h"
@@ -31,6 +28,8 @@
#include "llvm/Support/ManagedStatic.h"
#endif
+#include <algorithm>
+#include <optional>
#include <string>
#include <system_error>
#include <vector>
diff --git a/llvm/lib/Support/InitLLVM.cpp b/llvm/lib/Support/InitLLVM.cpp
index b7e463a19122db..bc7db3397696e3 100644
--- a/llvm/lib/Support/InitLLVM.cpp
+++ b/llvm/lib/Support/InitLLVM.cpp
@@ -8,13 +8,10 @@
#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/JSON.cpp b/llvm/lib/Support/JSON.cpp
index a5c617bb4a076c..6db33876060c0b 100644
--- a/llvm/lib/Support/JSON.cpp
+++ b/llvm/lib/Support/JSON.cpp
@@ -7,7 +7,9 @@
//===---------------------------------------------------------------------===//
#include "llvm/Support/JSON.h"
+#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/STLExtras.h"
+#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/ConvertUTF.h"
#include "llvm/Support/Error.h"
@@ -16,7 +18,9 @@
#include "llvm/Support/raw_ostream.h"
#include <cctype>
#include <cerrno>
+#include <cstdlib>
#include <optional>
+#include <string.h>
namespace llvm {
namespace json {
diff --git a/llvm/lib/Support/KnownBits.cpp b/llvm/lib/Support/KnownBits.cpp
index 8e31e0ced2d731..bcc4c3dd4afbe6 100644
--- a/llvm/lib/Support/KnownBits.cpp
+++ b/llvm/lib/Support/KnownBits.cpp
@@ -13,8 +13,12 @@
#include "llvm/Support/KnownBits.h"
#include "llvm/Support/Debug.h"
+#include "llvm/Support/MathExtras.h"
#include "llvm/Support/raw_ostream.h"
+#include <algorithm>
#include <cassert>
+#include <initializer_list>
+#include <stdint.h>
using namespace llvm;
diff --git a/llvm/lib/Support/LineIterator.cpp b/llvm/lib/Support/LineIterator.cpp
index caf88d7dfd4afd..8d8d4d74385280 100644
--- a/llvm/lib/Support/LineIterator.cpp
+++ b/llvm/lib/Support/LineIterator.cpp
@@ -8,6 +8,8 @@
#include "llvm/Support/LineIterator.h"
#include "llvm/Support/MemoryBuffer.h"
+#include <assert.h>
+#include <stddef.h>
using namespace llvm;
diff --git a/llvm/lib/Support/LockFileManager.cpp b/llvm/lib/Support/LockFileManager.cpp
index ea040ccf22b996..25a5d8392e5193 100644
--- a/llvm/lib/Support/LockFileManager.cpp
+++ b/llvm/lib/Support/LockFileManager.cpp
@@ -9,6 +9,7 @@
#include "llvm/Support/LockFileManager.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringExtras.h"
+#include "llvm/Config/llvm-config.h"
#include "llvm/Support/Errc.h"
#include "llvm/Support/ErrorOr.h"
#include "llvm/Support/ExponentialBackoff.h"
@@ -19,12 +20,8 @@
#include "llvm/Support/raw_ostream.h"
#include <cerrno>
#include <chrono>
-#include <ctime>
#include <memory>
-#include <sys/stat.h>
-#include <sys/types.h>
#include <system_error>
-#include <thread>
#include <tuple>
#ifdef _WIN32
diff --git a/llvm/lib/Support/MD5.cpp b/llvm/lib/Support/MD5.cpp
index ef7f559adf0643..8e773a75075fae 100644
--- a/llvm/lib/Support/MD5.cpp
+++ b/llvm/lib/Support/MD5.cpp
@@ -47,6 +47,10 @@
#include <cstdint>
#include <cstring>
+namespace llvm {
+template <typename T> class SmallVectorImpl;
+} // namespace llvm
+
// The basic MD5 functions.
// F and G are optimized compared to their RFC 1321 definitions for
diff --git a/llvm/lib/Support/MSP430AttributeParser.cpp b/llvm/lib/Support/MSP430AttributeParser.cpp
index 27694b8f60f36d..bfc69cb2bb3ce2 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/ManagedStatic.cpp b/llvm/lib/Support/ManagedStatic.cpp
index a6ae67066ea042..3a27412d7db86e 100644
--- a/llvm/lib/Support/ManagedStatic.cpp
+++ b/llvm/lib/Support/ManagedStatic.cpp
@@ -11,10 +11,10 @@
//===----------------------------------------------------------------------===//
#include "llvm/Support/ManagedStatic.h"
-#include "llvm/Config/config.h"
#include "llvm/Support/Threading.h"
#include <cassert>
#include <mutex>
+
using namespace llvm;
static const ManagedStaticBase *StaticList = nullptr;
diff --git a/llvm/lib/Support/MemoryBuffer.cpp b/llvm/lib/Support/MemoryBuffer.cpp
index fb7e804fd7e843..7cab8d8ed42bc3 100644
--- a/llvm/lib/Support/MemoryBuffer.cpp
+++ b/llvm/lib/Support/MemoryBuffer.cpp
@@ -19,16 +19,18 @@
#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"
#include <algorithm>
#include <cassert>
+#include <cstdlib>
#include <cstring>
#include <new>
#include <sys/types.h>
#include <system_error>
+#include <utility>
+
#if !defined(_MSC_VER) && !defined(__MINGW32__)
#include <unistd.h>
#else
diff --git a/llvm/lib/Support/NativeFormatting.cpp b/llvm/lib/Support/NativeFormatting.cpp
index 3b9273e1eaadb4..c3facffd2f8487 100644
--- a/llvm/lib/Support/NativeFormatting.cpp
+++ b/llvm/lib/Support/NativeFormatting.cpp
@@ -10,11 +10,16 @@
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringExtras.h"
+#include "llvm/ADT/bit.h"
+#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/Format.h"
-#include "llvm/Support/MathExtras.h"
#include "llvm/Support/raw_ostream.h"
-
+#include <algorithm>
+#include <assert.h>
#include <cmath>
+#include <cstring>
+#include <iterator>
+#include <type_traits>
#if defined(_WIN32) && !defined(__MINGW32__)
#include <float.h> // For _fpclass in llvm::write_double.
diff --git a/llvm/lib/Support/OptimizedStructLayout.cpp b/llvm/lib/Support/OptimizedStructLayout.cpp
index 7b21f927a3462c..ee512ecadabc77 100644
--- a/llvm/lib/Support/OptimizedStructLayout.cpp
+++ b/llvm/lib/Support/OptimizedStructLayout.cpp
@@ -11,7 +11,13 @@
//===----------------------------------------------------------------------===//
#include "llvm/Support/OptimizedStructLayout.h"
+#include "llvm/ADT/ArrayRef.h"
+#include "llvm/ADT/STLExtras.h"
+#include "llvm/ADT/SmallVector.h"
+#include "llvm/Support/ErrorHandling.h"
+#include <algorithm>
#include <optional>
+#include <string.h>
using namespace llvm;
diff --git a/llvm/lib/Support/PGOOptions.cpp b/llvm/lib/Support/PGOOptions.cpp
index 5981dff9e09468..b7481dc669404f 100644
--- a/llvm/lib/Support/PGOOptions.cpp
+++ b/llvm/lib/Support/PGOOptions.cpp
@@ -8,6 +8,8 @@
#include "llvm/Support/PGOOptions.h"
#include "llvm/Support/VirtualFileSystem.h"
+#include <assert.h>
+#include <utility>
using namespace llvm;
diff --git a/llvm/lib/Support/Parallel.cpp b/llvm/lib/Support/Parallel.cpp
index af35947192c0db..45c2221754bc94 100644
--- a/llvm/lib/Support/Parallel.cpp
+++ b/llvm/lib/Support/Parallel.cpp
@@ -7,14 +7,16 @@
//===----------------------------------------------------------------------===//
#include "llvm/Support/Parallel.h"
+#include "llvm/ADT/STLFunctionalExtras.h"
#include "llvm/Config/llvm-config.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/Threading.h"
-
#include <atomic>
#include <deque>
#include <future>
+#include <memory>
#include <thread>
+#include <utility>
#include <vector>
llvm::ThreadPoolStrategy llvm::parallel::strategy;
diff --git a/llvm/lib/Support/Path.cpp b/llvm/lib/Support/Path.cpp
index 4db9bc80b415bf..2d388532a48ef2 100644
--- a/llvm/lib/Support/Path.cpp
+++ b/llvm/lib/Support/Path.cpp
@@ -12,17 +12,30 @@
#include "llvm/Support/Path.h"
#include "llvm/ADT/ArrayRef.h"
+#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/ScopeExit.h"
+#include "llvm/ADT/SmallString.h"
+#include "llvm/ADT/SmallVector.h"
#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/Error.h"
#include "llvm/Support/ErrorHandling.h"
+#include "llvm/Support/ErrorOr.h"
#include "llvm/Support/FileSystem.h"
+#include "llvm/Support/FileSystem/UniqueID.h"
+#include "llvm/Support/MD5.h"
#include "llvm/Support/Process.h"
#include "llvm/Support/Signals.h"
+#include <algorithm>
+#include <assert.h>
#include <cctype>
+#include <stdint.h>
+#include <sys/types.h>
+#include <system_error>
+#include <utility>
+#include <vector>
#if !defined(_MSC_VER) && !defined(__MINGW32__)
#include <unistd.h>
diff --git a/llvm/lib/Support/PluginLoader.cpp b/llvm/lib/Support/PluginLoader.cpp
index cbe413ce25562b..a52b70e669b34d 100644
--- a/llvm/lib/Support/PluginLoader.cpp
+++ b/llvm/lib/Support/PluginLoader.cpp
@@ -15,7 +15,9 @@
#include "llvm/Support/DynamicLibrary.h"
#include "llvm/Support/Mutex.h"
#include "llvm/Support/raw_ostream.h"
+#include <assert.h>
#include <vector>
+
using namespace llvm;
namespace {
diff --git a/llvm/lib/Support/Process.cpp b/llvm/lib/Support/Process.cpp
index 54462f23c8424c..ca2168db04d2f8 100644
--- a/llvm/lib/Support/Process.cpp
+++ b/llvm/lib/Support/Process.cpp
@@ -11,15 +11,19 @@
//===----------------------------------------------------------------------===//
#include "llvm/Support/Process.h"
+#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/STLExtras.h"
+#include "llvm/ADT/SmallString.h"
+#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringExtras.h"
+#include "llvm/ADT/StringRef.h"
+#include "llvm/ADT/Twine.h"
#include "llvm/Config/config.h"
#include "llvm/Config/llvm-config.h"
#include "llvm/Support/CrashRecoveryContext.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Path.h"
-#include "llvm/Support/Program.h"
-
+#include <assert.h>
#include <optional>
#include <stdlib.h> // for _Exit
diff --git a/llvm/lib/Support/Program.cpp b/llvm/lib/Support/Program.cpp
index 181f68cfbb8c3f..27ce5d3b8a439c 100644
--- a/llvm/lib/Support/Program.cpp
+++ b/llvm/lib/Support/Program.cpp
@@ -11,9 +11,12 @@
//===----------------------------------------------------------------------===//
#include "llvm/Support/Program.h"
+#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Config/llvm-config.h"
#include "llvm/Support/raw_ostream.h"
+#include <assert.h>
+
using namespace llvm;
using namespace sys;
diff --git a/llvm/lib/Support/RISCVAttributeParser.cpp b/llvm/lib/Support/RISCVAttributeParser.cpp
index 20392e4bae19f8..06202a149c9cb9 100644
--- a/llvm/lib/Support/RISCVAttributeParser.cpp
+++ b/llvm/lib/Support/RISCVAttributeParser.cpp
@@ -7,7 +7,10 @@
//===----------------------------------------------------------------------===//
#include "llvm/Support/RISCVAttributeParser.h"
+#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/StringExtras.h"
+#include "llvm/Support/DataExtractor.h"
+#include <string>
using namespace llvm;
diff --git a/llvm/lib/Support/RISCVISAUtils.cpp b/llvm/lib/Support/RISCVISAUtils.cpp
index d6b002e66e7ab2..5985cb5c02a095 100644
--- a/llvm/lib/Support/RISCVISAUtils.cpp
+++ b/llvm/lib/Support/RISCVISAUtils.cpp
@@ -13,6 +13,7 @@
#include "llvm/Support/RISCVISAUtils.h"
#include "llvm/ADT/StringExtras.h"
#include <cassert>
+#include <stddef.h>
using namespace llvm;
diff --git a/llvm/lib/Support/RandomNumberGenerator.cpp b/llvm/lib/Support/RandomNumberGenerator.cpp
index 2959fc2bfed17c..5a1587e0e09e25 100644
--- a/llvm/lib/Support/RandomNumberGenerator.cpp
+++ b/llvm/lib/Support/RandomNumberGenerator.cpp
@@ -13,14 +13,16 @@
//===----------------------------------------------------------------------===//
#include "llvm/Support/RandomNumberGenerator.h"
-
#include "DebugOptions.h"
-
+#include "llvm/ADT/STLExtras.h"
+#include "llvm/ADT/StringRef.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/ManagedStatic.h"
-#include "llvm/Support/raw_ostream.h"
+#include <errno.h>
+#include <stdint.h>
+#include <vector>
#ifdef _WIN32
#include "llvm/Support/Windows/WindowsSupport.h"
#else
diff --git a/llvm/lib/Support/SHA1.cpp b/llvm/lib/Support/SHA1.cpp
index 412f894492bfe0..5cd2dcd08c9dc7 100644
--- a/llvm/lib/Support/SHA1.cpp
+++ b/llvm/lib/Support/SHA1.cpp
@@ -17,8 +17,11 @@
#include "llvm/Support/SHA1.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/StringRef.h"
+#include "llvm/ADT/bit.h"
#include "llvm/Support/Endian.h"
#include "llvm/Support/SwapByteOrder.h"
+#include <algorithm>
+#include <assert.h>
#include <string.h>
using namespace llvm;
diff --git a/llvm/lib/Support/SHA256.cpp b/llvm/lib/Support/SHA256.cpp
index a8019002499cad..dfe1e9a6d25aec 100644
--- a/llvm/lib/Support/SHA256.cpp
+++ b/llvm/lib/Support/SHA256.cpp
@@ -22,8 +22,11 @@
#include "llvm/Support/SHA256.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/StringRef.h"
+#include "llvm/ADT/bit.h"
#include "llvm/Support/Endian.h"
#include "llvm/Support/SwapByteOrder.h"
+#include <algorithm>
+#include <assert.h>
#include <string.h>
namespace llvm {
diff --git a/llvm/lib/Support/ScaledNumber.cpp b/llvm/lib/Support/ScaledNumber.cpp
index 85d7afbea5c697..e43b163a91474e 100644
--- a/llvm/lib/Support/ScaledNumber.cpp
+++ b/llvm/lib/Support/ScaledNumber.cpp
@@ -12,9 +12,12 @@
#include "llvm/Support/ScaledNumber.h"
#include "llvm/ADT/APFloat.h"
+#include "llvm/ADT/APInt.h"
#include "llvm/ADT/ArrayRef.h"
+#include "llvm/ADT/SmallVector.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
+#include <stddef.h>
using namespace llvm;
using namespace llvm::ScaledNumbers;
diff --git a/llvm/lib/Support/ScopedPrinter.cpp b/llvm/lib/Support/ScopedPrinter.cpp
index a17e397c0aa581..ddc8e7dd820a63 100644
--- a/llvm/lib/Support/ScopedPrinter.cpp
+++ b/llvm/lib/Support/ScopedPrinter.cpp
@@ -1,6 +1,8 @@
#include "llvm/Support/ScopedPrinter.h"
-
+#include "llvm/ADT/ArrayRef.h"
#include "llvm/Support/Format.h"
+#include <optional>
+#include <utility>
using namespace llvm::support;
diff --git a/llvm/lib/Support/Signals.cpp b/llvm/lib/Support/Signals.cpp
index 9f9030e79d1040..a6b8eace037096 100644
--- a/llvm/lib/Support/Signals.cpp
+++ b/llvm/lib/Support/Signals.cpp
@@ -12,12 +12,16 @@
//===----------------------------------------------------------------------===//
#include "llvm/Support/Signals.h"
-
#include "DebugOptions.h"
-
+#include "llvm/ADT/ArrayRef.h"
+#include "llvm/ADT/SmallString.h"
+#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
-#include "llvm/Config/llvm-config.h"
+#include "llvm/ADT/Twine.h"
+#include "llvm/Support/Allocator.h"
#include "llvm/Support/CommandLine.h"
+#include "llvm/Support/Compiler.h"
+#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/ErrorOr.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/FileUtilities.h"
@@ -30,7 +34,12 @@
#include "llvm/Support/StringSaver.h"
#include "llvm/Support/raw_ostream.h"
#include <array>
+#include <atomic>
#include <cmath>
+#include <memory>
+#include <optional>
+#include <stdlib.h>
+#include <system_error>
#include <vector>
//===----------------------------------------------------------------------===//
diff --git a/llvm/lib/Support/SipHash.cpp b/llvm/lib/Support/SipHash.cpp
index 68545913a4f59c..49783dbbff193c 100644
--- a/llvm/lib/Support/SipHash.cpp
+++ b/llvm/lib/Support/SipHash.cpp
@@ -19,6 +19,7 @@
#include "llvm/Support/Debug.h"
#include "llvm/Support/Endian.h"
#include <cstdint>
+#include <stddef.h>
using namespace llvm;
using namespace support;
diff --git a/llvm/lib/Support/SlowDynamicAPInt.cpp b/llvm/lib/Support/SlowDynamicAPInt.cpp
index 7964a3d59daf51..ab361891419a79 100644
--- a/llvm/lib/Support/SlowDynamicAPInt.cpp
+++ b/llvm/lib/Support/SlowDynamicAPInt.cpp
@@ -8,8 +8,12 @@
#include "llvm/ADT/SlowDynamicAPInt.h"
#include "llvm/ADT/Hashing.h"
+#include "llvm/ADT/STLFunctionalExtras.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
+#include <algorithm>
+#include <assert.h>
+#include <functional>
using namespace llvm;
using namespace detail;
diff --git a/llvm/lib/Support/SmallPtrSet.cpp b/llvm/lib/Support/SmallPtrSet.cpp
index cbb87ea8717cfc..0e59c11125023c 100644
--- a/llvm/lib/Support/SmallPtrSet.cpp
+++ b/llvm/lib/Support/SmallPtrSet.cpp
@@ -13,6 +13,7 @@
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/DenseMapInfo.h"
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/MemAlloc.h"
#include <algorithm>
diff --git a/llvm/lib/Support/SmallVector.cpp b/llvm/lib/Support/SmallVector.cpp
index b6ce37842040b3..d20b49f5900f8e 100644
--- a/llvm/lib/Support/SmallVector.cpp
+++ b/llvm/lib/Support/SmallVector.cpp
@@ -12,8 +12,10 @@
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Twine.h"
+#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/MemAlloc.h"
#include <cstdint>
+#include <string>
#ifdef LLVM_ENABLE_EXCEPTIONS
#include <stdexcept>
#endif
diff --git a/llvm/lib/Support/SourceMgr.cpp b/llvm/lib/Support/SourceMgr.cpp
index 3f97213d86c055..186ff8d3ab7829 100644
--- a/llvm/lib/Support/SourceMgr.cpp
+++ b/llvm/lib/Support/SourceMgr.cpp
@@ -31,6 +31,7 @@
#include <cstddef>
#include <limits>
#include <memory>
+#include <stdint.h>
#include <string>
#include <utility>
diff --git a/llvm/lib/Support/SpecialCaseList.cpp b/llvm/lib/Support/SpecialCaseList.cpp
index 7a23421eaeb89d..1bdf2b0bde9f51 100644
--- a/llvm/lib/Support/SpecialCaseList.cpp
+++ b/llvm/lib/Support/SpecialCaseList.cpp
@@ -14,10 +14,18 @@
//===----------------------------------------------------------------------===//
#include "llvm/Support/SpecialCaseList.h"
+#include "llvm/ADT/StringMapEntry.h"
+#include "llvm/ADT/Twine.h"
+#include "llvm/ADT/iterator.h"
+#include "llvm/Support/Errc.h"
+#include "llvm/Support/ErrorHandling.h"
+#include "llvm/Support/ErrorOr.h"
#include "llvm/Support/LineIterator.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/VirtualFileSystem.h"
+#include <optional>
#include <stdio.h>
+#include <string.h>
#include <string>
#include <system_error>
#include <utility>
diff --git a/llvm/lib/Support/Statistic.cpp b/llvm/lib/Support/Statistic.cpp
index 24ef3e9abaebce..b4c557d09af6ce 100644
--- a/llvm/lib/Support/Statistic.cpp
+++ b/llvm/lib/Support/Statistic.cpp
@@ -21,13 +21,12 @@
//===----------------------------------------------------------------------===//
#include "llvm/ADT/Statistic.h"
-
#include "DebugOptions.h"
-
+#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringExtras.h"
+#include "llvm/ADT/StringRef.h"
+#include "llvm/ADT/iterator_range.h"
#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/Debug.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/Mutex.h"
@@ -35,7 +34,11 @@
#include "llvm/Support/YAMLTraits.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
+#include <assert.h>
#include <cstring>
+#include <inttypes.h>
+#include <string>
+
using namespace llvm;
/// -stats - Command line option to cause transformations to emit stats about
diff --git a/llvm/lib/Support/StringExtras.cpp b/llvm/lib/Support/StringExtras.cpp
index 6ae26267337b19..bcb65f9a698243 100644
--- a/llvm/lib/Support/StringExtras.cpp
+++ b/llvm/lib/Support/StringExtras.cpp
@@ -11,6 +11,7 @@
//===----------------------------------------------------------------------===//
#include "llvm/ADT/StringExtras.h"
+#include "llvm/ADT/STLFunctionalExtras.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/Support/raw_ostream.h"
#include <cctype>
diff --git a/llvm/lib/Support/StringMap.cpp b/llvm/lib/Support/StringMap.cpp
index 432e1fc343f1f0..9c387021e9dac7 100644
--- a/llvm/lib/Support/StringMap.cpp
+++ b/llvm/lib/Support/StringMap.cpp
@@ -11,7 +11,9 @@
//===----------------------------------------------------------------------===//
#include "llvm/ADT/StringMap.h"
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/MathExtras.h"
+#include "llvm/Support/MemAlloc.h"
#include "llvm/Support/ReverseIteration.h"
#include "llvm/Support/xxhash.h"
diff --git a/llvm/lib/Support/StringRef.cpp b/llvm/lib/Support/StringRef.cpp
index f1042131a89cb7..f1056d8a5a4927 100644
--- a/llvm/lib/Support/StringRef.cpp
+++ b/llvm/lib/Support/StringRef.cpp
@@ -9,11 +9,15 @@
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/APFloat.h"
#include "llvm/ADT/APInt.h"
+#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/Hashing.h"
+#include "llvm/ADT/STLExtras.h"
+#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/edit_distance.h"
#include "llvm/Support/Error.h"
#include <bitset>
+#include <limits.h>
using namespace llvm;
diff --git a/llvm/lib/Support/StringSaver.cpp b/llvm/lib/Support/StringSaver.cpp
index 4a616d7348320b..1ed3c2cb61472e 100644
--- a/llvm/lib/Support/StringSaver.cpp
+++ b/llvm/lib/Support/StringSaver.cpp
@@ -7,8 +7,9 @@
//===----------------------------------------------------------------------===//
#include "llvm/Support/StringSaver.h"
-
#include "llvm/ADT/SmallString.h"
+#include <string.h>
+#include <utility>
using namespace llvm;
diff --git a/llvm/lib/Support/SuffixTree.cpp b/llvm/lib/Support/SuffixTree.cpp
index 5e58310e1128b8..5a239599f123c4 100644
--- a/llvm/lib/Support/SuffixTree.cpp
+++ b/llvm/lib/Support/SuffixTree.cpp
@@ -11,9 +11,15 @@
//===----------------------------------------------------------------------===//
#include "llvm/Support/SuffixTree.h"
+#include "llvm/ADT/DenseMap.h"
#include "llvm/Support/Allocator.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/SuffixTreeNode.h"
+#include <assert.h>
+#include <new>
+#include <stddef.h>
+#include <tuple>
+#include <utility>
using namespace llvm;
diff --git a/llvm/lib/Support/SuffixTreeNode.cpp b/llvm/lib/Support/SuffixTreeNode.cpp
index 9f1f94a39895e8..b6048d889e8f67 100644
--- a/llvm/lib/Support/SuffixTreeNode.cpp
+++ b/llvm/lib/Support/SuffixTreeNode.cpp
@@ -12,7 +12,7 @@
//===----------------------------------------------------------------------===//
#include "llvm/Support/SuffixTreeNode.h"
-#include "llvm/Support/Casting.h"
+#include <assert.h>
using namespace llvm;
diff --git a/llvm/lib/Support/TarWriter.cpp b/llvm/lib/Support/TarWriter.cpp
index c7a744f0fc98cc..61a313d808ee60 100644
--- a/llvm/lib/Support/TarWriter.cpp
+++ b/llvm/lib/Support/TarWriter.cpp
@@ -23,9 +23,15 @@
#include "llvm/Support/TarWriter.h"
#include "llvm/ADT/StringRef.h"
+#include "llvm/ADT/Twine.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/Path.h"
+#include <stdint.h>
+#include <stdio.h>
+#include <string.h>
+#include <system_error>
+#include <utility>
using namespace llvm;
diff --git a/llvm/lib/Support/ThreadPool.cpp b/llvm/lib/Support/ThreadPool.cpp
index 27e0f220ac4ed6..b92fc6e688d865 100644
--- a/llvm/lib/Support/ThreadPool.cpp
+++ b/llvm/lib/Support/ThreadPool.cpp
@@ -11,12 +11,15 @@
//===----------------------------------------------------------------------===//
#include "llvm/Support/ThreadPool.h"
-
+#include "llvm/ADT/STLExtras.h"
+#include "llvm/ADT/Twine.h"
#include "llvm/Config/llvm-config.h"
-
+#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/FormatVariadic.h"
#include "llvm/Support/Threading.h"
#include "llvm/Support/raw_ostream.h"
+#include "llvm/Support/thread.h"
+#include <algorithm>
using namespace llvm;
diff --git a/llvm/lib/Support/Threading.cpp b/llvm/lib/Support/Threading.cpp
index 7cc7ba44cc72d4..5628fe3635da25 100644
--- a/llvm/lib/Support/Threading.cpp
+++ b/llvm/lib/Support/Threading.cpp
@@ -14,12 +14,8 @@
#include "llvm/Support/Threading.h"
#include "llvm/Config/config.h"
#include "llvm/Config/llvm-config.h"
-
-#include <cassert>
-#include <errno.h>
+#include <algorithm>
#include <optional>
-#include <stdlib.h>
-#include <string.h>
using namespace llvm;
diff --git a/llvm/lib/Support/TimeProfiler.cpp b/llvm/lib/Support/TimeProfiler.cpp
index c2014028ddadca..2d0aaecc7d4350 100644
--- a/llvm/lib/Support/TimeProfiler.cpp
+++ b/llvm/lib/Support/TimeProfiler.cpp
@@ -13,17 +13,27 @@
#include "llvm/Support/TimeProfiler.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/STLFunctionalExtras.h"
+#include "llvm/ADT/SmallString.h"
+#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringMap.h"
+#include "llvm/ADT/StringMapEntry.h"
+#include "llvm/Support/Compiler.h"
+#include "llvm/Support/FileSystem.h"
#include "llvm/Support/JSON.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/Process.h"
#include "llvm/Support/Threading.h"
+#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <cassert>
#include <chrono>
#include <memory>
#include <mutex>
+#include <stddef.h>
+#include <stdint.h>
#include <string>
+#include <system_error>
+#include <utility>
#include <vector>
using namespace llvm;
diff --git a/llvm/lib/Support/Timer.cpp b/llvm/lib/Support/Timer.cpp
index c1b0fdbc077bb0..bfab4988cf7aae 100644
--- a/llvm/lib/Support/Timer.cpp
+++ b/llvm/lib/Support/Timer.cpp
@@ -11,12 +11,14 @@
//===----------------------------------------------------------------------===//
#include "llvm/Support/Timer.h"
-
#include "DebugOptions.h"
-
+#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/StringMap.h"
+#include "llvm/ADT/StringMapEntry.h"
+#include "llvm/ADT/iterator.h"
#include "llvm/Config/config.h"
+#include "llvm/Support/Chrono.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Format.h"
@@ -26,7 +28,13 @@
#include "llvm/Support/Signposts.h"
#include "llvm/Support/YAMLTraits.h"
#include "llvm/Support/raw_ostream.h"
+#include <chrono>
+#include <inttypes.h>
#include <limits>
+#include <ratio>
+#include <stddef.h>
+#include <system_error>
+#include <utility>
#if HAVE_UNISTD_H
#include <unistd.h>
diff --git a/llvm/lib/Support/Twine.cpp b/llvm/lib/Support/Twine.cpp
index 495b9cf2dbd680..ac0b099d74838b 100644
--- a/llvm/lib/Support/Twine.cpp
+++ b/llvm/lib/Support/Twine.cpp
@@ -8,10 +8,10 @@
#include "llvm/ADT/Twine.h"
#include "llvm/ADT/SmallString.h"
-#include "llvm/Config/llvm-config.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/FormatVariadic.h"
#include "llvm/Support/raw_ostream.h"
+
using namespace llvm;
std::string Twine::str() const {
diff --git a/llvm/lib/Support/TypeSize.cpp b/llvm/lib/Support/TypeSize.cpp
index 43346b81cd6760..bda5a0138516dc 100644
--- a/llvm/lib/Support/TypeSize.cpp
+++ b/llvm/lib/Support/TypeSize.cpp
@@ -7,12 +7,13 @@
//===----------------------------------------------------------------------===//
#include "llvm/Support/TypeSize.h"
+#include "DebugOptions.h"
+#include "llvm/ADT/StringRef.h"
#include "llvm/Support/CommandLine.h"
+#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/WithColor.h"
-#include "DebugOptions.h"
-
using namespace llvm;
#ifndef STRICT_FIXED_SIZE_VECTORS
diff --git a/llvm/lib/Support/Unicode.cpp b/llvm/lib/Support/Unicode.cpp
index 288b75c872e175..4776480aa102e2 100644
--- a/llvm/lib/Support/Unicode.cpp
+++ b/llvm/lib/Support/Unicode.cpp
@@ -12,8 +12,10 @@
//===----------------------------------------------------------------------===//
#include "llvm/Support/Unicode.h"
+#include "llvm/ADT/StringRef.h"
#include "llvm/Support/ConvertUTF.h"
#include "llvm/Support/UnicodeCharRanges.h"
+#include <stddef.h>
namespace llvm {
namespace sys {
diff --git a/llvm/lib/Support/UnicodeNameToCodepoint.cpp b/llvm/lib/Support/UnicodeNameToCodepoint.cpp
index 8d66348cfaba63..49076bcfe16617 100644
--- a/llvm/lib/Support/UnicodeNameToCodepoint.cpp
+++ b/llvm/lib/Support/UnicodeNameToCodepoint.cpp
@@ -13,9 +13,22 @@
//===----------------------------------------------------------------------===//
#include "llvm/ADT/STLExtras.h"
+#include "llvm/ADT/SmallString.h"
+#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/Unicode.h"
+#include <algorithm>
+#include <assert.h>
+#include <cstddef>
+#include <cstdint>
+#include <iterator>
+#include <optional>
+#include <string>
+#include <tuple>
+#include <utility>
+#include <vector>
namespace llvm {
namespace sys {
diff --git a/llvm/lib/Support/UnicodeNameToCodepointGenerated.cpp b/llvm/lib/Support/UnicodeNameToCodepointGenerated.cpp
index bfd51a5434cfa5..31362fd08bdea7 100644
--- a/llvm/lib/Support/UnicodeNameToCodepointGenerated.cpp
+++ b/llvm/lib/Support/UnicodeNameToCodepointGenerated.cpp
@@ -62,9 +62,9 @@ use or other dealings in these Data Files or Software without prior
written authorization of the copyright holder.
*/
-#include "llvm/Support/Compiler.h"
#include <cstddef>
#include <cstdint>
+
namespace llvm {
namespace sys {
namespace unicode {
diff --git a/llvm/lib/Support/Unix/Process.inc b/llvm/lib/Support/Unix/Process.inc
index 84b10ff5d1d08a..48a164eeebe8db 100644
--- a/llvm/lib/Support/Unix/Process.inc
+++ b/llvm/lib/Support/Unix/Process.inc
@@ -13,8 +13,8 @@
#include "Unix.h"
#include "llvm/ADT/Hashing.h"
#include "llvm/ADT/StringRef.h"
+#include "llvm/ADT/StringSwitch.h"
#include "llvm/Config/config.h"
-#include <mutex>
#include <optional>
#if HAVE_FCNTL_H
#include <fcntl.h>
diff --git a/llvm/lib/Support/Unix/Unix.h b/llvm/lib/Support/Unix/Unix.h
index 1599241a344af8..40d8814e0762c4 100644
--- a/llvm/lib/Support/Unix/Unix.h
+++ b/llvm/lib/Support/Unix/Unix.h
@@ -18,11 +18,11 @@
//=== is guaranteed to work on all UNIX variants.
//===----------------------------------------------------------------------===//
+#include "llvm/ADT/Twine.h"
#include "llvm/Config/config.h"
#include "llvm/Support/Chrono.h"
#include "llvm/Support/Errno.h"
#include "llvm/Support/ErrorHandling.h"
-#include <algorithm>
#include <assert.h>
#include <cerrno>
#include <cstdio>
diff --git a/llvm/lib/Support/VirtualFileSystem.cpp b/llvm/lib/Support/VirtualFileSystem.cpp
index 9d21eba9df635f..712d4d2498481c 100644
--- a/llvm/lib/Support/VirtualFileSystem.cpp
+++ b/llvm/lib/Support/VirtualFileSystem.cpp
@@ -13,31 +13,31 @@
#include "llvm/Support/VirtualFileSystem.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/DenseMap.h"
+#include "llvm/ADT/Hashing.h"
#include "llvm/ADT/IntrusiveRefCntPtr.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/SmallVector.h"
+#include "llvm/ADT/StringMap.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/StringSet.h"
#include "llvm/ADT/Twine.h"
#include "llvm/ADT/iterator_range.h"
-#include "llvm/Config/llvm-config.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/Chrono.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/Debug.h"
#include "llvm/Support/Errc.h"
+#include "llvm/Support/Error.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/ErrorOr.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/FileSystem/UniqueID.h"
#include "llvm/Support/MemoryBuffer.h"
+#include "llvm/Support/MemoryBufferRef.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/SMLoc.h"
#include "llvm/Support/SourceMgr.h"
#include "llvm/Support/YAMLParser.h"
#include "llvm/Support/raw_ostream.h"
-#include <algorithm>
#include <atomic>
#include <cassert>
#include <cstdint>
diff --git a/llvm/lib/Support/WithColor.cpp b/llvm/lib/Support/WithColor.cpp
index abc9fb3e5d6063..847f5f72e15899 100644
--- a/llvm/lib/Support/WithColor.cpp
+++ b/llvm/lib/Support/WithColor.cpp
@@ -7,12 +7,12 @@
//===----------------------------------------------------------------------===//
#include "llvm/Support/WithColor.h"
-
#include "DebugOptions.h"
-
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Error.h"
+#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/ManagedStatic.h"
+#include <utility>
using namespace llvm;
diff --git a/llvm/lib/Support/YAMLParser.cpp b/llvm/lib/Support/YAMLParser.cpp
index fdd0ed6e682eb5..d21f54a49886ae 100644
--- a/llvm/lib/Support/YAMLParser.cpp
+++ b/llvm/lib/Support/YAMLParser.cpp
@@ -19,9 +19,12 @@
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/Twine.h"
+#include "llvm/ADT/iterator.h"
+#include "llvm/Support/Casting.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/MemoryBuffer.h"
+#include "llvm/Support/MemoryBufferRef.h"
#include "llvm/Support/SMLoc.h"
#include "llvm/Support/SourceMgr.h"
#include "llvm/Support/Unicode.h"
@@ -29,6 +32,7 @@
#include <cassert>
#include <cstddef>
#include <cstdint>
+#include <functional>
#include <map>
#include <memory>
#include <string>
diff --git a/llvm/lib/Support/YAMLTraits.cpp b/llvm/lib/Support/YAMLTraits.cpp
index 56b557646100b1..92e28c439ddc54 100644
--- a/llvm/lib/Support/YAMLTraits.cpp
+++ b/llvm/lib/Support/YAMLTraits.cpp
@@ -10,6 +10,7 @@
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringExtras.h"
+#include "llvm/ADT/StringMapEntry.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/Twine.h"
#include "llvm/Support/Casting.h"
@@ -21,10 +22,10 @@
#include "llvm/Support/VersionTuple.h"
#include "llvm/Support/YAMLParser.h"
#include "llvm/Support/raw_ostream.h"
-#include <algorithm>
#include <cassert>
#include <cstdint>
#include <cstring>
+#include <inttypes.h>
#include <string>
#include <vector>
diff --git a/llvm/lib/Support/Z3Solver.cpp b/llvm/lib/Support/Z3Solver.cpp
index 5a34ff160f6cf4..f1984de9ffef95 100644
--- a/llvm/lib/Support/Z3Solver.cpp
+++ b/llvm/lib/Support/Z3Solver.cpp
@@ -6,10 +6,11 @@
//
//===----------------------------------------------------------------------===//
-#include "llvm/ADT/ScopeExit.h"
-#include "llvm/Config/config.h"
-#include "llvm/Support/NativeFormatting.h"
+#include "llvm/Config/llvm-config.h"
+#include "llvm/Support/Compiler.h"
+#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/SMTAPI.h"
+#include "llvm/Support/raw_ostream.h"
using namespace llvm;
@@ -17,6 +18,8 @@ using namespace llvm;
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/Twine.h"
+#include <set>
+#include <z3.h>
#include <set>
diff --git a/llvm/lib/Support/circular_raw_ostream.cpp b/llvm/lib/Support/circular_raw_ostream.cpp
index acd230704ff8de..9371f52e6b7580 100644
--- a/llvm/lib/Support/circular_raw_ostream.cpp
+++ b/llvm/lib/Support/circular_raw_ostream.cpp
@@ -12,6 +12,8 @@
#include "llvm/Support/circular_raw_ostream.h"
#include <algorithm>
+#include <cstring>
+
using namespace llvm;
void circular_raw_ostream::write_impl(const char *Ptr, size_t Size) {
diff --git a/llvm/lib/Support/raw_ostream.cpp b/llvm/lib/Support/raw_ostream.cpp
index 2ce54faa9857e6..cde8cbf3146592 100644
--- a/llvm/lib/Support/raw_ostream.cpp
+++ b/llvm/lib/Support/raw_ostream.cpp
@@ -11,11 +11,14 @@
//===----------------------------------------------------------------------===//
#include "llvm/Support/raw_ostream.h"
+#include "llvm/ADT/ArrayRef.h"
+#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringExtras.h"
+#include "llvm/ADT/Twine.h"
#include "llvm/Config/config.h"
-#include "llvm/Support/AutoConvert.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/Duration.h"
+#include "llvm/Support/Error.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Format.h"
@@ -25,8 +28,11 @@
#include "llvm/Support/Process.h"
#include "llvm/Support/Program.h"
#include <algorithm>
+#include <cassert>
#include <cerrno>
#include <cstdio>
+#include <inttypes.h>
+#include <iterator>
#include <sys/stat.h>
// <fcntl.h> may provide O_BINARY.
diff --git a/llvm/lib/Support/raw_socket_stream.cpp b/llvm/lib/Support/raw_socket_stream.cpp
index 04b3233084a414..a1304c4ebdcf9a 100644
--- a/llvm/lib/Support/raw_socket_stream.cpp
+++ b/llvm/lib/Support/raw_socket_stream.cpp
@@ -15,11 +15,13 @@
#include "llvm/Config/config.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/FileSystem.h"
-
#include <atomic>
#include <fcntl.h>
#include <functional>
-#include <thread>
+#include <string.h>
+#include <sys/types.h>
+#include <system_error>
+#include <utility>
#ifndef _WIN32
#include <poll.h>
diff --git a/llvm/lib/Support/xxhash.cpp b/llvm/lib/Support/xxhash.cpp
index cdb76d57e2c1df..e400af63cf486d 100644
--- a/llvm/lib/Support/xxhash.cpp
+++ b/llvm/lib/Support/xxhash.cpp
@@ -42,9 +42,10 @@
// (June 2024).
#include "llvm/Support/xxhash.h"
+#include "llvm/ADT/bit.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/Endian.h"
-
+#include <assert.h>
#include <stdlib.h>
#if !defined(LLVM_XXH_USE_NEON)
diff --git a/llvm/tools/llvm-objdump/MachODump.cpp b/llvm/tools/llvm-objdump/MachODump.cpp
index 0544fc4f406bb0..4fceb6042fd224 100644
--- a/llvm/tools/llvm-objdump/MachODump.cpp
+++ b/llvm/tools/llvm-objdump/MachODump.cpp
@@ -17,6 +17,7 @@
#include "llvm-c/Disassembler.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringExtras.h"
+#include "llvm/ADT/StringSwitch.h"
#include "llvm/BinaryFormat/MachO.h"
#include "llvm/Config/config.h"
#include "llvm/DebugInfo/DIContext.h"
diff --git a/llvm/tools/llvm-rc/llvm-rc.cpp b/llvm/tools/llvm-rc/llvm-rc.cpp
index 51214524adeef6..fdb6a2156111a7 100644
--- a/llvm/tools/llvm-rc/llvm-rc.cpp
+++ b/llvm/tools/llvm-rc/llvm-rc.cpp
@@ -17,6 +17,7 @@
#include "ResourceScriptStmt.h"
#include "ResourceScriptToken.h"
+#include "llvm/ADT/StringSwitch.h"
#include "llvm/Config/llvm-config.h"
#include "llvm/Object/WindowsResource.h"
#include "llvm/Option/Arg.h"
diff --git a/llvm/tools/llvm-xray/xray-account.cpp b/llvm/tools/llvm-xray/xray-account.cpp
index 24a3552cfb91ee..62f2aebb653ce0 100644
--- a/llvm/tools/llvm-xray/xray-account.cpp
+++ b/llvm/tools/llvm-xray/xray-account.cpp
@@ -19,6 +19,7 @@
#include "xray-account.h"
#include "xray-registry.h"
#include "llvm/Support/ErrorHandling.h"
+#include "llvm/Support/FileSystem.h"
#include "llvm/Support/FormatVariadic.h"
#include "llvm/XRay/InstrumentationMap.h"
#include "llvm/XRay/Trace.h"
diff --git a/llvm/tools/llvm-xray/xray-graph-diff.cpp b/llvm/tools/llvm-xray/xray-graph-diff.cpp
index b5c63ab0a91839..cb170e1deff666 100644
--- a/llvm/tools/llvm-xray/xray-graph-diff.cpp
+++ b/llvm/tools/llvm-xray/xray-graph-diff.cpp
@@ -20,6 +20,7 @@
#include "xray-registry.h"
#include "xray-color-helper.h"
+#include "llvm/Support/FileSystem.h"
#include "llvm/Support/FormatVariadic.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/XRay/Trace.h"
diff --git a/llvm/tools/llvm-xray/xray-graph.cpp b/llvm/tools/llvm-xray/xray-graph.cpp
index de67993d759016..00b7d8167d9087 100644
--- a/llvm/tools/llvm-xray/xray-graph.cpp
+++ b/llvm/tools/llvm-xray/xray-graph.cpp
@@ -14,6 +14,7 @@
#include "xray-graph.h"
#include "xray-registry.h"
#include "llvm/Support/ErrorHandling.h"
+#include "llvm/Support/FileSystem.h"
#include "llvm/XRay/InstrumentationMap.h"
#include "llvm/XRay/Trace.h"
diff --git a/llvm/unittests/Support/ThreadPool.cpp b/llvm/unittests/Support/ThreadPool.cpp
index 381b4fc2a26b8e..3692aa2ab77da5 100644
--- a/llvm/unittests/Support/ThreadPool.cpp
+++ b/llvm/unittests/Support/ThreadPool.cpp
@@ -19,6 +19,7 @@
#include "llvm/TargetParser/Triple.h"
#ifdef _WIN32
+#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Windows/WindowsSupport.h"
#endif
diff --git a/llvm/unittests/TargetParser/Host.cpp b/llvm/unittests/TargetParser/Host.cpp
index f8dd1d3a60a005..3ec12bbf64d6b7 100644
--- a/llvm/unittests/TargetParser/Host.cpp
+++ b/llvm/unittests/TargetParser/Host.cpp
@@ -8,6 +8,7 @@
#include "llvm/TargetParser/Host.h"
#include "llvm/ADT/SmallVector.h"
+#include "llvm/ADT/StringSwitch.h"
#include "llvm/Config/config.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Path.h"
diff --git a/llvm/utils/FileCheck/FileCheck.cpp b/llvm/utils/FileCheck/FileCheck.cpp
index 9cf3a3164dfecc..d649e97cc036f9 100644
--- a/llvm/utils/FileCheck/FileCheck.cpp
+++ b/llvm/utils/FileCheck/FileCheck.cpp
@@ -16,6 +16,7 @@
//===----------------------------------------------------------------------===//
#include "llvm/FileCheck/FileCheck.h"
+#include "llvm/ADT/SmallString.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/InitLLVM.h"
#include "llvm/Support/MemoryBuffer.h"
diff --git a/mlir/include/mlir/Analysis/Presburger/Fraction.h b/mlir/include/mlir/Analysis/Presburger/Fraction.h
index f4f1be97147bf6..585a6d48506d24 100644
--- a/mlir/include/mlir/Analysis/Presburger/Fraction.h
+++ b/mlir/include/mlir/Analysis/Presburger/Fraction.h
@@ -15,6 +15,7 @@
#define MLIR_ANALYSIS_PRESBURGER_FRACTION_H
#include "llvm/ADT/DynamicAPInt.h"
+#include "llvm/Support/raw_ostream.h"
namespace mlir {
namespace presburger {
>From ec3840dc55311e4f6b816bf3aaca5f41426e5fb9 Mon Sep 17 00:00:00 2001
From: dfukalov <1671137+dfukalov at users.noreply.github.com>
Date: Mon, 12 Aug 2024 16:00:53 +0200
Subject: [PATCH 2/2] fixup! [NFC][IWYU] Update Support library with IWYU.
fixed VirtualFileSystem.cpp compilation
---
llvm/include/llvm/Support/VirtualFileSystem.h | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/llvm/include/llvm/Support/VirtualFileSystem.h b/llvm/include/llvm/Support/VirtualFileSystem.h
index e704fef2809f0d..85c100087c287b 100644
--- a/llvm/include/llvm/Support/VirtualFileSystem.h
+++ b/llvm/include/llvm/Support/VirtualFileSystem.h
@@ -29,7 +29,6 @@
#include "llvm/Support/ExtensibleRTTI.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/FileSystem/UniqueID.h"
-#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/SourceMgr.h"
#include "llvm/Support/raw_ostream.h"
@@ -45,6 +44,7 @@
namespace llvm {
+class MemoryBuffer;
class MemoryBufferRef;
class Twine;
template <typename T> class ArrayRef;
@@ -665,6 +665,9 @@ struct YAMLVFSEntry {
bool IsDirectory = false;
};
+class RedirectingFSDirIterImpl;
+class RedirectingFileSystemParser;
+
/// A virtual file system parsed from a YAML file.
///
/// Currently, this class allows creating virtual files and directories. Virtual
More information about the Mlir-commits
mailing list