MDNodeElement(Value *V, MDNode *P) : CallbackVH(V), Parent(P) {}
~MDNodeElement() {}
+ void set(Value *V, MDNode *P) {
+ setValPtr(V);
+ Parent = P;
+ }
+
virtual void deleted();
virtual void allUsesReplacedWith(Value *NV);
};
Operands = new MDNodeElement[NumOperands];
MDNodeElement *Ptr = Operands;
for (unsigned i = 0; i != NumVals; ++i)
- Ptr[i] = MDNodeElement(Vals[i], this);
+ Ptr[i].set(Vals[i], this);
if (isFunctionLocal)
SubclassData |= FunctionLocalBit;
// Replace From element(s) in place.
for (SmallVector<unsigned, 4>::iterator I = Indexes.begin(), E = Indexes.end();
- I != E; ++I) {
- Operands[*I] = MDNodeElement(To, this);
- }
+ I != E; ++I)
+ Operands[*I].set(To, this);
// Insert updated "this" into the context's folding node set.
// If a node with same element list already exist then before inserting