Skip to content

Commit 49ae2dc

Browse files
authored
[PassManager] Remove some unnecessary includes (NFC) (#96175)
SmallPtrSet.h and TimeProfiler.h are unused. CommandLine.h is only needed for the UseNewDbgInfoFormat declare, which can be moved to the places that need it.
1 parent 037a9a7 commit 49ae2dc

File tree

13 files changed

+16
-5
lines changed

13 files changed

+16
-5
lines changed

clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
#include "llvm/Support/SourceMgr.h"
5151
#include "llvm/Support/StringSaver.h"
5252
#include "llvm/Support/TargetSelect.h"
53+
#include "llvm/Support/TimeProfiler.h"
5354
#include "llvm/Support/WithColor.h"
5455
#include "llvm/Support/raw_ostream.h"
5556
#include "llvm/Target/TargetMachine.h"

lld/COFF/Driver.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
#include "llvm/Support/Process.h"
4545
#include "llvm/Support/TarWriter.h"
4646
#include "llvm/Support/TargetSelect.h"
47+
#include "llvm/Support/TimeProfiler.h"
4748
#include "llvm/Support/VirtualFileSystem.h"
4849
#include "llvm/Support/raw_ostream.h"
4950
#include "llvm/TargetParser/Triple.h"

lld/COFF/SymbolTable.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "llvm/IR/LLVMContext.h"
2121
#include "llvm/LTO/LTO.h"
2222
#include "llvm/Support/Debug.h"
23+
#include "llvm/Support/TimeProfiler.h"
2324
#include "llvm/Support/raw_ostream.h"
2425
#include <utility>
2526

lld/ELF/InputFiles.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include "llvm/Support/Path.h"
3030
#include "llvm/Support/RISCVAttributeParser.h"
3131
#include "llvm/Support/TarWriter.h"
32+
#include "llvm/Support/TimeProfiler.h"
3233
#include "llvm/Support/raw_ostream.h"
3334
#include <optional>
3435

llvm/include/llvm/IR/PassManager.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,13 @@
3939

4040
#include "llvm/ADT/DenseMap.h"
4141
#include "llvm/ADT/STLExtras.h"
42-
#include "llvm/ADT/SmallPtrSet.h"
4342
#include "llvm/ADT/StringRef.h"
4443
#include "llvm/ADT/TinyPtrVector.h"
4544
#include "llvm/IR/Analysis.h"
4645
#include "llvm/IR/Function.h"
4746
#include "llvm/IR/Module.h"
4847
#include "llvm/IR/PassInstrumentation.h"
4948
#include "llvm/IR/PassManagerInternal.h"
50-
#include "llvm/Support/CommandLine.h"
51-
#include "llvm/Support/TimeProfiler.h"
5249
#include "llvm/Support/TypeName.h"
5350
#include <cassert>
5451
#include <cstring>
@@ -60,8 +57,6 @@
6057
#include <utility>
6158
#include <vector>
6259

63-
extern llvm::cl::opt<bool> UseNewDbgInfoFormat;
64-
6560
namespace llvm {
6661

6762
// Forward declare the analysis manager template.

llvm/include/llvm/IR/PassManagerImpl.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,11 @@
1515
#ifndef LLVM_IR_PASSMANAGERIMPL_H
1616
#define LLVM_IR_PASSMANAGERIMPL_H
1717

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

21+
extern llvm::cl::opt<bool> UseNewDbgInfoFormat;
22+
2023
namespace llvm {
2124

2225
template <typename IRUnitT, typename AnalysisManagerT, typename... ExtraArgTs>

llvm/lib/Analysis/PHITransAddr.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "llvm/IR/Constants.h"
1818
#include "llvm/IR/Dominators.h"
1919
#include "llvm/IR/Instructions.h"
20+
#include "llvm/Support/CommandLine.h"
2021
#include "llvm/Support/ErrorHandling.h"
2122
#include "llvm/Support/raw_ostream.h"
2223
using namespace llvm;

llvm/lib/Bitcode/Reader/BitcodeReader.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ cl::opt<cl::boolOrDefault> LoadBitcodeIntoNewDbgInfoFormat(
109109
"load-bitcode-into-experimental-debuginfo-iterators", cl::Hidden,
110110
cl::desc("Load bitcode directly into the new debug info format (regardless "
111111
"of input format)"));
112+
extern cl::opt<bool> UseNewDbgInfoFormat;
112113
extern cl::opt<cl::boolOrDefault> PreserveInputDbgFormat;
113114
extern bool WriteNewDbgInfoFormatToBitcode;
114115
extern cl::opt<bool> WriteNewDbgInfoFormat;

llvm/lib/LTO/LTO.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ using namespace object;
6565

6666
#define DEBUG_TYPE "lto"
6767

68+
extern cl::opt<bool> UseNewDbgInfoFormat;
69+
6870
static cl::opt<bool>
6971
DumpThinCGSCCs("dump-thin-cg-sccs", cl::init(false), cl::Hidden,
7072
cl::desc("Dump the SCCs in the ThinLTO index's callgraph"));

llvm/lib/Transforms/Coroutines/CoroFrame.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@
4444

4545
using namespace llvm;
4646

47+
extern cl::opt<bool> UseNewDbgInfoFormat;
48+
4749
// The "coro-suspend-crossing" flag is very noisy. There is another debug type,
4850
// "coro-frame", which results in leaner debug spew.
4951
#define DEBUG_TYPE "coro-suspend-crossing"

llvm/lib/Transforms/IPO/ConstantMerge.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include "llvm/IR/LLVMContext.h"
3030
#include "llvm/IR/Module.h"
3131
#include "llvm/Support/Casting.h"
32+
#include "llvm/Support/Debug.h"
3233
#include "llvm/Transforms/IPO.h"
3334
#include <algorithm>
3435
#include <cassert>

llvm/tools/llvm-as/llvm-as.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ static cl::opt<std::string> ClDataLayout("data-layout",
6767
cl::desc("data layout string to use"),
6868
cl::value_desc("layout-string"),
6969
cl::init(""), cl::cat(AsCat));
70+
extern cl::opt<bool> UseNewDbgInfoFormat;
7071
extern bool WriteNewDbgInfoFormatToBitcode;
7172

7273
static void WriteOutputFile(const Module *M, const ModuleSummaryIndex *Index) {

llvm/tools/opt/optdriver.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
#include "llvm/Support/SourceMgr.h"
4848
#include "llvm/Support/SystemUtils.h"
4949
#include "llvm/Support/TargetSelect.h"
50+
#include "llvm/Support/TimeProfiler.h"
5051
#include "llvm/Support/ToolOutputFile.h"
5152
#include "llvm/Support/YAMLTraits.h"
5253
#include "llvm/Target/TargetMachine.h"

0 commit comments

Comments
 (0)