aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJim Laskey <jlaskey@mac.com>2007-02-21 22:39:52 +0000
committerJim Laskey <jlaskey@mac.com>2007-02-21 22:39:52 +0000
commit30b8e51addc23fb317c03d093a25828d3d5be45a (patch)
treeb1df4dc2348e6c72bbb2732a0cf8ec9c482bcd63 /include
parent59667fe20379d65129ef5f3665e9f87e654c8623 (diff)
downloadexternal_llvm-30b8e51addc23fb317c03d093a25828d3d5be45a.zip
external_llvm-30b8e51addc23fb317c03d093a25828d3d5be45a.tar.gz
external_llvm-30b8e51addc23fb317c03d093a25828d3d5be45a.tar.bz2
Add a flag to MBBs to indicate whether it is an eh landing pad.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34474 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/CodeGen/MachineBasicBlock.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/include/llvm/CodeGen/MachineBasicBlock.h b/include/llvm/CodeGen/MachineBasicBlock.h
index 661430c..ed2219b 100644
--- a/include/llvm/CodeGen/MachineBasicBlock.h
+++ b/include/llvm/CodeGen/MachineBasicBlock.h
@@ -74,10 +74,15 @@ public:
/// LiveIns - Keep track of the physical registers that are livein of
/// the basicblock.
std::vector<unsigned> LiveIns;
+
+ /// IsLandingPad - Indicate that this basic block is entered via an
+ /// exception handler.
+ bool IsLandingPad;
public:
MachineBasicBlock(const BasicBlock *bb = 0) : Prev(0), Next(0), BB(bb),
- Number(-1), Parent(0) {
+ Number(-1), Parent(0),
+ IsLandingPad(false) {
Insts.parent = this;
}
@@ -152,6 +157,18 @@ public:
const_livein_iterator livein_end() const { return LiveIns.end(); }
bool livein_empty() const { return LiveIns.empty(); }
+ /// isLandingPad - Returns true if the block is a landing pad. That is
+ /// this basic block is entered via an exception handler.
+ bool isLandingPad() const { return IsLandingPad; }
+
+ /// setIsLandingPad - Indicates the block is a landing pad. That is
+ /// this basic block is entered via an exception handler.
+ void setIsLandingPad() { IsLandingPad = true; }
+
+ /// isAccessable - Returns true if the block is alive. That is, if it has
+ /// predecessors or is an eh landing pad.
+ bool isAccessable() const { return !pred_empty() || isLandingPad(); }
+
// Code Layout methods.
/// moveBefore/moveAfter - move 'this' block before or after the specified