diff options
author | Jay Foad <jay.foad@gmail.com> | 2011-01-07 20:29:02 +0000 |
---|---|---|
committer | Jay Foad <jay.foad@gmail.com> | 2011-01-07 20:29:02 +0000 |
commit | 8e3914d12e939d7c686bd121b0e2b2d39ed126d2 (patch) | |
tree | 195a8c211ef2623f284982afa3fb2ac5c595ed00 /lib/VMCore/Instructions.cpp | |
parent | 43eaadeea5217995c153078c04b77183d4c8c494 (diff) | |
download | external_llvm-8e3914d12e939d7c686bd121b0e2b2d39ed126d2.tar.gz external_llvm-8e3914d12e939d7c686bd121b0e2b2d39ed126d2.tar.bz2 external_llvm-8e3914d12e939d7c686bd121b0e2b2d39ed126d2.zip |
Simplify the allocation and freeing of Users' operand lists, now that
every BranchInst has a fixed number of operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123027 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Instructions.cpp')
-rw-r--r-- | lib/VMCore/Instructions.cpp | 28 |
1 files changed, 1 insertions, 27 deletions
diff --git a/lib/VMCore/Instructions.cpp b/lib/VMCore/Instructions.cpp index f465907735..33acd0d040 100644 --- a/lib/VMCore/Instructions.cpp +++ b/lib/VMCore/Instructions.cpp @@ -730,31 +730,6 @@ BranchInst::BranchInst(const BranchInst &BI) : SubclassOptionalData = BI.SubclassOptionalData; } - -Use* Use::getPrefix() { - PointerIntPair<Use**, 2, PrevPtrTag> &PotentialPrefix(this[-1].Prev); - if (PotentialPrefix.getOpaqueValue()) - return 0; - - return reinterpret_cast<Use*>((char*)&PotentialPrefix + 1); -} - -BranchInst::~BranchInst() { - if (NumOperands == 1) { - if (Use *Prefix = OperandList->getPrefix()) { - Op<-1>() = 0; - // - // mark OperandList to have a special value for scrutiny - // by baseclass destructors and operator delete - OperandList = Prefix; - } else { - NumOperands = 3; - OperandList = op_begin(); - } - } -} - - BasicBlock *BranchInst::getSuccessorV(unsigned idx) const { return getSuccessor(idx); } @@ -3329,8 +3304,7 @@ ReturnInst *ReturnInst::clone_impl() const { } BranchInst *BranchInst::clone_impl() const { - unsigned Ops(getNumOperands()); - return new(Ops, Ops == 1) BranchInst(*this); + return new(getNumOperands()) BranchInst(*this); } SwitchInst *SwitchInst::clone_impl() const { |