diff --git a/lib/Target/Hexagon/BitTracker.cpp b/lib/Target/Hexagon/BitTracker.cpp index 9a2a59750a0..e3ead285485 100644 --- a/lib/Target/Hexagon/BitTracker.cpp +++ b/lib/Target/Hexagon/BitTracker.cpp @@ -169,6 +169,12 @@ namespace llvm { } } +void BitTracker::print_cells(raw_ostream &OS) const { + for (CellMapType::iterator I = Map.begin(), E = Map.end(); I != E; ++I) + dbgs() << PrintReg(I->first, &ME.TRI) << " -> " << I->second << "\n"; +} + + BitTracker::BitTracker(const MachineEvaluator &E, MachineFunction &F) : Trace(false), ME(E), MF(F), MRI(F.getRegInfo()), Map(*new CellMapType) {} @@ -1127,10 +1133,7 @@ void BT::run() { } } // while (!FlowQ->empty()) - if (Trace) { - dbgs() << "Cells after propagation:\n"; - for (CellMapType::iterator I = Map.begin(), E = Map.end(); I != E; ++I) - dbgs() << PrintReg(I->first, &ME.TRI) << " -> " << I->second << "\n"; - } + if (Trace) + print_cells(dbgs() << "Cells after propagation:\n"); } diff --git a/lib/Target/Hexagon/BitTracker.h b/lib/Target/Hexagon/BitTracker.h index 3c16a73ddb4..74cafcd00b6 100644 --- a/lib/Target/Hexagon/BitTracker.h +++ b/lib/Target/Hexagon/BitTracker.h @@ -51,6 +51,8 @@ struct BitTracker { bool reached(const MachineBasicBlock *B) const; void visit(const MachineInstr &MI); + void print_cells(raw_ostream &OS) const; + private: void visitPHI(const MachineInstr &PI); void visitNonBranch(const MachineInstr &MI);