Release build: guard dump functions with "ifndef NDEBUG"

No functional change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163339 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Manman Ren 2012-09-06 19:06:06 +00:00
parent 45c5c57179
commit 77e300e8f0
20 changed files with 54 additions and 0 deletions

View File

@ -748,9 +748,11 @@ raw_ostream& llvm::operator<<(raw_ostream& os, const LiveRange &LR) {
return os << '[' << LR.start << ',' << LR.end << ':' << LR.valno->id << ")"; return os << '[' << LR.start << ',' << LR.end << ':' << LR.valno->id << ")";
} }
#ifndef NDEBUG
void LiveRange::dump() const { void LiveRange::dump() const {
dbgs() << *this << "\n"; dbgs() << *this << "\n";
} }
#endif
void LiveInterval::print(raw_ostream &OS) const { void LiveInterval::print(raw_ostream &OS) const {
if (empty()) if (empty())
@ -783,9 +785,11 @@ void LiveInterval::print(raw_ostream &OS) const {
} }
} }
#ifndef NDEBUG
void LiveInterval::dump() const { void LiveInterval::dump() const {
dbgs() << *this << "\n"; dbgs() << *this << "\n";
} }
#endif
#ifndef NDEBUG #ifndef NDEBUG
void LiveInterval::verify() const { void LiveInterval::verify() const {

View File

@ -156,9 +156,11 @@ void LiveIntervals::printInstrs(raw_ostream &OS) const {
MF->print(OS, Indexes); MF->print(OS, Indexes);
} }
#ifndef NDEBUG
void LiveIntervals::dumpInstrs() const { void LiveIntervals::dumpInstrs() const {
printInstrs(dbgs()); printInstrs(dbgs());
} }
#endif
static static
bool MultipleDefsBySameMI(const MachineInstr &MI, unsigned MOIdx) { bool MultipleDefsBySameMI(const MachineInstr &MI, unsigned MOIdx) {

View File

@ -65,6 +65,7 @@ LiveVariables::VarInfo::findKill(const MachineBasicBlock *MBB) const {
} }
void LiveVariables::VarInfo::dump() const { void LiveVariables::VarInfo::dump() const {
#ifndef NDEBUG
dbgs() << " Alive in blocks: "; dbgs() << " Alive in blocks: ";
for (SparseBitVector<>::iterator I = AliveBlocks.begin(), for (SparseBitVector<>::iterator I = AliveBlocks.begin(),
E = AliveBlocks.end(); I != E; ++I) E = AliveBlocks.end(); I != E; ++I)
@ -77,6 +78,7 @@ void LiveVariables::VarInfo::dump() const {
dbgs() << "\n #" << i << ": " << *Kills[i]; dbgs() << "\n #" << i << ": " << *Kills[i];
dbgs() << "\n"; dbgs() << "\n";
} }
#endif
} }
/// getVarInfo - Get (possibly creating) a VarInfo object for the given vreg. /// getVarInfo - Get (possibly creating) a VarInfo object for the given vreg.

View File

@ -228,9 +228,11 @@ const MachineBasicBlock *MachineBasicBlock::getLandingPadSuccessor() const {
return 0; return 0;
} }
#ifndef NDEBUG
void MachineBasicBlock::dump() const { void MachineBasicBlock::dump() const {
print(dbgs()); print(dbgs());
} }
#endif
StringRef MachineBasicBlock::getName() const { StringRef MachineBasicBlock::getName() const {
if (const BasicBlock *LBB = getBasicBlock()) if (const BasicBlock *LBB = getBasicBlock())

View File

@ -284,9 +284,11 @@ MachineFunction::extractStoreMemRefs(MachineInstr::mmo_iterator Begin,
return std::make_pair(Result, Result + Num); return std::make_pair(Result, Result + Num);
} }
#ifndef NDEBUG
void MachineFunction::dump() const { void MachineFunction::dump() const {
print(dbgs()); print(dbgs());
} }
#endif
StringRef MachineFunction::getName() const { StringRef MachineFunction::getName() const {
assert(getFunction() && "No function!"); assert(getFunction() && "No function!");
@ -532,9 +534,11 @@ void MachineFrameInfo::print(const MachineFunction &MF, raw_ostream &OS) const{
} }
} }
#ifndef NDEBUG
void MachineFrameInfo::dump(const MachineFunction &MF) const { void MachineFrameInfo::dump(const MachineFunction &MF) const {
print(MF, dbgs()); print(MF, dbgs());
} }
#endif
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// MachineJumpTableInfo implementation // MachineJumpTableInfo implementation
@ -629,7 +633,9 @@ void MachineJumpTableInfo::print(raw_ostream &OS) const {
OS << '\n'; OS << '\n';
} }
#ifndef NDEBUG
void MachineJumpTableInfo::dump() const { print(dbgs()); } void MachineJumpTableInfo::dump() const { print(dbgs()); }
#endif
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
@ -762,4 +768,6 @@ void MachineConstantPool::print(raw_ostream &OS) const {
} }
} }
#ifndef NDEBUG
void MachineConstantPool::dump() const { print(dbgs()); } void MachineConstantPool::dump() const { print(dbgs()); }
#endif

View File

@ -1496,7 +1496,9 @@ void MachineInstr::copyImplicitOps(const MachineInstr *MI) {
} }
void MachineInstr::dump() const { void MachineInstr::dump() const {
#ifndef NDEBUG
dbgs() << " " << *this; dbgs() << " " << *this;
#endif
} }
static void printDebugLoc(DebugLoc DL, const MachineFunction *MF, static void printDebugLoc(DebugLoc DL, const MachineFunction *MF,

View File

@ -74,6 +74,8 @@ MachineBasicBlock *MachineLoop::getBottomBlock() {
return BotMBB; return BotMBB;
} }
#ifndef NDEBUG
void MachineLoop::dump() const { void MachineLoop::dump() const {
print(dbgs()); print(dbgs());
} }
#endif

View File

@ -764,12 +764,14 @@ public:
Queue.pop_back(); Queue.pop_back();
} }
#ifndef NDEBUG
void dump() { void dump() {
dbgs() << Name << ": "; dbgs() << Name << ": ";
for (unsigned i = 0, e = Queue.size(); i < e; ++i) for (unsigned i = 0, e = Queue.size(); i < e; ++i)
dbgs() << Queue[i]->NodeNum << " "; dbgs() << Queue[i]->NodeNum << " ";
dbgs() << "\n"; dbgs() << "\n";
} }
#endif
}; };
/// ConvergingScheduler shrinks the unscheduled zone using heuristics to balance /// ConvergingScheduler shrinks the unscheduled zone using heuristics to balance

View File

@ -240,6 +240,7 @@ void SchedulePostRATDList::exitRegion() {
ScheduleDAGInstrs::exitRegion(); ScheduleDAGInstrs::exitRegion();
} }
#ifndef NDEBUG
/// dumpSchedule - dump the scheduled Sequence. /// dumpSchedule - dump the scheduled Sequence.
void SchedulePostRATDList::dumpSchedule() const { void SchedulePostRATDList::dumpSchedule() const {
for (unsigned i = 0, e = Sequence.size(); i != e; i++) { for (unsigned i = 0, e = Sequence.size(); i != e; i++) {
@ -249,6 +250,7 @@ void SchedulePostRATDList::dumpSchedule() const {
dbgs() << "**** NOOP ****\n"; dbgs() << "**** NOOP ****\n";
} }
} }
#endif
bool PostRAScheduler::runOnMachineFunction(MachineFunction &Fn) { bool PostRAScheduler::runOnMachineFunction(MachineFunction &Fn) {
TII = Fn.getTarget().getInstrInfo(); TII = Fn.getTarget().getInstrInfo();

View File

@ -63,6 +63,7 @@ void RegisterPressure::decrease(const TargetRegisterClass *RC,
decreaseSetPressure(MaxSetPressure, RC, TRI); decreaseSetPressure(MaxSetPressure, RC, TRI);
} }
#ifndef NDEBUG
void RegisterPressure::dump(const TargetRegisterInfo *TRI) { void RegisterPressure::dump(const TargetRegisterInfo *TRI) {
dbgs() << "Live In: "; dbgs() << "Live In: ";
for (unsigned i = 0, e = LiveInRegs.size(); i < e; ++i) for (unsigned i = 0, e = LiveInRegs.size(); i < e; ++i)
@ -78,6 +79,7 @@ void RegisterPressure::dump(const TargetRegisterInfo *TRI) {
<< '\n'; << '\n';
} }
} }
#endif
/// Increase the current pressure as impacted by these physical registers and /// Increase the current pressure as impacted by these physical registers and
/// bump the high water mark if needed. /// bump the high water mark if needed.

View File

@ -279,6 +279,7 @@ void SUnit::ComputeHeight() {
} while (!WorkList.empty()); } while (!WorkList.empty());
} }
#ifndef NDEBUG
/// SUnit - Scheduling unit. It's an wrapper around either a single SDNode or /// SUnit - Scheduling unit. It's an wrapper around either a single SDNode or
/// a group of nodes flagged together. /// a group of nodes flagged together.
void SUnit::dump(const ScheduleDAG *G) const { void SUnit::dump(const ScheduleDAG *G) const {
@ -336,6 +337,7 @@ void SUnit::dumpAll(const ScheduleDAG *G) const {
} }
dbgs() << "\n"; dbgs() << "\n";
} }
#endif
#ifndef NDEBUG #ifndef NDEBUG
/// VerifyScheduledDAG - Verify that all SUnits were scheduled and that /// VerifyScheduledDAG - Verify that all SUnits were scheduled and that

View File

@ -1012,7 +1012,9 @@ void ScheduleDAGInstrs::computeLatency(SUnit *SU) {
} }
void ScheduleDAGInstrs::dumpNode(const SUnit *SU) const { void ScheduleDAGInstrs::dumpNode(const SUnit *SU) const {
#ifndef NDEBUG
SU->getInstr()->dump(); SU->getInstr()->dump();
#endif
} }
std::string ScheduleDAGInstrs::getGraphNodeLabel(const SUnit *SU) const { std::string ScheduleDAGInstrs::getGraphNodeLabel(const SUnit *SU) const {

View File

@ -89,6 +89,7 @@ void ScoreboardHazardRecognizer::Reset() {
ReservedScoreboard.reset(); ReservedScoreboard.reset();
} }
#ifndef NDEBUG
void ScoreboardHazardRecognizer::Scoreboard::dump() const { void ScoreboardHazardRecognizer::Scoreboard::dump() const {
dbgs() << "Scoreboard:\n"; dbgs() << "Scoreboard:\n";
@ -104,6 +105,7 @@ void ScoreboardHazardRecognizer::Scoreboard::dump() const {
dbgs() << '\n'; dbgs() << '\n';
} }
} }
#endif
bool ScoreboardHazardRecognizer::atIssueLimit() const { bool ScoreboardHazardRecognizer::atIssueLimit() const {
if (IssueWidth == 0) if (IssueWidth == 0)

View File

@ -1758,6 +1758,7 @@ public:
return V; return V;
} }
#ifndef NDEBUG
void dump(ScheduleDAG *DAG) const { void dump(ScheduleDAG *DAG) const {
// Emulate pop() without clobbering NodeQueueIds. // Emulate pop() without clobbering NodeQueueIds.
std::vector<SUnit*> DumpQueue = Queue; std::vector<SUnit*> DumpQueue = Queue;
@ -1768,6 +1769,7 @@ public:
SU->dump(DAG); SU->dump(DAG);
} }
} }
#endif
}; };
typedef RegReductionPriorityQueue<bu_ls_rr_sort> typedef RegReductionPriorityQueue<bu_ls_rr_sort>
@ -1895,6 +1897,7 @@ unsigned RegReductionPQBase::getNodePriority(const SUnit *SU) const {
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
void RegReductionPQBase::dumpRegPressure() const { void RegReductionPQBase::dumpRegPressure() const {
#ifndef NDEBUG
for (TargetRegisterInfo::regclass_iterator I = TRI->regclass_begin(), for (TargetRegisterInfo::regclass_iterator I = TRI->regclass_begin(),
E = TRI->regclass_end(); I != E; ++I) { E = TRI->regclass_end(); I != E; ++I) {
const TargetRegisterClass *RC = *I; const TargetRegisterClass *RC = *I;
@ -1904,6 +1907,7 @@ void RegReductionPQBase::dumpRegPressure() const {
DEBUG(dbgs() << RC->getName() << ": " << RP << " / " << RegLimit[Id] DEBUG(dbgs() << RC->getName() << ": " << RP << " / " << RegLimit[Id]
<< '\n'); << '\n');
} }
#endif
} }
bool RegReductionPQBase::HighRegPressure(const SUnit *SU) const { bool RegReductionPQBase::HighRegPressure(const SUnit *SU) const {

View File

@ -643,6 +643,7 @@ void ScheduleDAGSDNodes::computeOperandLatency(SDNode *Def, SDNode *Use,
} }
void ScheduleDAGSDNodes::dumpNode(const SUnit *SU) const { void ScheduleDAGSDNodes::dumpNode(const SUnit *SU) const {
#ifndef NDEBUG
if (!SU->getNode()) { if (!SU->getNode()) {
dbgs() << "PHYS REG COPY\n"; dbgs() << "PHYS REG COPY\n";
return; return;
@ -659,8 +660,10 @@ void ScheduleDAGSDNodes::dumpNode(const SUnit *SU) const {
dbgs() << "\n"; dbgs() << "\n";
GluedNodes.pop_back(); GluedNodes.pop_back();
} }
#endif
} }
#ifndef NDEBUG
void ScheduleDAGSDNodes::dumpSchedule() const { void ScheduleDAGSDNodes::dumpSchedule() const {
for (unsigned i = 0, e = Sequence.size(); i != e; i++) { for (unsigned i = 0, e = Sequence.size(); i != e; i++) {
if (SUnit *SU = Sequence[i]) if (SUnit *SU = Sequence[i])
@ -669,6 +672,7 @@ void ScheduleDAGSDNodes::dumpSchedule() const {
dbgs() << "**** NOOP ****\n"; dbgs() << "**** NOOP ****\n";
} }
} }
#endif
#ifndef NDEBUG #ifndef NDEBUG
/// VerifyScheduledSequence - Verify that all SUnits were scheduled and that /// VerifyScheduledSequence - Verify that all SUnits were scheduled and that

View File

@ -143,6 +143,7 @@ void SlotIndexes::renumberIndexes(IndexList::iterator curItr) {
} }
#ifndef NDEBUG
void SlotIndexes::dump() const { void SlotIndexes::dump() const {
for (IndexList::const_iterator itr = indexList.begin(); for (IndexList::const_iterator itr = indexList.begin();
itr != indexList.end(); ++itr) { itr != indexList.end(); ++itr) {
@ -159,6 +160,7 @@ void SlotIndexes::dump() const {
dbgs() << "BB#" << i << "\t[" << MBBRanges[i].first << ';' dbgs() << "BB#" << i << "\t[" << MBBRanges[i].first << ';'
<< MBBRanges[i].second << ")\n"; << MBBRanges[i].second << ")\n";
} }
#endif
// Print a SlotIndex to a raw_ostream. // Print a SlotIndex to a raw_ostream.
void SlotIndex::print(raw_ostream &os) const { void SlotIndex::print(raw_ostream &os) const {
@ -168,9 +170,11 @@ void SlotIndex::print(raw_ostream &os) const {
os << "invalid"; os << "invalid";
} }
#ifndef NDEBUG
// Dump a SlotIndex to stderr. // Dump a SlotIndex to stderr.
void SlotIndex::dump() const { void SlotIndex::dump() const {
print(dbgs()); print(dbgs());
dbgs() << "\n"; dbgs() << "\n";
} }
#endif

View File

@ -356,6 +356,7 @@ void SplitEditor::reset(LiveRangeEdit &LRE, ComplementSpillMode SM) {
Edit->anyRematerializable(0); Edit->anyRematerializable(0);
} }
#ifndef NDEBUG
void SplitEditor::dump() const { void SplitEditor::dump() const {
if (RegAssign.empty()) { if (RegAssign.empty()) {
dbgs() << " empty\n"; dbgs() << " empty\n";
@ -366,6 +367,7 @@ void SplitEditor::dump() const {
dbgs() << " [" << I.start() << ';' << I.stop() << "):" << I.value(); dbgs() << " [" << I.start() << ';' << I.stop() << "):" << I.value();
dbgs() << '\n'; dbgs() << '\n';
} }
#endif
VNInfo *SplitEditor::defValue(unsigned RegIdx, VNInfo *SplitEditor::defValue(unsigned RegIdx,
const VNInfo *ParentVNI, const VNInfo *ParentVNI,

View File

@ -126,9 +126,11 @@ void VirtRegMap::print(raw_ostream &OS, const Module*) const {
OS << '\n'; OS << '\n';
} }
#ifndef NDEBUG
void VirtRegMap::dump() const { void VirtRegMap::dump() const {
print(dbgs()); print(dbgs());
} }
#endif
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// VirtRegRewriter // VirtRegRewriter

View File

@ -171,6 +171,7 @@ namespace {
// Shuffle live registers to match the expectations of successor blocks. // Shuffle live registers to match the expectations of successor blocks.
void finishBlockStack(); void finishBlockStack();
#ifndef NDEBUG
void dumpStack() const { void dumpStack() const {
dbgs() << "Stack contents:"; dbgs() << "Stack contents:";
for (unsigned i = 0; i != StackTop; ++i) { for (unsigned i = 0; i != StackTop; ++i) {
@ -181,6 +182,7 @@ namespace {
dbgs() << ", ST" << i << " in FP" << unsigned(PendingST[i]); dbgs() << ", ST" << i << " in FP" << unsigned(PendingST[i]);
dbgs() << "\n"; dbgs() << "\n";
} }
#endif
/// getSlot - Return the stack slot number a particular register number is /// getSlot - Return the stack slot number a particular register number is
/// in. /// in.

View File

@ -100,6 +100,7 @@ namespace {
Base_Reg = Reg; Base_Reg = Reg;
} }
#ifndef NDEBUG
void dump() { void dump() {
dbgs() << "X86ISelAddressMode " << this << '\n'; dbgs() << "X86ISelAddressMode " << this << '\n';
dbgs() << "Base_Reg "; dbgs() << "Base_Reg ";
@ -133,6 +134,7 @@ namespace {
dbgs() << "nul"; dbgs() << "nul";
dbgs() << " JT" << JT << " Align" << Align << '\n'; dbgs() << " JT" << JT << " Align" << Align << '\n';
} }
#endif
}; };
} }