Skip to content

Commit

Permalink
Remove some unneeded headers and replace some headers with forward cl…
Browse files Browse the repository at this point in the history
…ass declarations (NFC)

Differential Revision: http://reviews.llvm.org/D19154

Patch by Eugene Kosov <claprix@yandex.ru>

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 266524
  • Loading branch information
joker-eph committed Apr 16, 2016
1 parent 1d30fca commit 47b292d
Show file tree
Hide file tree
Showing 40 changed files with 43 additions and 61 deletions.
2 changes: 2 additions & 0 deletions llvm/include/llvm/ADT/APFloat.h
Expand Up @@ -25,6 +25,8 @@ struct fltSemantics;
class APSInt;
class StringRef;

template <typename T> class SmallVectorImpl;

/// Enum that represents what fraction of the LSB truncated bits of an fp number
/// represent.
///
Expand Down
2 changes: 1 addition & 1 deletion llvm/include/llvm/ADT/APInt.h
Expand Up @@ -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 <cassert>
Expand All @@ -31,6 +30,7 @@ class hash_code;
class raw_ostream;

template <typename T> class SmallVectorImpl;
template <typename T> class ArrayRef;

// An unsigned host type used as a single part of a multi-part
// bignum.
Expand Down
3 changes: 1 addition & 2 deletions llvm/include/llvm/ADT/FoldingSet.h
Expand Up @@ -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:
Expand Down Expand Up @@ -98,6 +96,7 @@ namespace llvm {
/// The result indicates whether the node existed in the folding set.

class FoldingSetNodeID;
class StringRef;

//===----------------------------------------------------------------------===//
/// FoldingSetImpl - Implements the folding set functionality. The main
Expand Down
1 change: 0 additions & 1 deletion llvm/include/llvm/ADT/SmallBitVector.h
Expand Up @@ -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 <cassert>

Expand Down
1 change: 0 additions & 1 deletion llvm/include/llvm/ADT/StringMap.h
Expand Up @@ -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 <cstring>
Expand Down
4 changes: 1 addition & 3 deletions llvm/include/llvm/IR/Comdat.h
Expand Up @@ -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 <typename ValueTy> class StringMapEntry;

// This is a Name X SelectionKind pair. The reason for having this be an
Expand Down
3 changes: 1 addition & 2 deletions llvm/include/llvm/IR/DIBuilder.h
Expand Up @@ -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"
Expand All @@ -31,6 +29,7 @@ namespace llvm {
class Constant;
class LLVMContext;
class StringRef;
template <typename T> class ArrayRef;

class DIBuilder {
Module &M;
Expand Down
3 changes: 0 additions & 3 deletions llvm/include/llvm/IR/DataLayout.h
Expand Up @@ -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"
Expand All @@ -34,8 +33,6 @@ typedef struct LLVMOpaqueTargetData *LLVMTargetDataRef;
namespace llvm {

class Value;
class Type;
class IntegerType;
class StructType;
class StructLayout;
class Triple;
Expand Down
4 changes: 2 additions & 2 deletions llvm/include/llvm/IR/DebugInfo.h
Expand Up @@ -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"
Expand All @@ -32,6 +30,8 @@ namespace llvm {
class Module;
class DbgDeclareInst;
class DbgValueInst;
template <typename K, typename V, typename KeyInfoT, typename BucketT>
class DenseMap;

/// \brief Maps from type identifier to the actual MDNode.
typedef DenseMap<const MDString *, DIType *> DITypeIdentifierMap;
Expand Down
3 changes: 2 additions & 1 deletion llvm/include/llvm/IR/DebugInfoMetadata.h
Expand Up @@ -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"

Expand Down Expand Up @@ -44,6 +43,8 @@

namespace llvm {

template <typename T> class Optional;

/// \brief Pointer union between a subclass of DINode and MDString.
///
/// \a DICompositeType can be referenced via an \a MDString unique identifier.
Expand Down
1 change: 0 additions & 1 deletion llvm/include/llvm/IR/DiagnosticInfo.h
Expand Up @@ -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"
Expand Down
12 changes: 4 additions & 8 deletions llvm/include/llvm/IR/Dominators.h
Expand Up @@ -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 <algorithm>

namespace llvm {

class Function;
class BasicBlock;
class raw_ostream;

extern template class DomTreeNodeBase<BasicBlock>;
extern template class DominatorTreeBase<BasicBlock>;

Expand Down
2 changes: 1 addition & 1 deletion llvm/include/llvm/IR/Function.h
Expand Up @@ -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"
Expand All @@ -30,6 +29,7 @@

namespace llvm {

template <typename T> class Optional;
class FunctionType;
class LLVMContext;
class DISubprogram;
Expand Down
2 changes: 1 addition & 1 deletion llvm/include/llvm/IR/GlobalAlias.h
Expand Up @@ -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 <typename ValueSubClass> class SymbolTableListTraits;

Expand Down
2 changes: 1 addition & 1 deletion llvm/include/llvm/IR/GlobalIFunc.h
Expand Up @@ -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.
Expand Down
1 change: 0 additions & 1 deletion llvm/include/llvm/IR/GlobalObject.h
Expand Up @@ -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"

Expand Down
1 change: 1 addition & 0 deletions llvm/include/llvm/IR/Intrinsics.h
Expand Up @@ -17,6 +17,7 @@
#define LLVM_IR_INTRINSICS_H

#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/None.h"
#include <string>

namespace llvm {
Expand Down
1 change: 0 additions & 1 deletion llvm/include/llvm/IR/LLVMContext.h
Expand Up @@ -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 {
Expand Down
14 changes: 7 additions & 7 deletions llvm/include/llvm/IR/LegacyPassManagers.h
Expand Up @@ -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"
Expand Down Expand Up @@ -93,12 +92,13 @@
#include "llvm/Support/PrettyStackTrace.h"

namespace llvm {
class Module;
class Pass;
class StringRef;
class Value;
class Timer;
class PMDataManager;
template <typename T> class ArrayRef;
class Module;
class Pass;
class StringRef;
class Value;
class Timer;
class PMDataManager;

// enums for debugging strings
enum PassDebuggingString {
Expand Down
2 changes: 1 addition & 1 deletion llvm/include/llvm/IR/Mangler.h
Expand Up @@ -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 <typename T> class SmallVectorImpl;
class Twine;
class raw_ostream;

class Mangler {
/// We need to give global values the same name every time they are mangled.
Expand Down
2 changes: 1 addition & 1 deletion llvm/include/llvm/IR/Module.h
Expand Up @@ -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"
Expand All @@ -30,6 +29,7 @@
#include <system_error>

namespace llvm {
template <typename T> class Optional;
class FunctionType;
class GVMaterializer;
class LLVMContext;
Expand Down
3 changes: 0 additions & 3 deletions llvm/include/llvm/IR/ModuleSummaryIndex.h
Expand Up @@ -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 <array>

Expand Down
4 changes: 0 additions & 4 deletions llvm/include/llvm/IR/PassManager.h
Expand Up @@ -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"
Expand All @@ -55,9 +54,6 @@

namespace llvm {

class Module;
class Function;

/// \brief An abstract set of preserved analyses following a transformation pass
/// run.
///
Expand Down
1 change: 0 additions & 1 deletion llvm/include/llvm/IR/TrackingMDRef.h
Expand Up @@ -15,7 +15,6 @@
#define LLVM_IR_TRACKINGMDREF_H

#include "llvm/IR/Metadata.h"
#include "llvm/Support/Casting.h"

namespace llvm {

Expand Down
1 change: 1 addition & 0 deletions llvm/include/llvm/IR/Type.h
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion llvm/include/llvm/IR/Use.h
Expand Up @@ -27,7 +27,6 @@

#include "llvm/ADT/PointerIntPair.h"
#include "llvm/Support/CBindingWrapping.h"
#include "llvm/Support/Compiler.h"
#include <cstddef>
#include <iterator>

Expand Down
2 changes: 0 additions & 2 deletions llvm/include/llvm/IR/UseListOrder.h
Expand Up @@ -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 <vector>

namespace llvm {
Expand Down
4 changes: 3 additions & 1 deletion llvm/include/llvm/IR/User.h
Expand Up @@ -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"
Expand All @@ -28,6 +27,9 @@

namespace llvm {

template <typename T> class ArrayRef;
template <typename T> class MutableArrayRef;

/// \brief Compile-time customization of User operands.
///
/// Customizes operand-related allocators and accessors.
Expand Down
1 change: 0 additions & 1 deletion llvm/include/llvm/IR/Value.h
Expand Up @@ -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 {

Expand Down

0 comments on commit 47b292d

Please sign in to comment.