[llvm-branch-commits] [llvm-branch] r89614 - in /llvm/branches/Apple/Zoidberg: include/llvm/CodeGen/MachineBasicBlock.h lib/CodeGen/LiveIntervalAnalysis.cpp lib/CodeGen/MachineBasicBlock.cpp lib/CodeGen/MachineLICM.cpp lib/CodeGen/MachineVerifier.cpp lib/CodeGen/SimpleRegisterCoalescing.cpp lib/CodeGen/VirtRegRewriter.cpp
Jakob Stoklund Olesen
stoklund at 2pi.dk
Sun Nov 22 11:29:39 PST 2009
Author: stoklund
Date: Sun Nov 22 13:29:39 2009
New Revision: 89614
URL: http://llvm.org/viewvc/llvm-project?rev=89614&view=rev
Log:
89428
Modified:
llvm/branches/Apple/Zoidberg/include/llvm/CodeGen/MachineBasicBlock.h
llvm/branches/Apple/Zoidberg/lib/CodeGen/LiveIntervalAnalysis.cpp
llvm/branches/Apple/Zoidberg/lib/CodeGen/MachineBasicBlock.cpp
llvm/branches/Apple/Zoidberg/lib/CodeGen/MachineLICM.cpp
llvm/branches/Apple/Zoidberg/lib/CodeGen/MachineVerifier.cpp
llvm/branches/Apple/Zoidberg/lib/CodeGen/SimpleRegisterCoalescing.cpp
llvm/branches/Apple/Zoidberg/lib/CodeGen/VirtRegRewriter.cpp
Modified: llvm/branches/Apple/Zoidberg/include/llvm/CodeGen/MachineBasicBlock.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Zoidberg/include/llvm/CodeGen/MachineBasicBlock.h?rev=89614&r1=89613&r2=89614&view=diff
==============================================================================
--- llvm/branches/Apple/Zoidberg/include/llvm/CodeGen/MachineBasicBlock.h (original)
+++ llvm/branches/Apple/Zoidberg/include/llvm/CodeGen/MachineBasicBlock.h Sun Nov 22 13:29:39 2009
@@ -92,10 +92,15 @@
public:
/// getBasicBlock - Return the LLVM basic block that this instance
- /// corresponded to originally.
+ /// corresponded to originally. Note that this may be NULL if this instance
+ /// does not correspond directly to an LLVM basic block.
///
const BasicBlock *getBasicBlock() const { return BB; }
+ /// getName - Return the name of the corresponding LLVM basic block, or
+ /// "(null)".
+ StringRef getName() const;
+
/// hasAddressTaken - Test whether this block is potentially the target
/// of an indirect branch.
bool hasAddressTaken() const { return AddressTaken; }
Modified: llvm/branches/Apple/Zoidberg/lib/CodeGen/LiveIntervalAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Zoidberg/lib/CodeGen/LiveIntervalAnalysis.cpp?rev=89614&r1=89613&r2=89614&view=diff
==============================================================================
--- llvm/branches/Apple/Zoidberg/lib/CodeGen/LiveIntervalAnalysis.cpp (original)
+++ llvm/branches/Apple/Zoidberg/lib/CodeGen/LiveIntervalAnalysis.cpp Sun Nov 22 13:29:39 2009
@@ -136,7 +136,7 @@
for (MachineFunction::iterator mbbi = mf_->begin(), mbbe = mf_->end();
mbbi != mbbe; ++mbbi) {
- OS << ((Value*)mbbi->getBasicBlock())->getName() << ":\n";
+ OS << mbbi->getName() << ":\n";
for (MachineBasicBlock::iterator mii = mbbi->begin(),
mie = mbbi->end(); mii != mie; ++mii) {
OS << getInstructionIndex(mii) << '\t' << *mii;
@@ -658,7 +658,7 @@
MachineBasicBlock *MBB = MBBI;
// Track the index of the current machine instr.
SlotIndex MIIndex = getMBBStartIdx(MBB);
- DEBUG(errs() << ((Value*)MBB->getBasicBlock())->getName() << ":\n");
+ DEBUG(errs() << MBB->getName() << ":\n");
MachineBasicBlock::iterator MI = MBB->begin(), miEnd = MBB->end();
Modified: llvm/branches/Apple/Zoidberg/lib/CodeGen/MachineBasicBlock.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Zoidberg/lib/CodeGen/MachineBasicBlock.cpp?rev=89614&r1=89613&r2=89614&view=diff
==============================================================================
--- llvm/branches/Apple/Zoidberg/lib/CodeGen/MachineBasicBlock.cpp (original)
+++ llvm/branches/Apple/Zoidberg/lib/CodeGen/MachineBasicBlock.cpp Sun Nov 22 13:29:39 2009
@@ -172,6 +172,13 @@
os << " %reg" << RegNo;
}
+StringRef MachineBasicBlock::getName() const {
+ if (const BasicBlock *LBB = getBasicBlock())
+ return LBB->getName();
+ else
+ return "(null)";
+}
+
void MachineBasicBlock::print(raw_ostream &OS) const {
const MachineFunction *MF = getParent();
if (!MF) {
Modified: llvm/branches/Apple/Zoidberg/lib/CodeGen/MachineLICM.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Zoidberg/lib/CodeGen/MachineLICM.cpp?rev=89614&r1=89613&r2=89614&view=diff
==============================================================================
--- llvm/branches/Apple/Zoidberg/lib/CodeGen/MachineLICM.cpp (original)
+++ llvm/branches/Apple/Zoidberg/lib/CodeGen/MachineLICM.cpp Sun Nov 22 13:29:39 2009
@@ -524,10 +524,10 @@
errs() << *MI;
if (CurPreheader->getBasicBlock())
errs() << " to MachineBasicBlock "
- << CurPreheader->getBasicBlock()->getName();
+ << CurPreheader->getName();
if (MI->getParent()->getBasicBlock())
errs() << " from MachineBasicBlock "
- << MI->getParent()->getBasicBlock()->getName();
+ << MI->getParent()->getName();
errs() << "\n";
});
Modified: llvm/branches/Apple/Zoidberg/lib/CodeGen/MachineVerifier.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Zoidberg/lib/CodeGen/MachineVerifier.cpp?rev=89614&r1=89613&r2=89614&view=diff
==============================================================================
--- llvm/branches/Apple/Zoidberg/lib/CodeGen/MachineVerifier.cpp (original)
+++ llvm/branches/Apple/Zoidberg/lib/CodeGen/MachineVerifier.cpp Sun Nov 22 13:29:39 2009
@@ -305,7 +305,7 @@
void MachineVerifier::report(const char *msg, const MachineBasicBlock *MBB) {
assert(MBB);
report(msg, MBB->getParent());
- *OS << "- basic block: " << MBB->getBasicBlock()->getNameStr()
+ *OS << "- basic block: " << MBB->getName()
<< " " << (void*)MBB
<< " (BB#" << MBB->getNumber() << ")\n";
}
Modified: llvm/branches/Apple/Zoidberg/lib/CodeGen/SimpleRegisterCoalescing.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Zoidberg/lib/CodeGen/SimpleRegisterCoalescing.cpp?rev=89614&r1=89613&r2=89614&view=diff
==============================================================================
--- llvm/branches/Apple/Zoidberg/lib/CodeGen/SimpleRegisterCoalescing.cpp (original)
+++ llvm/branches/Apple/Zoidberg/lib/CodeGen/SimpleRegisterCoalescing.cpp Sun Nov 22 13:29:39 2009
@@ -2380,7 +2380,7 @@
void SimpleRegisterCoalescing::CopyCoalesceInMBB(MachineBasicBlock *MBB,
std::vector<CopyRec> &TryAgain) {
- DEBUG(errs() << ((Value*)MBB->getBasicBlock())->getName() << ":\n");
+ DEBUG(errs() << MBB->getName() << ":\n");
std::vector<CopyRec> VirtCopies;
std::vector<CopyRec> PhysCopies;
Modified: llvm/branches/Apple/Zoidberg/lib/CodeGen/VirtRegRewriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Zoidberg/lib/CodeGen/VirtRegRewriter.cpp?rev=89614&r1=89613&r2=89614&view=diff
==============================================================================
--- llvm/branches/Apple/Zoidberg/lib/CodeGen/VirtRegRewriter.cpp (original)
+++ llvm/branches/Apple/Zoidberg/lib/CodeGen/VirtRegRewriter.cpp Sun Nov 22 13:29:39 2009
@@ -1600,7 +1600,7 @@
std::vector<MachineOperand*> &KillOps) {
DEBUG(errs() << "\n**** Local spiller rewriting MBB '"
- << MBB.getBasicBlock()->getName() << "':\n");
+ << MBB.getName() << "':\n");
MachineFunction &MF = *MBB.getParent();
More information about the llvm-branch-commits
mailing list