aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineBasicBlock.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2011-02-04 19:33:11 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2011-02-04 19:33:11 +0000
commit096bd8837fd1e90c10db05af2614c962946a7a8a (patch)
treef45913dd532527603738db9d9c8c3cc0f27bc961 /llvm/lib/CodeGen/MachineBasicBlock.cpp
parentfefe6ebc73589952256d62a46e2e2136c022dc19 (diff)
downloadllvm-096bd8837fd1e90c10db05af2614c962946a7a8a.zip
llvm-096bd8837fd1e90c10db05af2614c962946a7a8a.tar.gz
llvm-096bd8837fd1e90c10db05af2614c962946a7a8a.tar.bz2
Add LiveIntervals::getLastSplitPoint().
A live range cannot be split everywhere in a basic block. A split must go before the first terminator, and if the variable is live into a landing pad, the split must happen before the call that can throw. llvm-svn: 124894
Diffstat (limited to 'llvm/lib/CodeGen/MachineBasicBlock.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineBasicBlock.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineBasicBlock.cpp b/llvm/lib/CodeGen/MachineBasicBlock.cpp
index 95b8f86..ccbff0a 100644
--- a/llvm/lib/CodeGen/MachineBasicBlock.cpp
+++ b/llvm/lib/CodeGen/MachineBasicBlock.cpp
@@ -175,6 +175,16 @@ MachineBasicBlock::iterator MachineBasicBlock::getLastNonDebugInstr() {
return end();
}
+const MachineBasicBlock *MachineBasicBlock::getLandingPadSuccessor() const {
+ // A block with a landing pad successor only has one other successor.
+ if (succ_size() > 2)
+ return 0;
+ for (const_succ_iterator I = succ_begin(), E = succ_end(); I != E; ++I)
+ if ((*I)->isLandingPad())
+ return *I;
+ return 0;
+}
+
void MachineBasicBlock::dump() const {
print(dbgs());
}