File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,8 @@ namespace bolt {
25
25
26
26
class ADRRelaxationPass : public BinaryFunctionPass {
27
27
public:
28
- explicit ADRRelaxationPass () : BinaryFunctionPass(false ) {}
28
+ explicit ADRRelaxationPass (const cl::opt<bool > &PrintPass)
29
+ : BinaryFunctionPass(PrintPass) {}
29
30
30
31
const char *getName () const override { return " adr-relaxation" ; }
31
32
Original file line number Diff line number Diff line change @@ -125,6 +125,11 @@ static cl::opt<bool> PrintJTFootprintReduction(
125
125
cl::desc (" print function after jt-footprint-reduction pass" ), cl::Hidden,
126
126
cl::cat(BoltOptCategory));
127
127
128
+ static cl::opt<bool >
129
+ PrintAdrRelaxation (" print-adr-relaxation" ,
130
+ cl::desc (" print functions after ADR Relaxation pass" ),
131
+ cl::Hidden, cl::cat(BoltOptCategory));
132
+
128
133
static cl::opt<bool >
129
134
PrintLongJmp (" print-longjmp" ,
130
135
cl::desc (" print functions after longjmp pass" ), cl::Hidden,
@@ -490,7 +495,8 @@ Error BinaryFunctionPassManager::runAllPasses(BinaryContext &BC) {
490
495
Manager.registerPass (std::make_unique<ReorderData>());
491
496
492
497
if (BC.isAArch64 ()) {
493
- Manager.registerPass (std::make_unique<ADRRelaxationPass>());
498
+ Manager.registerPass (
499
+ std::make_unique<ADRRelaxationPass>(PrintAdrRelaxation));
494
500
495
501
// Tighten branches according to offset differences between branch and
496
502
// targets. No extra instructions after this pass, otherwise we may have
You can’t perform that action at this time.
0 commit comments