From 3c4410dfcaafdb3d772a79c130b6e69f64aa7712 Mon Sep 17 00:00:00 2001 From: serge-sans-paille Date: Tue, 8 Mar 2022 00:25:11 +0100 Subject: [PATCH] Cleanup includes: LLVMTarget Most notably, Pass.h is no longer included by TargetMachine.h before: 1063570306 after: 1063332844 Differential Revision: https://reviews.llvm.org/D121168 --- .../RenderScriptRuntime/RenderScriptExpressionOpts.h | 1 + .../LLJITWithOptimizingIRTransform.cpp | 1 + llvm/include/llvm/Target/TargetLoweringObjectFile.h | 2 +- llvm/include/llvm/Target/TargetMachine.h | 3 --- llvm/lib/Target/AArch64/AArch64.h | 2 ++ llvm/lib/Target/AVR/AVR.h | 2 ++ llvm/lib/Target/BPF/BPF.h | 2 ++ llvm/lib/Target/Mips/MipsOs16.cpp | 1 + llvm/lib/Target/TargetIntrinsicInfo.cpp | 2 +- llvm/lib/Target/TargetLoweringObjectFile.cpp | 2 -- llvm/lib/Target/TargetMachine.cpp | 5 ----- llvm/lib/Target/TargetMachineC.cpp | 4 ---- llvm/lib/Target/XCore/XCore.h | 1 + llvm/unittests/CodeGen/AMDGPUMetadataTest.cpp | 1 + llvm/unittests/MC/AMDGPU/DwarfRegMappings.cpp | 1 + 15 files changed, 14 insertions(+), 16 deletions(-) diff --git a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.h b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.h index e0b4f388dcc59..61af4dc1d7648 100644 --- a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.h +++ b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.h @@ -11,6 +11,7 @@ #include "llvm/IR/Module.h" #include "llvm/MC/TargetRegistry.h" +#include "llvm/Pass.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetOptions.h" diff --git a/llvm/examples/OrcV2Examples/LLJITWithOptimizingIRTransform/LLJITWithOptimizingIRTransform.cpp b/llvm/examples/OrcV2Examples/LLJITWithOptimizingIRTransform/LLJITWithOptimizingIRTransform.cpp index 7ebf3e8e9a077..35421c0c5938b 100644 --- a/llvm/examples/OrcV2Examples/LLJITWithOptimizingIRTransform/LLJITWithOptimizingIRTransform.cpp +++ b/llvm/examples/OrcV2Examples/LLJITWithOptimizingIRTransform/LLJITWithOptimizingIRTransform.cpp @@ -13,6 +13,7 @@ #include "llvm/ExecutionEngine/Orc/LLJIT.h" #include "llvm/IR/LegacyPassManager.h" +#include "llvm/Pass.h" #include "llvm/Support/InitLLVM.h" #include "llvm/Support/TargetSelect.h" #include "llvm/Support/raw_ostream.h" diff --git a/llvm/include/llvm/Target/TargetLoweringObjectFile.h b/llvm/include/llvm/Target/TargetLoweringObjectFile.h index 78632b17615c2..bdc32fbbacd1c 100644 --- a/llvm/include/llvm/Target/TargetLoweringObjectFile.h +++ b/llvm/include/llvm/Target/TargetLoweringObjectFile.h @@ -16,11 +16,11 @@ #include "llvm/MC/MCObjectFileInfo.h" #include "llvm/MC/MCRegister.h" -#include "llvm/Support/Alignment.h" #include namespace llvm { +struct Align; class Constant; class DataLayout; class Function; diff --git a/llvm/include/llvm/Target/TargetMachine.h b/llvm/include/llvm/Target/TargetMachine.h index 7ea975d8af7b3..32a410d791f89 100644 --- a/llvm/include/llvm/Target/TargetMachine.h +++ b/llvm/include/llvm/Target/TargetMachine.h @@ -18,7 +18,6 @@ #include "llvm/ADT/Triple.h" #include "llvm/IR/DataLayout.h" #include "llvm/IR/PassManager.h" -#include "llvm/Pass.h" #include "llvm/Support/CodeGen.h" #include "llvm/Support/Error.h" #include "llvm/Support/PGOOptions.h" @@ -30,8 +29,6 @@ namespace llvm { class AAManager; -template -class PassManager; using ModulePassManager = PassManager; class Function; diff --git a/llvm/lib/Target/AArch64/AArch64.h b/llvm/lib/Target/AArch64/AArch64.h index 4d14649017770..b4ba54025c780 100644 --- a/llvm/lib/Target/AArch64/AArch64.h +++ b/llvm/lib/Target/AArch64/AArch64.h @@ -16,6 +16,8 @@ #include "MCTargetDesc/AArch64MCTargetDesc.h" #include "Utils/AArch64BaseInfo.h" +#include "llvm/Pass.h" +#include "llvm/PassRegistry.h" #include "llvm/Support/DataTypes.h" #include "llvm/Target/TargetMachine.h" diff --git a/llvm/lib/Target/AVR/AVR.h b/llvm/lib/Target/AVR/AVR.h index 0b512172ba109..532a57af25157 100644 --- a/llvm/lib/Target/AVR/AVR.h +++ b/llvm/lib/Target/AVR/AVR.h @@ -15,6 +15,8 @@ #define LLVM_AVR_H #include "llvm/CodeGen/SelectionDAGNodes.h" +#include "llvm/Pass.h" +#include "llvm/PassRegistry.h" #include "llvm/Target/TargetMachine.h" namespace llvm { diff --git a/llvm/lib/Target/BPF/BPF.h b/llvm/lib/Target/BPF/BPF.h index 89990f7e15c28..3de761bf6601e 100644 --- a/llvm/lib/Target/BPF/BPF.h +++ b/llvm/lib/Target/BPF/BPF.h @@ -11,6 +11,8 @@ #include "MCTargetDesc/BPFMCTargetDesc.h" #include "llvm/IR/PassManager.h" +#include "llvm/Pass.h" +#include "llvm/PassRegistry.h" #include "llvm/Target/TargetMachine.h" namespace llvm { diff --git a/llvm/lib/Target/Mips/MipsOs16.cpp b/llvm/lib/Target/Mips/MipsOs16.cpp index ac4e55f8a1f58..f6346a8bbc8bc 100644 --- a/llvm/lib/Target/Mips/MipsOs16.cpp +++ b/llvm/lib/Target/Mips/MipsOs16.cpp @@ -13,6 +13,7 @@ #include "Mips.h" #include "llvm/IR/Instructions.h" #include "llvm/IR/Module.h" +#include "llvm/Pass.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" #include "llvm/Support/raw_ostream.h" diff --git a/llvm/lib/Target/TargetIntrinsicInfo.cpp b/llvm/lib/Target/TargetIntrinsicInfo.cpp index f63517ef4766d..d44a34984c421 100644 --- a/llvm/lib/Target/TargetIntrinsicInfo.cpp +++ b/llvm/lib/Target/TargetIntrinsicInfo.cpp @@ -11,7 +11,7 @@ //===----------------------------------------------------------------------===// #include "llvm/Target/TargetIntrinsicInfo.h" -#include "llvm/ADT/StringMap.h" +#include "llvm/ADT/StringMapEntry.h" #include "llvm/IR/Function.h" using namespace llvm; diff --git a/llvm/lib/Target/TargetLoweringObjectFile.cpp b/llvm/lib/Target/TargetLoweringObjectFile.cpp index 7954f0f09faf4..8f633adbb9efb 100644 --- a/llvm/lib/Target/TargetLoweringObjectFile.cpp +++ b/llvm/lib/Target/TargetLoweringObjectFile.cpp @@ -24,10 +24,8 @@ #include "llvm/MC/MCContext.h" #include "llvm/MC/MCExpr.h" #include "llvm/MC/MCStreamer.h" -#include "llvm/MC/MCSymbol.h" #include "llvm/MC/SectionKind.h" #include "llvm/Support/ErrorHandling.h" -#include "llvm/Support/raw_ostream.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetOptions.h" using namespace llvm; diff --git a/llvm/lib/Target/TargetMachine.cpp b/llvm/lib/Target/TargetMachine.cpp index 967dcf63b4b58..615fe6f483784 100644 --- a/llvm/lib/Target/TargetMachine.cpp +++ b/llvm/lib/Target/TargetMachine.cpp @@ -13,19 +13,14 @@ #include "llvm/Target/TargetMachine.h" #include "llvm/Analysis/TargetTransformInfo.h" #include "llvm/IR/Function.h" -#include "llvm/IR/GlobalAlias.h" #include "llvm/IR/GlobalValue.h" #include "llvm/IR/GlobalVariable.h" -#include "llvm/IR/LegacyPassManager.h" #include "llvm/IR/Mangler.h" #include "llvm/MC/MCAsmInfo.h" #include "llvm/MC/MCContext.h" #include "llvm/MC/MCInstrInfo.h" #include "llvm/MC/MCRegisterInfo.h" -#include "llvm/MC/MCSectionMachO.h" #include "llvm/MC/MCSubtargetInfo.h" -#include "llvm/MC/MCTargetOptions.h" -#include "llvm/MC/SectionKind.h" #include "llvm/Target/TargetLoweringObjectFile.h" using namespace llvm; diff --git a/llvm/lib/Target/TargetMachineC.cpp b/llvm/lib/Target/TargetMachineC.cpp index 55047a1bb3cd1..1275f93f64e4c 100644 --- a/llvm/lib/Target/TargetMachineC.cpp +++ b/llvm/lib/Target/TargetMachineC.cpp @@ -11,7 +11,6 @@ //===----------------------------------------------------------------------===// #include "llvm-c/Core.h" -#include "llvm-c/Target.h" #include "llvm-c/TargetMachine.h" #include "llvm/Analysis/TargetTransformInfo.h" #include "llvm/IR/DataLayout.h" @@ -20,13 +19,10 @@ #include "llvm/MC/SubtargetFeature.h" #include "llvm/MC/TargetRegistry.h" #include "llvm/Support/FileSystem.h" -#include "llvm/Support/FormattedStream.h" #include "llvm/Support/Host.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Target/CodeGenCWrappers.h" #include "llvm/Target/TargetMachine.h" -#include -#include #include using namespace llvm; diff --git a/llvm/lib/Target/XCore/XCore.h b/llvm/lib/Target/XCore/XCore.h index d31c34910ef62..6118775d16fec 100644 --- a/llvm/lib/Target/XCore/XCore.h +++ b/llvm/lib/Target/XCore/XCore.h @@ -15,6 +15,7 @@ #define LLVM_LIB_TARGET_XCORE_XCORE_H #include "MCTargetDesc/XCoreMCTargetDesc.h" +#include "llvm/PassRegistry.h" #include "llvm/Target/TargetMachine.h" namespace llvm { diff --git a/llvm/unittests/CodeGen/AMDGPUMetadataTest.cpp b/llvm/unittests/CodeGen/AMDGPUMetadataTest.cpp index d1829091a1c6f..e14a234cd9ea7 100644 --- a/llvm/unittests/CodeGen/AMDGPUMetadataTest.cpp +++ b/llvm/unittests/CodeGen/AMDGPUMetadataTest.cpp @@ -14,6 +14,7 @@ #include "llvm/IR/LegacyPassManager.h" #include "llvm/MC/TargetRegistry.h" +#include "llvm/Pass.h" #include "llvm/Support/TargetSelect.h" #include "llvm/Target/TargetMachine.h" #include "gtest/gtest.h" diff --git a/llvm/unittests/MC/AMDGPU/DwarfRegMappings.cpp b/llvm/unittests/MC/AMDGPU/DwarfRegMappings.cpp index 9a32a2df44a42..f0cfa8f78dfce 100644 --- a/llvm/unittests/MC/AMDGPU/DwarfRegMappings.cpp +++ b/llvm/unittests/MC/AMDGPU/DwarfRegMappings.cpp @@ -12,6 +12,7 @@ #include "llvm/Support/TargetSelect.h" #include "llvm/Target/TargetMachine.h" #include "gtest/gtest.h" +#include #include using namespace llvm;