Use Op<0> accessor instead of OperandList for Instructions. NFC
authorPete Cooper <peter_cooper@apple.com>
Thu, 21 May 2015 22:48:54 +0000 (22:48 +0000)
committerPete Cooper <peter_cooper@apple.com>
Thu, 21 May 2015 22:48:54 +0000 (22:48 +0000)
This is consistent with other uses of the operand list.  I'm planning a future commit where this will actually matter.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237967 91177308-0d34-0410-b5e6-96231b3b80d8

lib/IR/Constants.cpp
lib/IR/Instructions.cpp

index d35372a2f8eff751f306ff2b9100417707205a97..fb83ebbbd878d6970011a2a9573bfcb64a7ac78b 100644 (file)
@@ -2388,7 +2388,7 @@ GetElementPtrConstantExpr::GetElementPtrConstantExpr(
                        (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];
 }
index 571eeea5f23f208a3eebe4cb5e83ae2f5b595429..1e9d9a5695dce015fad9b8707a84c15cd06e2089 100644 (file)
@@ -227,7 +227,7 @@ void LandingPadInst::init(Value *PersFn, unsigned NumReservedValues,
   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, AtomicOrdering Ordering,
 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, BasicBlock *Default, unsigned NumReserved) {
   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, unsigned NumDests) {
   NumOperands = 1;
   OperandList = allocHungoffUses(ReservedSpace);
   
-  OperandList[0] = Address;
+  Op<0>() = Address;
 }