[llvm] r237967 - Use Op<0> accessor instead of OperandList for Instructions. NFC
Pete Cooper
peter_cooper at apple.com
Thu May 21 15:48:55 PDT 2015
Author: pete
Date: Thu May 21 17:48:54 2015
New Revision: 237967
URL: http://llvm.org/viewvc/llvm-project?rev=237967&view=rev
Log:
Use Op<0> accessor instead of OperandList for Instructions. NFC
This is consistent with other uses of the operand list. I'm planning a future commit where this will actually matter.
Modified:
llvm/trunk/lib/IR/Constants.cpp
llvm/trunk/lib/IR/Instructions.cpp
Modified: llvm/trunk/lib/IR/Constants.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Constants.cpp?rev=237967&r1=237966&r2=237967&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Constants.cpp (original)
+++ llvm/trunk/lib/IR/Constants.cpp Thu May 21 17:48:54 2015
@@ -2388,7 +2388,7 @@ GetElementPtrConstantExpr::GetElementPtr
(IdxList.size() + 1),
IdxList.size() + 1),
SrcElementTy(SrcElementTy) {
- OperandList[0] = C;
+ Op<0>() = C;
for (unsigned i = 0, E = IdxList.size(); i != E; ++i)
OperandList[i+1] = IdxList[i];
}
Modified: llvm/trunk/lib/IR/Instructions.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Instructions.cpp?rev=237967&r1=237966&r2=237967&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Instructions.cpp (original)
+++ llvm/trunk/lib/IR/Instructions.cpp Thu May 21 17:48:54 2015
@@ -227,7 +227,7 @@ void LandingPadInst::init(Value *PersFn,
ReservedSpace = NumReservedValues;
NumOperands = 1;
OperandList = allocHungoffUses(ReservedSpace);
- OperandList[0] = PersFn;
+ Op<0>() = PersFn;
setName(NameStr);
setCleanup(false);
}
@@ -1239,7 +1239,7 @@ FenceInst::FenceInst(LLVMContext &C, Ato
void GetElementPtrInst::init(Value *Ptr, ArrayRef<Value *> IdxList,
const Twine &Name) {
assert(NumOperands == 1 + IdxList.size() && "NumOperands not initialized?");
- OperandList[0] = Ptr;
+ Op<0>() = Ptr;
std::copy(IdxList.begin(), IdxList.end(), op_begin() + 1);
setName(Name);
}
@@ -3298,8 +3298,8 @@ void SwitchInst::init(Value *Value, Basi
NumOperands = 2;
OperandList = allocHungoffUses(ReservedSpace);
- OperandList[0] = Value;
- OperandList[1] = Default;
+ Op<0>() = Value;
+ Op<1>() = Default;
}
/// SwitchInst ctor - Create a new switch instruction, specifying a value to
@@ -3417,7 +3417,7 @@ void IndirectBrInst::init(Value *Address
NumOperands = 1;
OperandList = allocHungoffUses(ReservedSpace);
- OperandList[0] = Address;
+ Op<0>() = Address;
}
More information about the llvm-commits
mailing list