Skip to content

Commit c0866ce

Browse files
authored
[IR] Remove Function.h include from Analysis.h (NFC) (llvm#97056)
Use a forward-declaration instead.
1 parent 3106e97 commit c0866ce

31 files changed

+38
-1
lines changed

llvm/include/llvm/Analysis/AliasAnalysis.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
#include "llvm/ADT/Sequence.h"
4242
#include "llvm/ADT/SmallVector.h"
4343
#include "llvm/Analysis/MemoryLocation.h"
44+
#include "llvm/IR/Function.h"
4445
#include "llvm/IR/PassManager.h"
4546
#include "llvm/Pass.h"
4647
#include "llvm/Support/ModRef.h"

llvm/include/llvm/Analysis/Delinearization.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ namespace llvm {
2222
class raw_ostream;
2323
template <typename T> class SmallVectorImpl;
2424
class GetElementPtrInst;
25+
class Instruction;
2526
class ScalarEvolution;
2627
class SCEV;
2728

llvm/include/llvm/Analysis/DemandedBits.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ class Function;
3434
class Instruction;
3535
struct KnownBits;
3636
class raw_ostream;
37+
class Use;
38+
class Value;
3739

3840
class DemandedBits {
3941
public:

llvm/include/llvm/Analysis/DominanceFrontier.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929

3030
namespace llvm {
3131

32+
class BasicBlock;
3233
class Function;
3334
class raw_ostream;
3435

llvm/include/llvm/Analysis/IVUsers.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "llvm/Analysis/LoopAnalysisManager.h"
1818
#include "llvm/Analysis/LoopPass.h"
1919
#include "llvm/Analysis/ScalarEvolutionNormalization.h"
20+
#include "llvm/IR/Instruction.h"
2021
#include "llvm/IR/ValueHandle.h"
2122

2223
namespace llvm {

llvm/include/llvm/Analysis/LazyValueInfo.h

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

2020
namespace llvm {
2121
class AssumptionCache;
22+
class BasicBlock;
2223
class Constant;
2324
class ConstantRange;
2425
class DataLayout;
2526
class DominatorTree;
2627
class Instruction;
2728
class TargetLibraryInfo;
2829
class Value;
30+
class Use;
2931
class LazyValueInfoImpl;
3032
/// This pass computes, caches, and vends lazy value constraint information.
3133
class LazyValueInfo {

llvm/include/llvm/Analysis/LoopAnalysisManager.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ namespace llvm {
3535

3636
class AAResults;
3737
class AssumptionCache;
38+
class BlockFrequencyInfo;
39+
class BranchProbabilityInfo;
3840
class DominatorTree;
3941
class Function;
4042
class Loop;

llvm/include/llvm/Analysis/OptimizationRemarkEmitter.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
#include "llvm/Analysis/BlockFrequencyInfo.h"
1818
#include "llvm/IR/DiagnosticInfo.h"
19+
#include "llvm/IR/Function.h"
1920
#include "llvm/IR/PassManager.h"
2021
#include "llvm/Pass.h"
2122
#include <optional>

llvm/include/llvm/IR/Analysis.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
#define LLVM_IR_ANALYSIS_H
1414

1515
#include "llvm/ADT/SmallPtrSet.h"
16-
#include "llvm/IR/Function.h"
1716

1817
namespace llvm {
1918

19+
class Function;
2020
class Module;
2121

2222
/// A special type used by analysis passes to provide an address that

llvm/include/llvm/IR/PassManagerImpl.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#ifndef LLVM_IR_PASSMANAGERIMPL_H
1616
#define LLVM_IR_PASSMANAGERIMPL_H
1717

18+
#include "llvm/IR/Function.h"
1819
#include "llvm/IR/PassInstrumentation.h"
1920
#include "llvm/IR/PassManager.h"
2021
#include "llvm/Support/CommandLine.h"

llvm/include/llvm/Transforms/IPO/ExtractGV.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include "llvm/IR/PassManager.h"
1414

1515
namespace llvm {
16+
class GlobalValue;
1617

1718
class ExtractGVPass : public PassInfoMixin<ExtractGVPass> {
1819
private:

llvm/include/llvm/Transforms/IPO/HotColdSplitting.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ namespace llvm {
1919

2020
class Module;
2121
class ProfileSummaryInfo;
22+
class BasicBlock;
2223
class BlockFrequencyInfo;
2324
class TargetTransformInfo;
2425
class OptimizationRemarkEmitter;

llvm/include/llvm/Transforms/IPO/Internalize.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
#include <functional>
2828

2929
namespace llvm {
30+
class Comdat;
31+
class GlobalValue;
3032
class Module;
3133

3234
/// A pass that internalizes all functions and variables other than those that

llvm/include/llvm/Transforms/IPO/WholeProgramDevirt.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#ifndef LLVM_TRANSFORMS_IPO_WHOLEPROGRAMDEVIRT_H
1515
#define LLVM_TRANSFORMS_IPO_WHOLEPROGRAMDEVIRT_H
1616

17+
#include "llvm/ADT/DenseSet.h"
1718
#include "llvm/IR/GlobalValue.h"
1819
#include "llvm/IR/PassManager.h"
1920
#include <cassert>

llvm/include/llvm/Transforms/Scalar/AlignmentFromAssumptions.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,11 @@
2222
namespace llvm {
2323

2424
class AssumptionCache;
25+
class CallInst;
2526
class DominatorTree;
2627
class ScalarEvolution;
2728
class SCEV;
29+
class Value;
2830

2931
struct AlignmentFromAssumptionsPass
3032
: public PassInfoMixin<AlignmentFromAssumptionsPass> {

llvm/include/llvm/Transforms/Scalar/ConstantHoisting.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
#include "llvm/ADT/PointerUnion.h"
4343
#include "llvm/ADT/SetVector.h"
4444
#include "llvm/ADT/SmallVector.h"
45+
#include "llvm/IR/BasicBlock.h"
4546
#include "llvm/IR/PassManager.h"
4647
#include <algorithm>
4748
#include <vector>
@@ -59,6 +60,7 @@ class GlobalVariable;
5960
class Instruction;
6061
class ProfileSummaryInfo;
6162
class TargetTransformInfo;
63+
class TargetTransformInfo;
6264

6365
/// A private "module" namespace for types and utilities used by
6466
/// ConstantHoisting. These are implementation details and should not be used by

llvm/include/llvm/Transforms/Scalar/MemCpyOptimizer.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ class MemSetInst;
3737
class PostDominatorTree;
3838
class StoreInst;
3939
class TargetLibraryInfo;
40+
class TypeSize;
4041
class Value;
4142

4243
class MemCpyOptPass : public PassInfoMixin<MemCpyOptPass> {

llvm/include/llvm/Transforms/Scalar/Reassociate.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include "llvm/ADT/DenseMap.h"
2626
#include "llvm/ADT/PostOrderIterator.h"
2727
#include "llvm/ADT/SetVector.h"
28+
#include "llvm/IR/BasicBlock.h"
2829
#include "llvm/IR/PassManager.h"
2930
#include "llvm/IR/ValueHandle.h"
3031
#include <deque>

llvm/include/llvm/Transforms/Scalar/SpeculativeExecution.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@
6565
#include "llvm/IR/PassManager.h"
6666

6767
namespace llvm {
68+
class BasicBlock;
6869
class TargetTransformInfo;
70+
6971
class SpeculativeExecutionPass
7072
: public PassInfoMixin<SpeculativeExecutionPass> {
7173
public:

llvm/include/llvm/Transforms/Utils/Cloning.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "llvm/ADT/Twine.h"
2222
#include "llvm/Analysis/AssumptionCache.h"
2323
#include "llvm/Analysis/InlineCost.h"
24+
#include "llvm/IR/BasicBlock.h"
2425
#include "llvm/IR/ValueHandle.h"
2526
#include "llvm/Transforms/Utils/ValueMapper.h"
2627
#include <functional>

llvm/include/llvm/Transforms/Vectorize/LoopVectorize.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ class BlockFrequencyInfo;
6767
class DemandedBits;
6868
class DominatorTree;
6969
class Function;
70+
class Instruction;
7071
class Loop;
7172
class LoopAccessInfoManager;
7273
class LoopInfo;

llvm/include/llvm/Transforms/Vectorize/SLPVectorizer.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ namespace llvm {
2929
class AAResults;
3030
class AssumptionCache;
3131
class BasicBlock;
32+
class DataLayout;
3233
class DemandedBits;
3334
class DominatorTree;
3435
class Function;

llvm/lib/CodeGen/AsmPrinter/DwarfCFIException.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include "llvm/CodeGen/AsmPrinter.h"
1616
#include "llvm/CodeGen/MachineFunction.h"
1717
#include "llvm/CodeGen/MachineModuleInfo.h"
18+
#include "llvm/IR/Function.h"
1819
#include "llvm/MC/MCAsmInfo.h"
1920
#include "llvm/MC/MCContext.h"
2021
#include "llvm/MC/MCStreamer.h"

llvm/lib/CodeGen/MachineFunctionAnalysis.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include "llvm/CodeGen/MachineFunctionAnalysis.h"
1515
#include "llvm/CodeGen/MachineFunction.h"
1616
#include "llvm/CodeGen/MachineModuleInfo.h"
17+
#include "llvm/IR/Function.h"
1718
#include "llvm/Target/TargetMachine.h"
1819

1920
using namespace llvm;

llvm/lib/CodeGen/PseudoSourceValue.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include "llvm/CodeGen/PseudoSourceValue.h"
1414
#include "llvm/CodeGen/MachineFrameInfo.h"
1515
#include "llvm/CodeGen/PseudoSourceValueManager.h"
16+
#include "llvm/IR/GlobalValue.h"
1617
#include "llvm/Support/ErrorHandling.h"
1718
#include "llvm/Support/raw_ostream.h"
1819
#include "llvm/Target/TargetMachine.h"

llvm/lib/CodeGen/SafeStackLayout.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include "llvm/ADT/DenseMap.h"
1313
#include "llvm/ADT/SmallVector.h"
1414
#include "llvm/Analysis/StackLifetime.h"
15+
#include "llvm/Support/Alignment.h"
1516

1617
namespace llvm {
1718

llvm/lib/Target/AArch64/AArch64MCInstLower.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "llvm/CodeGen/MachineBasicBlock.h"
1919
#include "llvm/CodeGen/MachineInstr.h"
2020
#include "llvm/CodeGen/MachineModuleInfoImpls.h"
21+
#include "llvm/IR/Function.h"
2122
#include "llvm/IR/Mangler.h"
2223
#include "llvm/MC/MCContext.h"
2324
#include "llvm/MC/MCExpr.h"

llvm/lib/Target/AMDGPU/AMDGPUMachineModuleInfo.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#define LLVM_LIB_TARGET_AMDGPU_AMDGPUMACHINEMODULEINFO_H
1717

1818
#include "llvm/CodeGen/MachineModuleInfoImpls.h"
19+
#include "llvm/IR/LLVMContext.h"
1920

2021
namespace llvm {
2122

llvm/lib/Target/WebAssembly/WebAssemblyExceptionInfo.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "llvm/CodeGen/MachineDominators.h"
2121
#include "llvm/CodeGen/WasmEHFuncInfo.h"
2222
#include "llvm/InitializePasses.h"
23+
#include "llvm/IR/Function.h"
2324
#include "llvm/MC/MCAsmInfo.h"
2425
#include "llvm/Target/TargetMachine.h"
2526

llvm/lib/Transforms/Utils/CountVisits.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
#include "llvm/Transforms/Utils/CountVisits.h"
1010
#include "llvm/ADT/Statistic.h"
11+
#include "llvm/IR/Function.h"
1112
#include "llvm/IR/PassManager.h"
1213

1314
using namespace llvm;

llvm/lib/Transforms/Utils/HelloWorld.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
//===----------------------------------------------------------------------===//
88

99
#include "llvm/Transforms/Utils/HelloWorld.h"
10+
#include "llvm/IR/Function.h"
1011

1112
using namespace llvm;
1213

0 commit comments

Comments
 (0)