Skip to content

Commit 0da2ba8

Browse files
authored
[NFC] Cleanup in ADT and Analysis headers. (#104484)
Remove unused directly includes and forward declarations in ADT and Analysis headers.
1 parent 48ae614 commit 0da2ba8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+46
-118
lines changed

llvm/include/llvm/ADT/APFixedPoint.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#define LLVM_ADT_APFIXEDPOINT_H
1818

1919
#include "llvm/ADT/APSInt.h"
20-
#include "llvm/ADT/DenseMapInfo.h"
2120
#include "llvm/ADT/Hashing.h"
2221
#include "llvm/ADT/SmallString.h"
2322
#include "llvm/Support/raw_ostream.h"

llvm/include/llvm/ADT/DynamicAPInt.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@
1818

1919
#include "llvm/ADT/SlowDynamicAPInt.h"
2020
#include "llvm/Support/MathExtras.h"
21-
#include "llvm/Support/raw_ostream.h"
2221
#include <numeric>
2322

2423
namespace llvm {
24+
25+
class raw_ostream;
26+
2527
/// This class provides support for dynamic arbitrary-precision arithmetic.
2628
///
2729
/// Unlike APInt, this extends the precision as necessary to prevent overflows

llvm/include/llvm/ADT/SlowDynamicAPInt.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
#define LLVM_ADT_SLOWDYNAMICAPINT_H
2020

2121
#include "llvm/ADT/APInt.h"
22-
#include "llvm/Support/raw_ostream.h"
2322

2423
namespace llvm {
2524
class DynamicAPInt;
25+
class raw_ostream;
2626
} // namespace llvm
2727

2828
namespace llvm::detail {

llvm/include/llvm/ADT/SmallPtrSet.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#define LLVM_ADT_SMALLPTRSET_H
1717

1818
#include "llvm/ADT/EpochTracker.h"
19-
#include "llvm/Support/Compiler.h"
2019
#include "llvm/Support/MathExtras.h"
2120
#include "llvm/Support/ReverseIteration.h"
2221
#include "llvm/Support/type_traits.h"

llvm/include/llvm/ADT/SmallVector.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#define LLVM_ADT_SMALLVECTOR_H
1616

1717
#include "llvm/Support/Compiler.h"
18-
#include "llvm/Support/type_traits.h"
1918
#include <algorithm>
2019
#include <cassert>
2120
#include <cstddef>

llvm/include/llvm/ADT/Statistic.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
#define LLVM_ADT_STATISTIC_H
2828

2929
#include "llvm/Config/llvm-config.h"
30-
#include "llvm/Support/Compiler.h"
3130
#include <atomic>
3231
#include <memory>
3332
#include <vector>

llvm/include/llvm/Analysis/AliasAnalysis.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
#define LLVM_ANALYSIS_ALIASANALYSIS_H
3939

4040
#include "llvm/ADT/DenseMap.h"
41-
#include "llvm/ADT/Sequence.h"
4241
#include "llvm/ADT/SmallVector.h"
4342
#include "llvm/Analysis/MemoryLocation.h"
4443
#include "llvm/IR/Function.h"
@@ -53,18 +52,14 @@
5352

5453
namespace llvm {
5554

56-
class AnalysisUsage;
5755
class AtomicCmpXchgInst;
5856
class BasicBlock;
5957
class CatchPadInst;
6058
class CatchReturnInst;
6159
class DominatorTree;
6260
class FenceInst;
63-
class Function;
6461
class LoopInfo;
65-
class PreservedAnalyses;
6662
class TargetLibraryInfo;
67-
class Value;
6863

6964
/// The possible results of an alias query.
7065
///

llvm/include/llvm/Analysis/AliasSetTracker.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#include "llvm/ADT/ilist.h"
2424
#include "llvm/ADT/ilist_node.h"
2525
#include "llvm/Analysis/MemoryLocation.h"
26-
#include "llvm/IR/Instruction.h"
2726
#include "llvm/IR/PassManager.h"
2827
#include "llvm/IR/ValueHandle.h"
2928
#include <cassert>
@@ -37,10 +36,12 @@ class AnyMemSetInst;
3736
class AnyMemTransferInst;
3837
class BasicBlock;
3938
class BatchAAResults;
39+
class Function;
40+
class Instruction;
41+
class StoreInst;
4042
class LoadInst;
4143
enum class ModRefInfo : uint8_t;
4244
class raw_ostream;
43-
class StoreInst;
4445
class VAArgInst;
4546
class Value;
4647

llvm/include/llvm/Analysis/AssumeBundleQueries.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ namespace llvm {
2121
class AssumptionCache;
2222
class DominatorTree;
2323
class Instruction;
24-
class Value;
2524

2625
/// Index of elements in the operand bundle.
2726
/// If the element exist it is guaranteed to be what is specified in this enum

llvm/include/llvm/Analysis/BlockFrequencyInfo.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ namespace llvm {
2525

2626
class BasicBlock;
2727
class BranchProbabilityInfo;
28-
class Function;
2928
class LoopInfo;
3029
class Module;
3130
class raw_ostream;

llvm/include/llvm/Analysis/BranchProbabilityInfo.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
#include "llvm/IR/ValueHandle.h"
2323
#include "llvm/Pass.h"
2424
#include "llvm/Support/BranchProbability.h"
25-
#include <algorithm>
2625
#include <cassert>
2726
#include <cstdint>
2827
#include <memory>

llvm/include/llvm/Analysis/CGSCCPassManager.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@
9999
namespace llvm {
100100

101101
class Function;
102-
class Value;
103102
template <typename T, unsigned int N> class SmallPriorityWorklist;
104103
struct CGSCCUpdateResult;
105104

llvm/include/llvm/Analysis/CallGraph.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
#define LLVM_ANALYSIS_CALLGRAPH_H
4747

4848
#include "llvm/IR/InstrTypes.h"
49-
#include "llvm/IR/Intrinsics.h"
5049
#include "llvm/IR/PassManager.h"
5150
#include "llvm/IR/ValueHandle.h"
5251
#include "llvm/Pass.h"

llvm/include/llvm/Analysis/CaptureTracking.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#define LLVM_ANALYSIS_CAPTURETRACKING_H
1515

1616
#include "llvm/ADT/DenseMap.h"
17-
#include "llvm/ADT/STLFunctionalExtras.h"
1817

1918
namespace llvm {
2019

@@ -25,6 +24,7 @@ namespace llvm {
2524
class DominatorTree;
2625
class LoopInfo;
2726
class Function;
27+
template <typename Fn> class function_ref;
2828

2929
/// getDefaultMaxUsesToExploreForCaptureTracking - Return default value of
3030
/// the maximal number of uses to explore before giving up. It is used by

llvm/include/llvm/Analysis/CodeMetrics.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
namespace llvm {
2121
class AssumptionCache;
2222
class BasicBlock;
23-
class Instruction;
2423
class Loop;
2524
class Function;
2625
template <class T> class SmallPtrSetImpl;

llvm/include/llvm/Analysis/ConstraintSystem.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#ifndef LLVM_ANALYSIS_CONSTRAINTSYSTEM_H
1010
#define LLVM_ANALYSIS_CONSTRAINTSYSTEM_H
1111

12-
#include "llvm/ADT/APInt.h"
1312
#include "llvm/ADT/ArrayRef.h"
1413
#include "llvm/ADT/DenseMap.h"
1514
#include "llvm/ADT/SmallVector.h"

llvm/include/llvm/Analysis/CtxProfAnalysis.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
#ifndef LLVM_ANALYSIS_CTXPROFANALYSIS_H
1010
#define LLVM_ANALYSIS_CTXPROFANALYSIS_H
1111

12-
#include "llvm/ADT/DenseMap.h"
13-
#include "llvm/IR/GlobalValue.h"
1412
#include "llvm/IR/PassManager.h"
1513
#include "llvm/ProfileData/PGOCtxProfReader.h"
1614

llvm/include/llvm/Analysis/CycleAnalysis.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
#include "llvm/IR/CycleInfo.h"
1919
#include "llvm/IR/PassManager.h"
20-
#include "llvm/IR/SSAContext.h"
2120
#include "llvm/Pass.h"
2221

2322
namespace llvm {

llvm/include/llvm/Analysis/DXILMetadataAnalysis.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#define LLVM_ANALYSIS_DXILMETADATA_H
1111

1212
#include "llvm/IR/PassManager.h"
13-
#include "llvm/IR/Value.h"
1413
#include "llvm/Pass.h"
1514
#include "llvm/Support/VersionTuple.h"
1615
#include "llvm/TargetParser/Triple.h"

llvm/include/llvm/Analysis/DXILResource.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,17 @@
1010
#define LLVM_ANALYSIS_DXILRESOURCE_H
1111

1212
#include "llvm/ADT/MapVector.h"
13+
#include "llvm/ADT/StringRef.h"
1314
#include "llvm/IR/PassManager.h"
14-
#include "llvm/IR/Value.h"
1515
#include "llvm/Pass.h"
16+
#include "llvm/Support/Alignment.h"
1617
#include "llvm/Support/DXILABI.h"
1718

1819
namespace llvm {
1920
class CallInst;
21+
class LLVMContext;
2022
class MDTuple;
21-
class TargetExtType;
23+
class Value;
2224

2325
namespace dxil {
2426

llvm/include/llvm/Analysis/DomConditionCache.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@
1919

2020
#include "llvm/ADT/ArrayRef.h"
2121
#include "llvm/ADT/DenseMap.h"
22-
#include "llvm/ADT/DenseMapInfo.h"
2322
#include "llvm/ADT/SmallVector.h"
24-
#include "llvm/IR/ValueHandle.h"
2523

2624
namespace llvm {
2725

llvm/include/llvm/Analysis/DomPrinter.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#include "llvm/Analysis/DOTGraphTraitsPass.h"
1818
#include "llvm/Analysis/PostDominators.h"
1919
#include "llvm/IR/Dominators.h"
20-
#include "llvm/IR/PassManager.h"
2120

2221
namespace llvm {
2322

llvm/include/llvm/Analysis/DomTreeUpdater.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,10 @@
1414
#ifndef LLVM_ANALYSIS_DOMTREEUPDATER_H
1515
#define LLVM_ANALYSIS_DOMTREEUPDATER_H
1616

17-
#include "llvm/ADT/SmallPtrSet.h"
1817
#include "llvm/Analysis/GenericDomTreeUpdater.h"
1918
#include "llvm/IR/Dominators.h"
2019
#include "llvm/IR/ValueHandle.h"
2120
#include "llvm/Support/Compiler.h"
22-
#include <cstddef>
2321
#include <functional>
2422
#include <vector>
2523

llvm/include/llvm/Analysis/DominanceFrontier.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#include "llvm/ADT/DenseMap.h"
2121
#include "llvm/ADT/GraphTraits.h"
2222
#include "llvm/ADT/SetVector.h"
23-
#include "llvm/Config/llvm-config.h"
2423
#include "llvm/IR/PassManager.h"
2524
#include "llvm/Pass.h"
2625
#include "llvm/Support/GenericDomTree.h"

llvm/include/llvm/Analysis/FunctionPropertiesAnalysis.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@
1414
#ifndef LLVM_ANALYSIS_FUNCTIONPROPERTIESANALYSIS_H
1515
#define LLVM_ANALYSIS_FUNCTIONPROPERTIESANALYSIS_H
1616

17-
#include "llvm/ADT/iterator_range.h"
18-
#include "llvm/IR/InstrTypes.h"
17+
#include "llvm/ADT/DenseSet.h"
1918
#include "llvm/IR/PassManager.h"
2019

2120
namespace llvm {
21+
class BasicBlock;
22+
class CallBase;
2223
class DominatorTree;
2324
class Function;
2425
class LoopInfo;

llvm/include/llvm/Analysis/IRSimilarityIdentifier.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@
5757
#include <optional>
5858

5959
namespace llvm {
60-
class Module;
6160

6261
namespace IRSimilarity {
6362

llvm/include/llvm/Analysis/IVDescriptors.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ namespace llvm {
2323
class AssumptionCache;
2424
class DemandedBits;
2525
class DominatorTree;
26-
class Instruction;
2726
class Loop;
2827
class PredicatedScalarEvolution;
2928
class ScalarEvolution;

llvm/include/llvm/Analysis/InlineAdvisor.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include "llvm/Analysis/CGSCCPassManager.h"
1313
#include "llvm/Analysis/InlineCost.h"
1414
#include "llvm/Analysis/LazyCallGraph.h"
15-
#include "llvm/Config/llvm-config.h"
1615
#include "llvm/IR/PassManager.h"
1716
#include <memory>
1817

llvm/include/llvm/Analysis/InlineOrder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
#ifndef LLVM_ANALYSIS_INLINEORDER_H
1010
#define LLVM_ANALYSIS_INLINEORDER_H
1111

12-
#include "llvm/ADT/STLFunctionalExtras.h"
1312
#include "llvm/Analysis/InlineCost.h"
1413
#include <utility>
1514

1615
namespace llvm {
1716
class CallBase;
17+
template <typename Fn> class function_ref;
1818

1919
template <typename T> class InlineOrder {
2020
public:

llvm/include/llvm/Analysis/InstructionSimplify.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ namespace llvm {
3939
template <typename T, typename... TArgs> class AnalysisManager;
4040
template <class T> class ArrayRef;
4141
class AssumptionCache;
42-
class BinaryOperator;
4342
class CallBase;
4443
class DataLayout;
4544
class DominatorTree;

llvm/include/llvm/Analysis/InteractiveModelRunner.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@
1313
#include "llvm/Analysis/MLModelRunner.h"
1414
#include "llvm/Analysis/TensorSpec.h"
1515
#include "llvm/Analysis/Utils/TrainingLogger.h"
16-
#include "llvm/Config/llvm-config.h"
17-
#include "llvm/Support/FileSystem.h"
18-
#include "llvm/Support/raw_ostream.h"
1916
#include <system_error>
2017

2118
namespace llvm {

llvm/include/llvm/Analysis/LazyBlockFrequencyInfo.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include "llvm/Pass.h"
2222

2323
namespace llvm {
24-
class AnalysisUsage;
2524
class Function;
2625
class LoopInfo;
2726

@@ -125,5 +124,5 @@ class LazyBlockFrequencyInfoPass : public FunctionPass {
125124

126125
/// Helper for client passes to initialize dependent passes for LBFI.
127126
void initializeLazyBFIPassPass(PassRegistry &Registry);
128-
}
127+
} // namespace llvm
129128
#endif

llvm/include/llvm/Analysis/LazyBranchProbabilityInfo.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#include "llvm/Pass.h"
2121

2222
namespace llvm {
23-
class AnalysisUsage;
2423
class Function;
2524
class LoopInfo;
2625
class TargetLibraryInfo;
@@ -119,5 +118,5 @@ template <> struct BPIPassTrait<LazyBranchProbabilityInfoPass> {
119118
return P->getBPI();
120119
}
121120
};
122-
}
121+
} // namespace llvm
123122
#endif

llvm/include/llvm/Analysis/LazyCallGraph.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,8 @@
5555
namespace llvm {
5656

5757
class Constant;
58-
class Function;
5958
template <class GraphType> struct GraphTraits;
6059
class Module;
61-
class TargetLibraryInfo;
62-
class Value;
6360

6461
/// A lazily constructed view of the call graph of a module.
6562
///
@@ -111,7 +108,6 @@ class LazyCallGraph {
111108
public:
112109
class Node;
113110
class EdgeSequence;
114-
class SCC;
115111
class RefSCC;
116112

117113
/// A class used to represent edges in the call graph.

llvm/include/llvm/Analysis/LazyValueInfo.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,9 @@ namespace llvm {
2222
class AssumptionCache;
2323
class BasicBlock;
2424
class Constant;
25-
class ConstantRange;
2625
class DataLayout;
2726
class DominatorTree;
2827
class Instruction;
29-
class TargetLibraryInfo;
3028
class Value;
3129
class Use;
3230
class LazyValueInfoImpl;

0 commit comments

Comments
 (0)