summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/Instructions.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2011-07-28 02:15:52 +0000
committerBill Wendling <isanbard@gmail.com>2011-07-28 02:15:52 +0000
commita8f04e303479adaf8518c27be9052453d87e1b56 (patch)
tree943fc5469621858fb29481383d32ce359dcabc11 /llvm/lib/VMCore/Instructions.cpp
parent8c19a8b5d5b4dd41c3155af035f40b79de3e8ef2 (diff)
downloadbcm5719-llvm-a8f04e303479adaf8518c27be9052453d87e1b56.tar.gz
bcm5719-llvm-a8f04e303479adaf8518c27be9052453d87e1b56.zip
Add a couple of convenience functions:
* InvokeInst: Get the landingpad instruction associated with this invoke. * LandingPadInst: A method to reserve extra space for clauses. llvm-svn: 136325
Diffstat (limited to 'llvm/lib/VMCore/Instructions.cpp')
-rw-r--r--llvm/lib/VMCore/Instructions.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/llvm/lib/VMCore/Instructions.cpp b/llvm/lib/VMCore/Instructions.cpp
index e7dd40d0599..9398c7f872c 100644
--- a/llvm/lib/VMCore/Instructions.cpp
+++ b/llvm/lib/VMCore/Instructions.cpp
@@ -214,6 +214,20 @@ void LandingPadInst::growOperands() {
Use::zap(OldOps, OldOps + e, true);
}
+void LandingPadInst::reserveClauses(unsigned Size) {
+ unsigned e = getNumOperands() + Size;
+ if (ReservedSpace >= e) return;
+ ReservedSpace = e;
+
+ Use *NewOps = allocHungoffUses(ReservedSpace);
+ Use *OldOps = OperandList;
+ for (unsigned i = 0; i != e; ++i)
+ NewOps[i] = OldOps[i];
+
+ OperandList = NewOps;
+ Use::zap(OldOps, OldOps + e, true);
+}
+
void LandingPadInst::addClause(ClauseType CT, Value *ClauseVal) {
unsigned OpNo = getNumOperands();
if (OpNo + 1 > ReservedSpace)
@@ -551,6 +565,9 @@ void InvokeInst::removeAttribute(unsigned i, Attributes attr) {
setAttributes(PAL);
}
+LandingPadInst *InvokeInst::getLandingPad() const {
+ return cast<LandingPadInst>(getUnwindDest()->getFirstNonPHI());
+}
//===----------------------------------------------------------------------===//
// ReturnInst Implementation
OpenPOWER on IntegriCloud