summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Instructions.cpp
diff options
context:
space:
mode:
authorPete Cooper <peter_cooper@apple.com>2015-06-10 22:38:46 +0000
committerPete Cooper <peter_cooper@apple.com>2015-06-10 22:38:46 +0000
commit3fc304086048ffe13a9008cbd510fd8b5c6c0b8b (patch)
treea15f45eb2a406bcde622df93436a71768172533d /llvm/lib/IR/Instructions.cpp
parent93f9ff5781978963f2252ec36d402a1ef23a0500 (diff)
downloadbcm5719-llvm-3fc304086048ffe13a9008cbd510fd8b5c6c0b8b.tar.gz
bcm5719-llvm-3fc304086048ffe13a9008cbd510fd8b5c6c0b8b.zip
Stop returning a Use* from allocHungOffUses.
This always just set the User::OperandList which is now set in that method instead of being returned. Reviewed by Duncan Exon Smith. llvm-svn: 239493
Diffstat (limited to 'llvm/lib/IR/Instructions.cpp')
-rw-r--r--llvm/lib/IR/Instructions.cpp27
1 files changed, 14 insertions, 13 deletions
diff --git a/llvm/lib/IR/Instructions.cpp b/llvm/lib/IR/Instructions.cpp
index 5fb51156638..73b966f808e 100644
--- a/llvm/lib/IR/Instructions.cpp
+++ b/llvm/lib/IR/Instructions.cpp
@@ -85,9 +85,9 @@ const char *SelectInst::areInvalidOperands(Value *Op0, Value *Op1, Value *Op2) {
//===----------------------------------------------------------------------===//
PHINode::PHINode(const PHINode &PN)
- : Instruction(PN.getType(), Instruction::PHI,
- allocHungoffUses(PN.getNumOperands()), PN.getNumOperands()),
- ReservedSpace(PN.getNumOperands()) {
+ : Instruction(PN.getType(), Instruction::PHI, nullptr, PN.getNumOperands()),
+ ReservedSpace(PN.getNumOperands()) {
+ allocHungoffUses(PN.getNumOperands());
std::copy(PN.op_begin(), PN.op_end(), op_begin());
std::copy(PN.block_begin(), PN.block_end(), block_begin());
SubclassOptionalData = PN.SubclassOptionalData;
@@ -168,9 +168,10 @@ LandingPadInst::LandingPadInst(Type *RetTy, Value *PersonalityFn,
}
LandingPadInst::LandingPadInst(const LandingPadInst &LP)
- : Instruction(LP.getType(), Instruction::LandingPad,
- allocHungoffUses(LP.getNumOperands()), LP.getNumOperands()),
- ReservedSpace(LP.getNumOperands()) {
+ : Instruction(LP.getType(), Instruction::LandingPad, nullptr,
+ LP.getNumOperands()),
+ ReservedSpace(LP.getNumOperands()) {
+ allocHungoffUses(LP.getNumOperands());
Use *OL = OperandList, *InOL = LP.OperandList;
for (unsigned I = 0, E = ReservedSpace; I != E; ++I)
OL[I] = InOL[I];
@@ -198,7 +199,7 @@ void LandingPadInst::init(Value *PersFn, unsigned NumReservedValues,
const Twine &NameStr) {
ReservedSpace = NumReservedValues;
NumOperands = 1;
- OperandList = allocHungoffUses(ReservedSpace);
+ allocHungoffUses(ReservedSpace);
Op<0>() = PersFn;
setName(NameStr);
setCleanup(false);
@@ -3262,7 +3263,7 @@ void SwitchInst::init(Value *Value, BasicBlock *Default, unsigned NumReserved) {
assert(Value && Default && NumReserved);
ReservedSpace = NumReserved;
NumOperands = 2;
- OperandList = allocHungoffUses(ReservedSpace);
+ allocHungoffUses(ReservedSpace);
Op<0>() = Value;
Op<1>() = Default;
@@ -3371,8 +3372,8 @@ void IndirectBrInst::init(Value *Address, unsigned NumDests) {
"Address of indirectbr must be a pointer");
ReservedSpace = 1+NumDests;
NumOperands = 1;
- OperandList = allocHungoffUses(ReservedSpace);
-
+ allocHungoffUses(ReservedSpace);
+
Op<0>() = Address;
}
@@ -3403,9 +3404,9 @@ IndirectBrInst::IndirectBrInst(Value *Address, unsigned NumCases,
}
IndirectBrInst::IndirectBrInst(const IndirectBrInst &IBI)
- : TerminatorInst(Type::getVoidTy(IBI.getContext()), Instruction::IndirectBr,
- allocHungoffUses(IBI.getNumOperands()),
- IBI.getNumOperands()) {
+ : TerminatorInst(Type::getVoidTy(IBI.getContext()), Instruction::IndirectBr,
+ nullptr, IBI.getNumOperands()) {
+ allocHungoffUses(IBI.getNumOperands());
Use *OL = OperandList, *InOL = IBI.OperandList;
for (unsigned i = 0, E = IBI.getNumOperands(); i != E; ++i)
OL[i] = InOL[i];
OpenPOWER on IntegriCloud