diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-02-04 19:33:11 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-02-04 19:33:11 +0000 |
commit | 096bd8837fd1e90c10db05af2614c962946a7a8a (patch) | |
tree | f45913dd532527603738db9d9c8c3cc0f27bc961 /llvm/lib/CodeGen/MachineBasicBlock.cpp | |
parent | fefe6ebc73589952256d62a46e2e2136c022dc19 (diff) | |
download | llvm-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.cpp | 10 |
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()); } |