diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2009-11-20 01:17:03 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2009-11-20 01:17:03 +0000 |
commit | 2bbeaa8774cc9a89cb9575e1bca6c654f3b8fb44 (patch) | |
tree | d042bc1f749a54d24c3c3eef9ac3fdcbb9ab2264 /llvm/lib/CodeGen/MachineBasicBlock.cpp | |
parent | 62167b95162a6b06e48619b8d4d4c80fb363e5f2 (diff) | |
download | bcm5719-llvm-2bbeaa8774cc9a89cb9575e1bca6c654f3b8fb44.tar.gz bcm5719-llvm-2bbeaa8774cc9a89cb9575e1bca6c654f3b8fb44.zip |
Add MachineBasicBlock::getName, and use it in place of getBasicBlock()->getName.
Fix debug code that assumes getBasicBlock never returns NULL.
llvm-svn: 89428
Diffstat (limited to 'llvm/lib/CodeGen/MachineBasicBlock.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineBasicBlock.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineBasicBlock.cpp b/llvm/lib/CodeGen/MachineBasicBlock.cpp index cd52825d21f..2e6bd8a94b7 100644 --- a/llvm/lib/CodeGen/MachineBasicBlock.cpp +++ b/llvm/lib/CodeGen/MachineBasicBlock.cpp @@ -172,6 +172,13 @@ static inline void OutputReg(raw_ostream &os, unsigned RegNo, 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) { |