diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/VMCore/Instructions.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/VMCore/Instructions.cpp b/lib/VMCore/Instructions.cpp index e7dd40d059..9398c7f872 100644 --- a/lib/VMCore/Instructions.cpp +++ b/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 |