This patch is https://reviews.llvm.org/
D129468 follow-up and address one of comment
coming from that review: https://reviews.llvm.org/
D129468#
3643295
Differential Revision: https://reviews.llvm.org/
D129565
return const_cast<MDNode *>(this)->mutable_end();
}
- op_range operands() const { return op_range(op_begin(), op_end()); }
+ ArrayRef<MDOperand> operands() const { return getHeader().operands(); }
const MDOperand &getOperand(unsigned I) const {
assert(I < getNumOperands() && "Out of range");
StorageType Storage, bool ShouldCreate = true);
TempMDTuple cloneImpl() const {
- return getTemporary(getContext(), SmallVector<Metadata *, 4>(operands()));
+ ArrayRef<MDOperand> Operands = operands();
+ return getTemporary(getContext(), SmallVector<Metadata *, 4>(
+ Operands.begin(), Operands.end()));
}
public:
/// given offset. Update the offset to be relative to the field type.
TBAAStructTypeNode getField(uint64_t &Offset) const {
bool NewFormat = isNewFormat();
- const ArrayRef<MDOperand> Operands(Node->op_begin(), Node->op_end());
+ const ArrayRef<MDOperand> Operands = Node->operands();
const unsigned NumOperands = Operands.size();
if (NewFormat) {
return nullptr;
// Otherwise, create TBAA with the new Len
- SmallVector<Metadata *, 4> NextNodes(MD->operands());
+ ArrayRef<MDOperand> MDOperands = MD->operands();
+ SmallVector<Metadata *, 4> NextNodes(MDOperands.begin(), MDOperands.end());
ConstantInt *PreviousSize = mdconst::extract<ConstantInt>(NextNodes[3]);
// Don't create a new MDNode if it is the same length.
"Expected MDTuple when appending module flags");
if (DstValue->isDistinct())
return dyn_cast<MDTuple>(DstValue);
+ ArrayRef<MDOperand> DstOperands = DstValue->operands();
MDTuple *New = MDTuple::getDistinct(
- DstM.getContext(), SmallVector<Metadata *, 4>(DstValue->operands()));
+ DstM.getContext(),
+ SmallVector<Metadata *, 4>(DstOperands.begin(), DstOperands.end()));
Metadata *FlagOps[] = {DstOp->getOperand(0), ID, New};
MDNode *Flag = MDTuple::getDistinct(DstM.getContext(), FlagOps);
DstModFlags->setOperand(DstIndex, Flag);