Index: include/llvm/ADT/APFloat.h =================================================================== --- include/llvm/ADT/APFloat.h +++ include/llvm/ADT/APFloat.h @@ -25,6 +25,8 @@ class APSInt; class StringRef; +template class SmallVectorImpl; + /// Enum that represents what fraction of the LSB truncated bits of an fp number /// represent. /// Index: include/llvm/ADT/APInt.h =================================================================== --- include/llvm/ADT/APInt.h +++ include/llvm/ADT/APInt.h @@ -16,7 +16,6 @@ #ifndef LLVM_ADT_APINT_H #define LLVM_ADT_APINT_H -#include "llvm/ADT/ArrayRef.h" #include "llvm/Support/Compiler.h" #include "llvm/Support/MathExtras.h" #include @@ -31,6 +30,7 @@ class raw_ostream; template class SmallVectorImpl; +template class ArrayRef; // An unsigned host type used as a single part of a multi-part // bignum. Index: include/llvm/ADT/FoldingSet.h =================================================================== --- include/llvm/ADT/FoldingSet.h +++ include/llvm/ADT/FoldingSet.h @@ -17,10 +17,8 @@ #define LLVM_ADT_FOLDINGSET_H #include "llvm/ADT/SmallVector.h" -#include "llvm/ADT/StringRef.h" #include "llvm/ADT/iterator.h" #include "llvm/Support/Allocator.h" -#include "llvm/Support/DataTypes.h" namespace llvm { /// This folding set used for two purposes: @@ -98,6 +96,7 @@ /// The result indicates whether the node existed in the folding set. class FoldingSetNodeID; +class StringRef; //===----------------------------------------------------------------------===// /// FoldingSetImpl - Implements the folding set functionality. The main Index: include/llvm/ADT/SmallBitVector.h =================================================================== --- include/llvm/ADT/SmallBitVector.h +++ include/llvm/ADT/SmallBitVector.h @@ -15,7 +15,6 @@ #define LLVM_ADT_SMALLBITVECTOR_H #include "llvm/ADT/BitVector.h" -#include "llvm/Support/Compiler.h" #include "llvm/Support/MathExtras.h" #include Index: include/llvm/ADT/StringMap.h =================================================================== --- include/llvm/ADT/StringMap.h +++ include/llvm/ADT/StringMap.h @@ -15,7 +15,6 @@ #define LLVM_ADT_STRINGMAP_H #include "llvm/ADT/StringRef.h" -#include "llvm/ADT/Twine.h" #include "llvm/Support/Allocator.h" #include "llvm/Support/PointerLikeTypeTraits.h" #include Index: include/llvm/IR/Comdat.h =================================================================== --- include/llvm/IR/Comdat.h +++ include/llvm/IR/Comdat.h @@ -16,12 +16,10 @@ #ifndef LLVM_IR_COMDAT_H #define LLVM_IR_COMDAT_H -#include "llvm/ADT/StringRef.h" -#include "llvm/Support/Compiler.h" - namespace llvm { class raw_ostream; +class StringRef; template class StringMapEntry; // This is a Name X SelectionKind pair. The reason for having this be an Index: include/llvm/IR/DIBuilder.h =================================================================== --- include/llvm/IR/DIBuilder.h +++ include/llvm/IR/DIBuilder.h @@ -15,8 +15,6 @@ #ifndef LLVM_IR_DIBUILDER_H #define LLVM_IR_DIBUILDER_H -#include "llvm/ADT/ArrayRef.h" -#include "llvm/ADT/StringRef.h" #include "llvm/IR/DebugInfo.h" #include "llvm/IR/TrackingMDRef.h" #include "llvm/IR/ValueHandle.h" @@ -31,6 +29,7 @@ class Constant; class LLVMContext; class StringRef; + template class ArrayRef; class DIBuilder { Module &M; Index: include/llvm/IR/DataLayout.h =================================================================== --- include/llvm/IR/DataLayout.h +++ include/llvm/IR/DataLayout.h @@ -20,7 +20,6 @@ #ifndef LLVM_IR_DATALAYOUT_H #define LLVM_IR_DATALAYOUT_H -#include "llvm/ADT/DenseMap.h" #include "llvm/ADT/SmallVector.h" #include "llvm/IR/DerivedTypes.h" #include "llvm/IR/Type.h" @@ -34,8 +33,6 @@ namespace llvm { class Value; -class Type; -class IntegerType; class StructType; class StructLayout; class Triple; Index: include/llvm/IR/DebugInfo.h =================================================================== --- include/llvm/IR/DebugInfo.h +++ include/llvm/IR/DebugInfo.h @@ -17,10 +17,8 @@ #ifndef LLVM_IR_DEBUGINFO_H #define LLVM_IR_DEBUGINFO_H -#include "llvm/ADT/DenseMap.h" #include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/SmallVector.h" -#include "llvm/ADT/StringRef.h" #include "llvm/ADT/iterator_range.h" #include "llvm/IR/DebugInfoMetadata.h" #include "llvm/Support/Casting.h" @@ -32,6 +30,8 @@ class Module; class DbgDeclareInst; class DbgValueInst; +template +class DenseMap; /// \brief Maps from type identifier to the actual MDNode. typedef DenseMap DITypeIdentifierMap; Index: include/llvm/IR/DebugInfoMetadata.h =================================================================== --- include/llvm/IR/DebugInfoMetadata.h +++ include/llvm/IR/DebugInfoMetadata.h @@ -14,7 +14,6 @@ #ifndef LLVM_IR_DEBUGINFOMETADATA_H #define LLVM_IR_DEBUGINFOMETADATA_H -#include "llvm/ADT/Optional.h" #include "llvm/IR/Metadata.h" #include "llvm/Support/Dwarf.h" @@ -44,6 +43,8 @@ namespace llvm { +template class Optional; + /// \brief Pointer union between a subclass of DINode and MDString. /// /// \a DICompositeType can be referenced via an \a MDString unique identifier. Index: include/llvm/IR/DiagnosticInfo.h =================================================================== --- include/llvm/IR/DiagnosticInfo.h +++ include/llvm/IR/DiagnosticInfo.h @@ -15,7 +15,6 @@ #ifndef LLVM_IR_DIAGNOSTICINFO_H #define LLVM_IR_DIAGNOSTICINFO_H -#include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/Twine.h" #include "llvm/IR/DebugLoc.h" #include "llvm/IR/Module.h" Index: include/llvm/IR/Dominators.h =================================================================== --- include/llvm/IR/Dominators.h +++ include/llvm/IR/Dominators.h @@ -15,23 +15,19 @@ #ifndef LLVM_IR_DOMINATORS_H #define LLVM_IR_DOMINATORS_H -#include "llvm/ADT/DenseMap.h" -#include "llvm/ADT/DepthFirstIterator.h" #include "llvm/ADT/GraphTraits.h" #include "llvm/ADT/SmallPtrSet.h" -#include "llvm/ADT/SmallVector.h" -#include "llvm/IR/BasicBlock.h" #include "llvm/IR/CFG.h" -#include "llvm/IR/Function.h" #include "llvm/IR/PassManager.h" #include "llvm/Pass.h" -#include "llvm/Support/Compiler.h" #include "llvm/Support/GenericDomTree.h" -#include "llvm/Support/raw_ostream.h" -#include namespace llvm { +class Function; +class BasicBlock; +class raw_ostream; + extern template class DomTreeNodeBase; extern template class DominatorTreeBase; Index: include/llvm/IR/Function.h =================================================================== --- include/llvm/IR/Function.h +++ include/llvm/IR/Function.h @@ -19,7 +19,6 @@ #define LLVM_IR_FUNCTION_H #include "llvm/ADT/iterator_range.h" -#include "llvm/ADT/Optional.h" #include "llvm/IR/Argument.h" #include "llvm/IR/Attributes.h" #include "llvm/IR/BasicBlock.h" @@ -30,6 +29,7 @@ namespace llvm { +template class Optional; class FunctionType; class LLVMContext; class DISubprogram; Index: include/llvm/IR/GlobalAlias.h =================================================================== --- include/llvm/IR/GlobalAlias.h +++ include/llvm/IR/GlobalAlias.h @@ -15,12 +15,12 @@ #ifndef LLVM_IR_GLOBALALIAS_H #define LLVM_IR_GLOBALALIAS_H -#include "llvm/ADT/Twine.h" #include "llvm/ADT/ilist_node.h" #include "llvm/IR/GlobalIndirectSymbol.h" namespace llvm { +class Twine; class Module; template class SymbolTableListTraits; Index: include/llvm/IR/GlobalIFunc.h =================================================================== --- include/llvm/IR/GlobalIFunc.h +++ include/llvm/IR/GlobalIFunc.h @@ -18,12 +18,12 @@ #ifndef LLVM_IR_GLOBALIFUNC_H #define LLVM_IR_GLOBALIFUNC_H -#include "llvm/ADT/Twine.h" #include "llvm/ADT/ilist_node.h" #include "llvm/IR/GlobalIndirectSymbol.h" namespace llvm { +class Twine; class Module; // Traits class for using GlobalIFunc in symbol table in Module. Index: include/llvm/IR/GlobalObject.h =================================================================== --- include/llvm/IR/GlobalObject.h +++ include/llvm/IR/GlobalObject.h @@ -15,7 +15,6 @@ #ifndef LLVM_IR_GLOBALOBJECT_H #define LLVM_IR_GLOBALOBJECT_H -#include "llvm/IR/Constant.h" #include "llvm/IR/DerivedTypes.h" #include "llvm/IR/GlobalValue.h" Index: include/llvm/IR/Intrinsics.h =================================================================== --- include/llvm/IR/Intrinsics.h +++ include/llvm/IR/Intrinsics.h @@ -17,6 +17,7 @@ #define LLVM_IR_INTRINSICS_H #include "llvm/ADT/ArrayRef.h" +#include "llvm/ADT/None.h" #include namespace llvm { Index: include/llvm/IR/LLVMContext.h =================================================================== --- include/llvm/IR/LLVMContext.h +++ include/llvm/IR/LLVMContext.h @@ -16,7 +16,6 @@ #define LLVM_IR_LLVMCONTEXT_H #include "llvm/Support/CBindingWrapping.h" -#include "llvm/Support/Compiler.h" #include "llvm/Support/Options.h" namespace llvm { Index: include/llvm/IR/LegacyPassManagers.h =================================================================== --- include/llvm/IR/LegacyPassManagers.h +++ include/llvm/IR/LegacyPassManagers.h @@ -14,7 +14,6 @@ #ifndef LLVM_IR_LEGACYPASSMANAGERS_H #define LLVM_IR_LEGACYPASSMANAGERS_H -#include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/FoldingSet.h" #include "llvm/ADT/SmallPtrSet.h" @@ -93,12 +92,13 @@ #include "llvm/Support/PrettyStackTrace.h" namespace llvm { - class Module; - class Pass; - class StringRef; - class Value; - class Timer; - class PMDataManager; +template class ArrayRef; +class Module; +class Pass; +class StringRef; +class Value; +class Timer; +class PMDataManager; // enums for debugging strings enum PassDebuggingString { Index: include/llvm/IR/Mangler.h =================================================================== --- include/llvm/IR/Mangler.h +++ include/llvm/IR/Mangler.h @@ -16,13 +16,13 @@ #include "llvm/ADT/DenseMap.h" #include "llvm/IR/GlobalValue.h" -#include "llvm/Support/raw_ostream.h" namespace llvm { class DataLayout; template class SmallVectorImpl; class Twine; +class raw_ostream; class Mangler { /// We need to give global values the same name every time they are mangled. Index: include/llvm/IR/Module.h =================================================================== --- include/llvm/IR/Module.h +++ include/llvm/IR/Module.h @@ -15,7 +15,6 @@ #ifndef LLVM_IR_MODULE_H #define LLVM_IR_MODULE_H -#include "llvm/ADT/Optional.h" #include "llvm/ADT/iterator_range.h" #include "llvm/IR/Comdat.h" #include "llvm/IR/DataLayout.h" @@ -30,6 +29,7 @@ #include namespace llvm { +template class Optional; class FunctionType; class GVMaterializer; class LLVMContext; Index: include/llvm/IR/ModuleSummaryIndex.h =================================================================== --- include/llvm/IR/ModuleSummaryIndex.h +++ include/llvm/IR/ModuleSummaryIndex.h @@ -22,10 +22,7 @@ #include "llvm/ADT/SmallString.h" #include "llvm/ADT/StringExtras.h" #include "llvm/ADT/StringMap.h" -#include "llvm/IR/Function.h" #include "llvm/IR/Module.h" -#include "llvm/Support/MemoryBuffer.h" -#include "llvm/Support/raw_ostream.h" #include Index: include/llvm/IR/PassManager.h =================================================================== --- include/llvm/IR/PassManager.h +++ include/llvm/IR/PassManager.h @@ -44,7 +44,6 @@ #include "llvm/IR/Function.h" #include "llvm/IR/Module.h" #include "llvm/IR/PassManagerInternal.h" -#include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" #include "llvm/Support/TypeName.h" #include "llvm/Support/raw_ostream.h" @@ -55,9 +54,6 @@ namespace llvm { -class Module; -class Function; - /// \brief An abstract set of preserved analyses following a transformation pass /// run. /// Index: include/llvm/IR/TrackingMDRef.h =================================================================== --- include/llvm/IR/TrackingMDRef.h +++ include/llvm/IR/TrackingMDRef.h @@ -15,7 +15,6 @@ #define LLVM_IR_TRACKINGMDREF_H #include "llvm/IR/Metadata.h" -#include "llvm/Support/Casting.h" namespace llvm { Index: include/llvm/IR/Type.h =================================================================== --- include/llvm/IR/Type.h +++ include/llvm/IR/Type.h @@ -16,6 +16,7 @@ #define LLVM_IR_TYPE_H #include "llvm/ADT/APFloat.h" +#include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/SmallPtrSet.h" #include "llvm/Support/CBindingWrapping.h" #include "llvm/Support/Casting.h" Index: include/llvm/IR/Use.h =================================================================== --- include/llvm/IR/Use.h +++ include/llvm/IR/Use.h @@ -27,7 +27,6 @@ #include "llvm/ADT/PointerIntPair.h" #include "llvm/Support/CBindingWrapping.h" -#include "llvm/Support/Compiler.h" #include #include Index: include/llvm/IR/UseListOrder.h =================================================================== --- include/llvm/IR/UseListOrder.h +++ include/llvm/IR/UseListOrder.h @@ -15,8 +15,6 @@ #ifndef LLVM_IR_USELISTORDER_H #define LLVM_IR_USELISTORDER_H -#include "llvm/ADT/ArrayRef.h" -#include "llvm/ADT/SmallVector.h" #include namespace llvm { Index: include/llvm/IR/User.h =================================================================== --- include/llvm/IR/User.h +++ include/llvm/IR/User.h @@ -19,7 +19,6 @@ #ifndef LLVM_IR_USER_H #define LLVM_IR_USER_H -#include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/iterator.h" #include "llvm/ADT/iterator_range.h" #include "llvm/IR/Value.h" @@ -28,6 +27,9 @@ namespace llvm { +template class ArrayRef; +template class MutableArrayRef; + /// \brief Compile-time customization of User operands. /// /// Customizes operand-related allocators and accessors. Index: include/llvm/IR/Value.h =================================================================== --- include/llvm/IR/Value.h +++ include/llvm/IR/Value.h @@ -18,7 +18,6 @@ #include "llvm/IR/Use.h" #include "llvm/Support/CBindingWrapping.h" #include "llvm/Support/Casting.h" -#include "llvm/Support/Compiler.h" namespace llvm { Index: include/llvm/IR/ValueSymbolTable.h =================================================================== --- include/llvm/IR/ValueSymbolTable.h +++ include/llvm/IR/ValueSymbolTable.h @@ -14,13 +14,13 @@ #ifndef LLVM_IR_VALUESYMBOLTABLE_H #define LLVM_IR_VALUESYMBOLTABLE_H -#include "llvm/ADT/SmallString.h" #include "llvm/ADT/StringMap.h" #include "llvm/IR/Value.h" #include "llvm/Support/DataTypes.h" namespace llvm { template class SymbolTableListTraits; + template class SmallString; class BasicBlock; class Function; class NamedMDNode; Index: include/llvm/IR/Verifier.h =================================================================== --- include/llvm/IR/Verifier.h +++ include/llvm/IR/Verifier.h @@ -21,9 +21,7 @@ #ifndef LLVM_IR_VERIFIER_H #define LLVM_IR_VERIFIER_H -#include "llvm/ADT/StringRef.h" #include "llvm/IR/PassManager.h" -#include namespace llvm { Index: include/llvm/MC/MCParser/MCAsmLexer.h =================================================================== --- include/llvm/MC/MCParser/MCAsmLexer.h +++ include/llvm/MC/MCParser/MCAsmLexer.h @@ -11,6 +11,8 @@ #define LLVM_MC_MCPARSER_MCASMLEXER_H #include "llvm/ADT/APInt.h" +#include "llvm/ADT/ArrayRef.h" +#include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringRef.h" #include "llvm/Support/Compiler.h" #include "llvm/Support/DataTypes.h" Index: lib/CodeGen/MIRParser/MILexer.cpp =================================================================== --- lib/CodeGen/MIRParser/MILexer.cpp +++ lib/CodeGen/MIRParser/MILexer.cpp @@ -12,6 +12,7 @@ //===----------------------------------------------------------------------===// #include "MILexer.h" +#include "llvm/ADT/None.h" #include "llvm/ADT/StringExtras.h" #include "llvm/ADT/StringSwitch.h" #include "llvm/ADT/Twine.h" Index: lib/CodeGen/RegAllocFast.cpp =================================================================== --- lib/CodeGen/RegAllocFast.cpp +++ lib/CodeGen/RegAllocFast.cpp @@ -12,7 +12,6 @@ // //===----------------------------------------------------------------------===// -#include "llvm/CodeGen/Passes.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/IndexedMap.h" #include "llvm/ADT/STLExtras.h" @@ -25,13 +24,11 @@ #include "llvm/CodeGen/MachineInstr.h" #include "llvm/CodeGen/MachineInstrBuilder.h" #include "llvm/CodeGen/MachineRegisterInfo.h" +#include "llvm/CodeGen/Passes.h" #include "llvm/CodeGen/RegAllocRegistry.h" #include "llvm/CodeGen/RegisterClassInfo.h" -#include "llvm/IR/BasicBlock.h" -#include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" #include "llvm/Support/ErrorHandling.h" -#include "llvm/Support/raw_ostream.h" #include "llvm/Target/TargetInstrInfo.h" #include "llvm/Target/TargetSubtargetInfo.h" #include Index: lib/Support/APFloat.cpp =================================================================== --- lib/Support/APFloat.cpp +++ lib/Support/APFloat.cpp @@ -14,6 +14,7 @@ #include "llvm/ADT/APFloat.h" #include "llvm/ADT/APSInt.h" +#include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/FoldingSet.h" #include "llvm/ADT/Hashing.h" #include "llvm/ADT/StringExtras.h" Index: lib/Support/APInt.cpp =================================================================== --- lib/Support/APInt.cpp +++ lib/Support/APInt.cpp @@ -13,6 +13,7 @@ //===----------------------------------------------------------------------===// #include "llvm/ADT/APInt.h" +#include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/FoldingSet.h" #include "llvm/ADT/Hashing.h" #include "llvm/ADT/SmallString.h" Index: lib/Support/APSInt.cpp =================================================================== --- lib/Support/APSInt.cpp +++ lib/Support/APSInt.cpp @@ -14,6 +14,7 @@ #include "llvm/ADT/APSInt.h" #include "llvm/ADT/FoldingSet.h" +#include "llvm/ADT/StringRef.h" using namespace llvm; Index: lib/Support/ScaledNumber.cpp =================================================================== --- lib/Support/ScaledNumber.cpp +++ lib/Support/ScaledNumber.cpp @@ -13,6 +13,7 @@ #include "llvm/Support/ScaledNumber.h" #include "llvm/ADT/APFloat.h" +#include "llvm/ADT/ArrayRef.h" #include "llvm/Support/Debug.h" #include "llvm/Support/raw_ostream.h" Index: unittests/ADT/APIntTest.cpp =================================================================== --- unittests/ADT/APIntTest.cpp +++ unittests/ADT/APIntTest.cpp @@ -8,10 +8,10 @@ //===----------------------------------------------------------------------===// #include "llvm/ADT/APInt.h" +#include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/SmallString.h" #include "gtest/gtest.h" #include -#include using namespace llvm; Index: unittests/ADT/StringMapTest.cpp =================================================================== --- unittests/ADT/StringMapTest.cpp +++ unittests/ADT/StringMapTest.cpp @@ -7,9 +7,10 @@ // //===----------------------------------------------------------------------===// -#include "gtest/gtest.h" #include "llvm/ADT/StringMap.h" +#include "llvm/ADT/Twine.h" #include "llvm/Support/DataTypes.h" +#include "gtest/gtest.h" #include using namespace llvm;