Skip to content

Commit 7117a4e

Browse files
committed
[BitcodeWriter] Remove ThinLTO-specific bits from legacy pass
Since we shouldn't be doing any LTO logic from the legacy pass manager.
1 parent a2d68b4 commit 7117a4e

File tree

2 files changed

+7
-27
lines changed

2 files changed

+7
-27
lines changed

llvm/include/llvm/Bitcode/BitcodeWriterPass.h

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,8 @@ class raw_ostream;
2828
///
2929
/// If \c ShouldPreserveUseListOrder, encode use-list order so it can be
3030
/// reproduced when deserialized.
31-
///
32-
/// If \c EmitSummaryIndex, emit the summary index (currently for use in ThinLTO
33-
/// optimization).
34-
///
35-
/// If \c EmitModuleHash, compute and emit the module hash in the bitcode
36-
/// (currently for use in ThinLTO incremental build).
3731
ModulePass *createBitcodeWriterPass(raw_ostream &Str,
38-
bool ShouldPreserveUseListOrder = false,
39-
bool EmitSummaryIndex = false,
40-
bool EmitModuleHash = false);
32+
bool ShouldPreserveUseListOrder = false);
4133

4234
/// Check whether a pass is a BitcodeWriterPass.
4335
bool isBitcodeWriterPass(Pass *P);

llvm/lib/Bitcode/Writer/BitcodeWriterPass.cpp

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -40,47 +40,37 @@ namespace {
4040
class WriteBitcodePass : public ModulePass {
4141
raw_ostream &OS; // raw_ostream to print on
4242
bool ShouldPreserveUseListOrder;
43-
bool EmitSummaryIndex;
44-
bool EmitModuleHash;
4543

4644
public:
4745
static char ID; // Pass identification, replacement for typeid
4846
WriteBitcodePass() : ModulePass(ID), OS(dbgs()) {
4947
initializeWriteBitcodePassPass(*PassRegistry::getPassRegistry());
5048
}
5149

52-
explicit WriteBitcodePass(raw_ostream &o, bool ShouldPreserveUseListOrder,
53-
bool EmitSummaryIndex, bool EmitModuleHash)
50+
explicit WriteBitcodePass(raw_ostream &o, bool ShouldPreserveUseListOrder)
5451
: ModulePass(ID), OS(o),
55-
ShouldPreserveUseListOrder(ShouldPreserveUseListOrder),
56-
EmitSummaryIndex(EmitSummaryIndex), EmitModuleHash(EmitModuleHash) {
52+
ShouldPreserveUseListOrder(ShouldPreserveUseListOrder) {
5753
initializeWriteBitcodePassPass(*PassRegistry::getPassRegistry());
5854
}
5955

6056
StringRef getPassName() const override { return "Bitcode Writer"; }
6157

6258
bool runOnModule(Module &M) override {
63-
const ModuleSummaryIndex *Index =
64-
EmitSummaryIndex
65-
? &(getAnalysis<ModuleSummaryIndexWrapperPass>().getIndex())
66-
: nullptr;
6759
// RemoveDIs: there's no bitcode representation of the DPValue debug-info,
6860
// convert to dbg.values before writing out.
6961
bool IsNewDbgInfoFormat = M.IsNewDbgInfoFormat;
7062
if (IsNewDbgInfoFormat)
7163
M.convertFromNewDbgValues();
7264

73-
WriteBitcodeToFile(M, OS, ShouldPreserveUseListOrder, Index,
74-
EmitModuleHash);
65+
WriteBitcodeToFile(M, OS, ShouldPreserveUseListOrder, /*Index=*/nullptr,
66+
/*EmitModuleHash=*/false);
7567

7668
if (IsNewDbgInfoFormat)
7769
M.convertToNewDbgValues();
7870
return false;
7971
}
8072
void getAnalysisUsage(AnalysisUsage &AU) const override {
8173
AU.setPreservesAll();
82-
if (EmitSummaryIndex)
83-
AU.addRequired<ModuleSummaryIndexWrapperPass>();
8474
}
8575
};
8676
}
@@ -93,10 +83,8 @@ INITIALIZE_PASS_END(WriteBitcodePass, "write-bitcode", "Write Bitcode", false,
9383
true)
9484

9585
ModulePass *llvm::createBitcodeWriterPass(raw_ostream &Str,
96-
bool ShouldPreserveUseListOrder,
97-
bool EmitSummaryIndex, bool EmitModuleHash) {
98-
return new WriteBitcodePass(Str, ShouldPreserveUseListOrder,
99-
EmitSummaryIndex, EmitModuleHash);
86+
bool ShouldPreserveUseListOrder) {
87+
return new WriteBitcodePass(Str, ShouldPreserveUseListOrder);
10088
}
10189

10290
bool llvm::isBitcodeWriterPass(Pass *P) {

0 commit comments

Comments
 (0)