Skip to content

Commit be9d3ed

Browse files
committed
[BOLT][NFC] Remove unused PrintInstructions argument
PrintInstructions was unused in BinaryFunction::print() and dump(). Reviewed By: Amir Differential Revision: https://reviews.llvm.org/D140440
1 parent c08fad8 commit be9d3ed

File tree

6 files changed

+14
-16
lines changed

6 files changed

+14
-16
lines changed

bolt/include/bolt/Core/BinaryFunction.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1614,11 +1614,10 @@ class BinaryFunction {
16141614

16151615
/// Dump function information to debug output. If \p PrintInstructions
16161616
/// is true - include instruction disassembly.
1617-
void dump(bool PrintInstructions = true) const;
1617+
void dump() const;
16181618

16191619
/// Print function information to the \p OS stream.
1620-
void print(raw_ostream &OS, std::string Annotation = "",
1621-
bool PrintInstructions = true);
1620+
void print(raw_ostream &OS, std::string Annotation = "");
16221621

16231622
/// Print all relocations between \p Offset and \p Offset + \p Size in
16241623
/// this function.

bolt/lib/Core/BinaryFunction.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ bool BinaryFunction::isForwardCall(const MCSymbol *CalleeSymbol) const {
392392
}
393393
}
394394

395-
void BinaryFunction::dump(bool PrintInstructions) const {
395+
void BinaryFunction::dump() const {
396396
// getDynoStats calls FunctionLayout::updateLayoutIndices and
397397
// BasicBlock::analyzeBranch. The former cannot be const, but should be
398398
// removed, the latter should be made const, but seems to require refactoring.
@@ -402,11 +402,10 @@ void BinaryFunction::dump(bool PrintInstructions) const {
402402
// modified. Only BinaryBasicBlocks are actually modified (if it all) and we
403403
// have mutable pointers to those regardless whether this function is
404404
// const-qualified or not.
405-
const_cast<BinaryFunction &>(*this).print(dbgs(), "", PrintInstructions);
405+
const_cast<BinaryFunction &>(*this).print(dbgs(), "");
406406
}
407407

408-
void BinaryFunction::print(raw_ostream &OS, std::string Annotation,
409-
bool PrintInstructions) {
408+
void BinaryFunction::print(raw_ostream &OS, std::string Annotation) {
410409
if (!opts::shouldPrint(*this))
411410
return;
412411

@@ -485,7 +484,7 @@ void BinaryFunction::print(raw_ostream &OS, std::string Annotation,
485484

486485
OS << "\n}\n";
487486

488-
if (opts::PrintDynoStatsOnly || !PrintInstructions || !BC.InstPrinter)
487+
if (opts::PrintDynoStatsOnly || !BC.InstPrinter)
489488
return;
490489

491490
// Offset of the instruction in function.

bolt/lib/Passes/MCF.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,10 +448,10 @@ void estimateEdgeCounts(BinaryFunction &BF) {
448448
computeEdgeWeights<BinaryBasicBlock *>(BF, SuccEdgeWeights);
449449
}
450450
if (opts::EqualizeBBCounts) {
451-
LLVM_DEBUG(BF.print(dbgs(), "before equalize BB counts", true));
451+
LLVM_DEBUG(BF.print(dbgs(), "before equalize BB counts"));
452452
auto Info = DataflowInfoManager(BF, nullptr, nullptr);
453453
equalizeBBCounts(Info, BF);
454-
LLVM_DEBUG(BF.print(dbgs(), "after equalize BB counts", true));
454+
LLVM_DEBUG(BF.print(dbgs(), "after equalize BB counts"));
455455
}
456456
if (opts::IterativeGuess)
457457
guessEdgeByIterativeApproach(BF);

bolt/lib/Rewrite/BinaryPassManager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ void BinaryFunctionPassManager::runPasses() {
298298
if (!Pass->shouldPrint(Function))
299299
continue;
300300

301-
Function.print(outs(), Message, true);
301+
Function.print(outs(), Message);
302302

303303
if (opts::DumpDotAll)
304304
Function.dumpGraphForPass(PassIdName);

bolt/lib/Rewrite/MachORewriteInstance.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ void MachORewriteInstance::disassembleFunctions() {
334334
continue;
335335
Function.disassemble();
336336
if (opts::PrintDisasm)
337-
Function.print(outs(), "after disassembly", true);
337+
Function.print(outs(), "after disassembly");
338338
}
339339
}
340340

@@ -357,7 +357,7 @@ void MachORewriteInstance::postProcessFunctions() {
357357
continue;
358358
Function.postProcessCFG();
359359
if (opts::PrintCFG)
360-
Function.print(outs(), "after building cfg", true);
360+
Function.print(outs(), "after building cfg");
361361
}
362362
}
363363

bolt/lib/Rewrite/RewriteInstance.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2933,7 +2933,7 @@ void RewriteInstance::disassembleFunctions() {
29332933
}
29342934

29352935
if (opts::PrintAll || opts::PrintDisasm)
2936-
Function.print(outs(), "after disassembly", true);
2936+
Function.print(outs(), "after disassembly");
29372937
}
29382938

29392939
BC->processInterproceduralReferences();
@@ -3000,7 +3000,7 @@ void RewriteInstance::buildFunctionsCFG() {
30003000

30013001
if (opts::PrintAll) {
30023002
auto L = BC->scopeLock();
3003-
BF.print(outs(), "while building cfg", true);
3003+
BF.print(outs(), "while building cfg");
30043004
}
30053005
};
30063006

@@ -3033,7 +3033,7 @@ void RewriteInstance::postProcessFunctions() {
30333033
Function.postProcessCFG();
30343034

30353035
if (opts::PrintAll || opts::PrintCFG)
3036-
Function.print(outs(), "after building cfg", true);
3036+
Function.print(outs(), "after building cfg");
30373037

30383038
if (opts::DumpDotAll)
30393039
Function.dumpGraphForPass("00_build-cfg");

0 commit comments

Comments
 (0)