From 0f338a1e8cd8167d22e2d011e0bec7eaadc6154a Mon Sep 17 00:00:00 2001 From: Alkis Evlogimenos Date: Sun, 22 Feb 2004 05:46:04 +0000 Subject: [PATCH] Print basic block boundaries in machine instruction debug output. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11704 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/LiveIntervalAnalysis.cpp | 11 +++++++---- lib/CodeGen/RegAllocLinearScan.cpp | 1 + 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp index f15d6cd1b35..21d3904cf07 100644 --- a/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/lib/CodeGen/LiveIntervalAnalysis.cpp @@ -171,10 +171,13 @@ bool LiveIntervals::runOnMachineFunction(MachineFunction &fn) { std::ostream_iterator(std::cerr, "\n"))); DEBUG(std::cerr << "********** MACHINEINSTRS **********\n"); DEBUG( - for (unsigned i = 0; i != i2miMap_.size(); ++i) { - if (const MachineInstr* mi = i2miMap_[i]) { - std:: cerr << i * InstrSlots::NUM << '\t'; - mi->print(std::cerr, *tm_); + for (MachineFunction::iterator mbbi = mf_->begin(), mbbe = mf_->end(); + mbbi != mbbe; ++mbbi) { + std::cerr << mbbi->getBasicBlock()->getName() << ":\n"; + for (MachineBasicBlock::iterator mii = mbbi->begin(), + mie = mbbi->end(); mii != mie; ++mii) { + std::cerr << getInstructionIndex(mii) << '\t'; + mii->print(std::cerr, *tm_); } }); diff --git a/lib/CodeGen/RegAllocLinearScan.cpp b/lib/CodeGen/RegAllocLinearScan.cpp index 25c37f6d1a8..357a9fcd1a1 100644 --- a/lib/CodeGen/RegAllocLinearScan.cpp +++ b/lib/CodeGen/RegAllocLinearScan.cpp @@ -360,6 +360,7 @@ bool RA::runOnMachineFunction(MachineFunction &fn) { DEBUG( for (MachineFunction::iterator mbbi = mf_->begin(), mbbe = mf_->end(); mbbi != mbbe; ++mbbi) { + std::cerr << mbbi->getBasicBlock()->getName() << ":\n"; for (MachineBasicBlock::iterator mii = mbbi->begin(), mie = mbbi->end(); mii != mie; ++mii) { unsigned index = li_->getInstructionIndex(mii);