diff --git a/llvm/include/llvm/ADT/SmallVector.h b/llvm/include/llvm/ADT/SmallVector.h index 9347f01a4191f..466acb83d4668 100644 --- a/llvm/include/llvm/ADT/SmallVector.h +++ b/llvm/include/llvm/ADT/SmallVector.h @@ -13,7 +13,6 @@ #ifndef LLVM_ADT_SMALLVECTOR_H #define LLVM_ADT_SMALLVECTOR_H -#include "llvm/ADT/iterator_range.h" #include "llvm/Support/Compiler.h" #include "llvm/Support/type_traits.h" #include @@ -32,6 +31,8 @@ namespace llvm { +template class iterator_range; + /// This is all the stuff common to all SmallVectors. /// /// The template parameter specifies the type which should be used to hold the diff --git a/llvm/include/llvm/Support/ARMTargetParser.h b/llvm/include/llvm/Support/ARMTargetParser.h index b40704c24e87c..1ada6daaad3ba 100644 --- a/llvm/include/llvm/Support/ARMTargetParser.h +++ b/llvm/include/llvm/Support/ARMTargetParser.h @@ -14,7 +14,6 @@ #ifndef LLVM_SUPPORT_ARMTARGETPARSER_H #define LLVM_SUPPORT_ARMTARGETPARSER_H -#include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringRef.h" #include "llvm/Support/ARMBuildAttributes.h" #include diff --git a/llvm/include/llvm/Support/ConvertUTF.h b/llvm/include/llvm/Support/ConvertUTF.h index 1add185330fa0..374cdb907fdc2 100644 --- a/llvm/include/llvm/Support/ConvertUTF.h +++ b/llvm/include/llvm/Support/ConvertUTF.h @@ -91,7 +91,10 @@ #include #include + +#if defined(_WIN32) #include +#endif // Wrap everything in namespace llvm so that programs can link with llvm and // their own version of the unicode libraries. diff --git a/llvm/include/llvm/Support/TargetParser.h b/llvm/include/llvm/Support/TargetParser.h index 1d7594ebedc22..a6f8ebe1381a6 100644 --- a/llvm/include/llvm/Support/TargetParser.h +++ b/llvm/include/llvm/Support/TargetParser.h @@ -16,12 +16,14 @@ // FIXME: vector is used because that's what clang uses for subtarget feature // lists, but SmallVector would probably be better -#include "llvm/ADT/Triple.h" #include "llvm/Support/RISCVISAInfo.h" #include namespace llvm { + class StringRef; +template class SmallVectorImpl; +class Triple; // Target specific information in their own namespaces. // (ARM/AArch64/X86 are declared in ARM/AArch64/X86TargetParser.h) diff --git a/llvm/include/llvm/Support/ThreadPool.h b/llvm/include/llvm/Support/ThreadPool.h index aecff122d3cbe..868dd2819f836 100644 --- a/llvm/include/llvm/Support/ThreadPool.h +++ b/llvm/include/llvm/Support/ThreadPool.h @@ -19,7 +19,6 @@ #include -#include #include #include #include diff --git a/llvm/include/llvm/Support/X86TargetParser.h b/llvm/include/llvm/Support/X86TargetParser.h index bfa3e23dbd9db..6f5db64714e03 100644 --- a/llvm/include/llvm/Support/X86TargetParser.h +++ b/llvm/include/llvm/Support/X86TargetParser.h @@ -14,10 +14,10 @@ #define LLVM_SUPPORT_X86TARGETPARSER_H #include "llvm/ADT/ArrayRef.h" -#include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringMap.h" namespace llvm { +template class SmallVectorImpl;; class StringRef; namespace X86 { diff --git a/llvm/include/llvm/Support/YAMLTraits.h b/llvm/include/llvm/Support/YAMLTraits.h index 66529075e2e71..b7e41f662810e 100644 --- a/llvm/include/llvm/Support/YAMLTraits.h +++ b/llvm/include/llvm/Support/YAMLTraits.h @@ -20,7 +20,6 @@ #include "llvm/Support/Endian.h" #include "llvm/Support/SMLoc.h" #include "llvm/Support/SourceMgr.h" -#include "llvm/Support/VersionTuple.h" #include "llvm/Support/YAMLParser.h" #include "llvm/Support/raw_ostream.h" #include @@ -34,6 +33,9 @@ #include namespace llvm { + +class VersionTuple; + namespace yaml { enum class NodeKind : uint8_t { diff --git a/llvm/lib/Support/BinaryStreamError.cpp b/llvm/lib/Support/BinaryStreamError.cpp index f22523f09ac80..9b8f6862b65c2 100644 --- a/llvm/lib/Support/BinaryStreamError.cpp +++ b/llvm/lib/Support/BinaryStreamError.cpp @@ -7,7 +7,7 @@ //===----------------------------------------------------------------------===// #include "llvm/Support/BinaryStreamError.h" -#include "llvm/Support/ErrorHandling.h" +#include "llvm/Support/raw_ostream.h" using namespace llvm; diff --git a/llvm/lib/Support/CrashRecoveryContext.cpp b/llvm/lib/Support/CrashRecoveryContext.cpp index b6aaf373a5221..2ee3074b840e4 100644 --- a/llvm/lib/Support/CrashRecoveryContext.cpp +++ b/llvm/lib/Support/CrashRecoveryContext.cpp @@ -9,7 +9,6 @@ #include "llvm/Support/CrashRecoveryContext.h" #include "llvm/Config/llvm-config.h" #include "llvm/Support/ErrorHandling.h" -#include "llvm/Support/ExitCodes.h" #include "llvm/Support/ManagedStatic.h" #include "llvm/Support/Signals.h" #include "llvm/Support/ThreadLocal.h" @@ -17,6 +16,10 @@ #include #include +#if !defined(_MSC_VER) && !defined(_WIN32) +#include "llvm/Support/ExitCodes.h" +#endif + using namespace llvm; namespace { diff --git a/llvm/lib/Support/FileUtilities.cpp b/llvm/lib/Support/FileUtilities.cpp index 1a14ed2673606..489b8d119e6f3 100644 --- a/llvm/lib/Support/FileUtilities.cpp +++ b/llvm/lib/Support/FileUtilities.cpp @@ -18,7 +18,6 @@ #include "llvm/Support/ErrorOr.h" #include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/raw_ostream.h" -#include #include #include #include diff --git a/llvm/lib/Support/MemoryBuffer.cpp b/llvm/lib/Support/MemoryBuffer.cpp index 7192fb1321cb6..bf34a242c4c3f 100644 --- a/llvm/lib/Support/MemoryBuffer.cpp +++ b/llvm/lib/Support/MemoryBuffer.cpp @@ -18,7 +18,6 @@ #include "llvm/Support/Errc.h" #include "llvm/Support/FileSystem.h" #include "llvm/Support/MathExtras.h" -#include "llvm/Support/Path.h" #include "llvm/Support/Process.h" #include "llvm/Support/Program.h" #include "llvm/Support/SmallVectorMemoryBuffer.h" diff --git a/llvm/lib/Support/TargetParser.cpp b/llvm/lib/Support/TargetParser.cpp index c14ddbeea5c39..0105cd2e81532 100644 --- a/llvm/lib/Support/TargetParser.cpp +++ b/llvm/lib/Support/TargetParser.cpp @@ -14,7 +14,7 @@ #include "llvm/Support/TargetParser.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/StringSwitch.h" -#include "llvm/Support/ARMBuildAttributes.h" +#include "llvm/ADT/Triple.h" using namespace llvm; using namespace AMDGPU; diff --git a/llvm/lib/Support/ThreadPool.cpp b/llvm/lib/Support/ThreadPool.cpp index 6eec368e626ff..bf2584950c4ac 100644 --- a/llvm/lib/Support/ThreadPool.cpp +++ b/llvm/lib/Support/ThreadPool.cpp @@ -14,7 +14,6 @@ #include "llvm/Config/llvm-config.h" #include "llvm/Support/Threading.h" -#include "llvm/Support/raw_ostream.h" using namespace llvm; diff --git a/llvm/lib/Support/YAMLTraits.cpp b/llvm/lib/Support/YAMLTraits.cpp index b79d520900d2c..939427d3fc818 100644 --- a/llvm/lib/Support/YAMLTraits.cpp +++ b/llvm/lib/Support/YAMLTraits.cpp @@ -18,6 +18,7 @@ #include "llvm/Support/Format.h" #include "llvm/Support/LineIterator.h" #include "llvm/Support/MemoryBuffer.h" +#include "llvm/Support/VersionTuple.h" #include "llvm/Support/YAMLParser.h" #include "llvm/Support/raw_ostream.h" #include