Skip to content

Commit

Permalink
[NFC] Header cleanup
Browse files Browse the repository at this point in the history
Removed some unused headers, replaced some headers with forward class declarations.

Found using simple scripts like this one:
clear && ack --cpp -l '#include "llvm/ADT/IndexedMap.h"' | xargs grep -L 'IndexedMap[<]' | xargs grep -n --color=auto 'IndexedMap'

Patch by Eugene Kosov <[email protected]>

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

From: Mehdi Amini <[email protected]>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266595 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
joker-eph committed Apr 18, 2016
1 parent 8149973 commit f6071e1
Show file tree
Hide file tree
Showing 360 changed files with 197 additions and 546 deletions.
1 change: 0 additions & 1 deletion include/llvm/ADT/Hashing.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
#include <algorithm>
#include <cassert>
#include <cstring>
#include <iterator>
#include <string>
#include <utility>

Expand Down
1 change: 0 additions & 1 deletion include/llvm/Analysis/AliasAnalysis.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
#ifndef LLVM_ANALYSIS_ALIASANALYSIS_H
#define LLVM_ANALYSIS_ALIASANALYSIS_H

#include "llvm/ADT/DenseMap.h"
#include "llvm/IR/CallSite.h"
#include "llvm/IR/Metadata.h"
#include "llvm/IR/PassManager.h"
Expand Down
2 changes: 1 addition & 1 deletion include/llvm/Analysis/DependenceAnalysis.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@
#define LLVM_ANALYSIS_DEPENDENCEANALYSIS_H

#include "llvm/ADT/SmallBitVector.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/IR/Instructions.h"
#include "llvm/Pass.h"

namespace llvm {
template <typename T> class ArrayRef;
class Loop;
class LoopInfo;
class ScalarEvolution;
Expand Down
1 change: 0 additions & 1 deletion include/llvm/Analysis/IteratedDominanceFrontier.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#ifndef LLVM_ANALYSIS_IDF_H
#define LLVM_ANALYSIS_IDF_H

#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
Expand Down
2 changes: 1 addition & 1 deletion include/llvm/Analysis/MemoryLocation.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#ifndef LLVM_ANALYSIS_MEMORYLOCATION_H
#define LLVM_ANALYSIS_MEMORYLOCATION_H

#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/DenseMapInfo.h"
#include "llvm/IR/CallSite.h"
#include "llvm/IR/Metadata.h"

Expand Down
1 change: 0 additions & 1 deletion include/llvm/Analysis/RegionInfoImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include "llvm/Analysis/PostDominators.h"
#include "llvm/Analysis/RegionInfo.h"
#include "llvm/Analysis/RegionIterator.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include <algorithm>
Expand Down
3 changes: 1 addition & 2 deletions include/llvm/Analysis/ScalarEvolution.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include "llvm/ADT/SetVector.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/IR/ConstantRange.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Operator.h"
#include "llvm/IR/PassManager.h"
Expand All @@ -35,7 +34,6 @@
#include "llvm/Pass.h"
#include "llvm/Support/Allocator.h"
#include "llvm/Support/DataTypes.h"
#include <map>

namespace llvm {
class APInt;
Expand All @@ -55,6 +53,7 @@ namespace llvm {
class SCEVExpander;
class SCEVPredicate;
class SCEVUnknown;
class Function;

template <> struct FoldingSetTrait<SCEV>;
template <> struct FoldingSetTrait<SCEVPredicate>;
Expand Down
3 changes: 2 additions & 1 deletion include/llvm/Analysis/TargetLibraryInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#define LLVM_ANALYSIS_TARGETLIBRARYINFO_H

#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/Triple.h"
#include "llvm/IR/Function.h"
Expand All @@ -20,6 +19,8 @@
#include "llvm/Pass.h"

namespace llvm {
template <typename T> class ArrayRef;

/// Describes a possible vectorization of a function.
/// Function 'VectorFnName' is equivalent to 'ScalarFnName' vectorized
/// by a factor 'VectorizationFactor'.
Expand Down
2 changes: 1 addition & 1 deletion include/llvm/Analysis/ValueTracking.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
#ifndef LLVM_ANALYSIS_VALUETRACKING_H
#define LLVM_ANALYSIS_VALUETRACKING_H

#include "llvm/ADT/ArrayRef.h"
#include "llvm/IR/ConstantRange.h"
#include "llvm/IR/Instruction.h"
#include "llvm/Support/DataTypes.h"

namespace llvm {
template <typename T> class ArrayRef;
class APInt;
class AddOperator;
class AssumptionCache;
Expand Down
2 changes: 1 addition & 1 deletion include/llvm/Analysis/VectorUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
#ifndef LLVM_TRANSFORMS_UTILS_VECTORUTILS_H
#define LLVM_TRANSFORMS_UTILS_VECTORUTILS_H

#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/MapVector.h"
#include "llvm/Analysis/TargetLibraryInfo.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/Intrinsics.h"

namespace llvm {

template <typename T> class ArrayRef;
struct DemandedBits;
class GetElementPtrInst;
class Loop;
Expand Down
1 change: 0 additions & 1 deletion include/llvm/CodeGen/DIE.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include "llvm/ADT/SmallVector.h"
#include "llvm/CodeGen/DwarfStringPoolEntry.h"
#include "llvm/Support/Dwarf.h"
#include <vector>

namespace llvm {
class AsmPrinter;
Expand Down
1 change: 0 additions & 1 deletion include/llvm/CodeGen/FaultMaps.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#ifndef LLVM_CODEGEN_FAULTMAPS_H
#define LLVM_CODEGEN_FAULTMAPS_H

#include "llvm/ADT/DenseMap.h"
#include "llvm/MC/MCSymbol.h"
#include "llvm/Support/Endian.h"
#include "llvm/Support/Format.h"
Expand Down
1 change: 0 additions & 1 deletion include/llvm/CodeGen/GlobalISel/Types.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#define LLVM_CODEGEN_GLOBALISEL_TYPES_H

#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/IR/Value.h"

namespace llvm {
Expand Down
1 change: 0 additions & 1 deletion include/llvm/CodeGen/LiveIntervalAnalysis.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
#include "llvm/Support/CommandLine.h"
#include "llvm/Target/TargetRegisterInfo.h"
#include <cmath>
#include <iterator>

namespace llvm {

Expand Down
2 changes: 1 addition & 1 deletion include/llvm/CodeGen/MIRParser/MIRParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
#ifndef LLVM_CODEGEN_MIRPARSER_MIRPARSER_H
#define LLVM_CODEGEN_MIRPARSER_MIRPARSER_H

#include "llvm/ADT/StringRef.h"
#include "llvm/CodeGen/MachineFunctionInitializer.h"
#include "llvm/IR/Module.h"
#include "llvm/Support/MemoryBuffer.h"
#include <memory>

namespace llvm {

class StringRef;
class MIRParserImpl;
class SMDiagnostic;

Expand Down
4 changes: 2 additions & 2 deletions include/llvm/CodeGen/MachineInstr.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@
#ifndef LLVM_CODEGEN_MACHINEINSTR_H
#define LLVM_CODEGEN_MACHINEINSTR_H

#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/DenseMapInfo.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/ilist.h"
#include "llvm/ADT/ilist_node.h"
#include "llvm/ADT/iterator_range.h"
Expand All @@ -33,6 +31,8 @@

namespace llvm {

class StringRef;
template <typename T> class ArrayRef;
template <typename T> class SmallVectorImpl;
class DILocalVariable;
class DIExpression;
Expand Down
1 change: 0 additions & 1 deletion include/llvm/CodeGen/MachineSSAUpdater.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#ifndef LLVM_CODEGEN_MACHINESSAUPDATER_H
#define LLVM_CODEGEN_MACHINESSAUPDATER_H

#include "llvm/Support/Allocator.h"
#include "llvm/Support/Compiler.h"

namespace llvm {
Expand Down
5 changes: 0 additions & 5 deletions include/llvm/CodeGen/PBQP/Graph.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,7 @@
#ifndef LLVM_CODEGEN_PBQP_GRAPH_H
#define LLVM_CODEGEN_PBQP_GRAPH_H

#include "llvm/ADT/ilist.h"
#include "llvm/ADT/ilist_node.h"
#include "llvm/Support/Debug.h"
#include <list>
#include <map>
#include <set>
#include <vector>

namespace llvm {
Expand Down
2 changes: 1 addition & 1 deletion include/llvm/CodeGen/ParallelCG.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
#ifndef LLVM_CODEGEN_PARALLELCG_H
#define LLVM_CODEGEN_PARALLELCG_H

#include "llvm/ADT/ArrayRef.h"
#include "llvm/Support/CodeGen.h"
#include "llvm/Target/TargetMachine.h"

#include <functional>

namespace llvm {

template <typename T> class ArrayRef;
class Module;
class TargetOptions;
class raw_pwrite_stream;
Expand Down
1 change: 1 addition & 0 deletions include/llvm/CodeGen/RegAllocPBQP.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "llvm/CodeGen/PBQP/ReductionRules.h"
#include "llvm/CodeGen/PBQPRAConstraint.h"
#include "llvm/Support/ErrorHandling.h"
#include <set>

namespace llvm {

Expand Down
2 changes: 0 additions & 2 deletions include/llvm/CodeGen/StackMaps.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
#include "llvm/ADT/SmallVector.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/MC/MCSymbol.h"
#include "llvm/Support/Debug.h"
#include <map>
#include <vector>

namespace llvm {
Expand Down
1 change: 0 additions & 1 deletion include/llvm/CodeGen/TargetLoweringObjectFileImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#ifndef LLVM_CODEGEN_TARGETLOWERINGOBJECTFILEIMPL_H
#define LLVM_CODEGEN_TARGETLOWERINGOBJECTFILEIMPL_H

#include "llvm/ADT/StringRef.h"
#include "llvm/MC/SectionKind.h"
#include "llvm/Target/TargetLoweringObjectFile.h"

Expand Down
3 changes: 2 additions & 1 deletion include/llvm/DebugInfo/CodeView/TypeSymbolEmitter.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@
#ifndef LLVM_DEBUGINFO_CODEVIEW_TYPESYMBOLEMITTER_H
#define LLVM_DEBUGINFO_CODEVIEW_TYPESYMBOLEMITTER_H

#include "llvm/ADT/StringRef.h"
#include "llvm/DebugInfo/CodeView/CodeView.h"
#include "llvm/DebugInfo/CodeView/TypeIndex.h"

namespace llvm {
class StringRef;

namespace codeview {

class TypeSymbolEmitter {
Expand Down
4 changes: 3 additions & 1 deletion include/llvm/DebugInfo/CodeView/TypeTableBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@
#ifndef LLVM_DEBUGINFO_CODEVIEW_TYPETABLEBUILDER_H
#define LLVM_DEBUGINFO_CODEVIEW_TYPETABLEBUILDER_H

#include "llvm/ADT/StringRef.h"
#include "llvm/DebugInfo/CodeView/CodeView.h"
#include "llvm/DebugInfo/CodeView/TypeIndex.h"
#include "llvm/DebugInfo/CodeView/TypeRecord.h"
#include "llvm/Support/Compiler.h"

namespace llvm {

class StringRef;

namespace codeview {

class FieldListRecordBuilder;
Expand Down
1 change: 0 additions & 1 deletion include/llvm/DebugInfo/DIContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#ifndef LLVM_DEBUGINFO_DICONTEXT_H
#define LLVM_DEBUGINFO_DICONTEXT_H

#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/Object/ObjectFile.h"
#include "llvm/Object/RelocVisitor.h"
Expand Down
1 change: 0 additions & 1 deletion include/llvm/DebugInfo/DWARF/DWARFContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include "llvm/DebugInfo/DWARF/DWARFDebugRangeList.h"
#include "llvm/DebugInfo/DWARF/DWARFSection.h"
#include "llvm/DebugInfo/DWARF/DWARFTypeUnit.h"
#include <vector>

namespace llvm {

Expand Down
1 change: 0 additions & 1 deletion include/llvm/DebugInfo/DWARF/DWARFDebugAbbrev.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#define LLVM_LIB_DEBUGINFO_DWARFDEBUGABBREV_H

#include "llvm/DebugInfo/DWARF/DWARFAbbreviationDeclaration.h"
#include <list>
#include <map>
#include <vector>

Expand Down
1 change: 0 additions & 1 deletion include/llvm/DebugInfo/DWARF/DWARFDebugMacro.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#define LLVM_DEBUGINFO_DWARF_DWARFDEBUGMACRO_H

#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/DataExtractor.h"
#include "llvm/Support/Dwarf.h"

Expand Down
2 changes: 1 addition & 1 deletion include/llvm/DebugInfo/DWARF/DWARFFormValue.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
#ifndef LLVM_DEBUGINFO_DWARFFORMVALUE_H
#define LLVM_DEBUGINFO_DWARFFORMVALUE_H

#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/Optional.h"
#include "llvm/Support/DataExtractor.h"

namespace llvm {

template <typename T> class ArrayRef;
class DWARFUnit;
class raw_ostream;

Expand Down
3 changes: 2 additions & 1 deletion include/llvm/DebugInfo/PDB/DIA/DIASession.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@
#define LLVM_DEBUGINFO_PDB_DIA_DIASESSION_H

#include "DIASupport.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/DebugInfo/PDB/IPDBSession.h"

namespace llvm {
class StringRef;

class DIASession : public IPDBSession {
public:
explicit DIASession(CComPtr<IDiaSession> DiaSession);
Expand Down
3 changes: 1 addition & 2 deletions include/llvm/DebugInfo/PDB/PDBSymbol.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
#include "PDBExtras.h"
#include "PDBTypes.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Casting.h"
#include <unordered_map>

#define FORWARD_SYMBOL_METHOD(MethodName) \
auto MethodName() const->decltype(RawSymbol->MethodName()) { \
Expand All @@ -26,6 +24,7 @@

namespace llvm {

class StringRef;
class IPDBRawSymbol;
class raw_ostream;

Expand Down
1 change: 0 additions & 1 deletion include/llvm/DebugInfo/PDB/PDBSymbolAnnotation.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

#include "PDBSymbol.h"
#include "PDBTypes.h"
#include <string>

namespace llvm {

Expand Down
1 change: 0 additions & 1 deletion include/llvm/DebugInfo/PDB/PDBSymbolBlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

#include "PDBSymbol.h"
#include "PDBTypes.h"
#include <string>

namespace llvm {

Expand Down
1 change: 0 additions & 1 deletion include/llvm/DebugInfo/PDB/PDBSymbolExe.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

#include "PDBSymbol.h"
#include "PDBTypes.h"
#include <string>

namespace llvm {

Expand Down
1 change: 0 additions & 1 deletion include/llvm/DebugInfo/PDB/PDBSymbolThunk.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

#include "PDBSymbol.h"
#include "PDBTypes.h"
#include <string>

namespace llvm {

Expand Down
Loading

0 comments on commit f6071e1

Please sign in to comment.