aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/CodeGen/MachineBasicBlock.h
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2009-12-11 01:49:14 +0000
committerBill Wendling <isanbard@gmail.com>2009-12-11 01:49:14 +0000
commit4bde1ab82d4a520dca59db1fd212d77ac667b3a8 (patch)
tree8a324c08758ee0b1ef5b55a3aa75e02b30c27e11 /include/llvm/CodeGen/MachineBasicBlock.h
parent5278eb802fae2ee1a7b2a428596bc364d8bcd9db (diff)
downloadexternal_llvm-4bde1ab82d4a520dca59db1fd212d77ac667b3a8.zip
external_llvm-4bde1ab82d4a520dca59db1fd212d77ac667b3a8.tar.gz
external_llvm-4bde1ab82d4a520dca59db1fd212d77ac667b3a8.tar.bz2
A machine basic block may end in an unconditional branch, however it may have
more than one successor. Normally, these extra successors are dead. However, some of them may branch to exception handling landing pads. If we remove those successors, then the landing pads could go away if all predecessors to it are removed. Before, it was checking if the direct successor was the landing pad. But it could be the result of jumping through multiple basic blocks to get to it. If we were to only check for the existence of an EH_LABEL in the basic block and not remove successors if it's in there, then it could stop actually dead basic blocks from being removed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91092 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/MachineBasicBlock.h')
-rw-r--r--include/llvm/CodeGen/MachineBasicBlock.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/MachineBasicBlock.h b/include/llvm/CodeGen/MachineBasicBlock.h
index 6b4c640..023f9b6 100644
--- a/include/llvm/CodeGen/MachineBasicBlock.h
+++ b/include/llvm/CodeGen/MachineBasicBlock.h
@@ -327,6 +327,11 @@ public:
/// 'Old', change the code and CFG so that it branches to 'New' instead.
void ReplaceUsesOfBlockWith(MachineBasicBlock *Old, MachineBasicBlock *New);
+ /// BranchesToLandingPad - The basic block branches only to a landing pad or
+ /// to another basic block which branches only to a landing pad. No other
+ /// instructions are present other than the unconditional branch.
+ bool BranchesToLandingPad(const MachineBasicBlock *MBB) const;
+
/// CorrectExtraCFGEdges - Various pieces of code can cause excess edges in
/// the CFG to be inserted. If we have proven that MBB can only branch to
/// DestA and DestB, remove any other MBB successors from the CFG. DestA and