mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-03 13:31:05 +00:00
avoid temporary CallbackVH's.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92218 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b241b37031
commit
1d880e5114
@ -64,6 +64,11 @@ public:
|
|||||||
MDNodeElement(Value *V, MDNode *P) : CallbackVH(V), Parent(P) {}
|
MDNodeElement(Value *V, MDNode *P) : CallbackVH(V), Parent(P) {}
|
||||||
~MDNodeElement() {}
|
~MDNodeElement() {}
|
||||||
|
|
||||||
|
void set(Value *V, MDNode *P) {
|
||||||
|
setValPtr(V);
|
||||||
|
Parent = P;
|
||||||
|
}
|
||||||
|
|
||||||
virtual void deleted();
|
virtual void deleted();
|
||||||
virtual void allUsesReplacedWith(Value *NV);
|
virtual void allUsesReplacedWith(Value *NV);
|
||||||
};
|
};
|
||||||
@ -91,7 +96,7 @@ MDNode::MDNode(LLVMContext &C, Value *const *Vals, unsigned NumVals,
|
|||||||
Operands = new MDNodeElement[NumOperands];
|
Operands = new MDNodeElement[NumOperands];
|
||||||
MDNodeElement *Ptr = Operands;
|
MDNodeElement *Ptr = Operands;
|
||||||
for (unsigned i = 0; i != NumVals; ++i)
|
for (unsigned i = 0; i != NumVals; ++i)
|
||||||
Ptr[i] = MDNodeElement(Vals[i], this);
|
Ptr[i].set(Vals[i], this);
|
||||||
|
|
||||||
if (isFunctionLocal)
|
if (isFunctionLocal)
|
||||||
SubclassData |= FunctionLocalBit;
|
SubclassData |= FunctionLocalBit;
|
||||||
@ -161,9 +166,8 @@ void MDNode::replaceElement(Value *From, Value *To) {
|
|||||||
|
|
||||||
// Replace From element(s) in place.
|
// Replace From element(s) in place.
|
||||||
for (SmallVector<unsigned, 4>::iterator I = Indexes.begin(), E = Indexes.end();
|
for (SmallVector<unsigned, 4>::iterator I = Indexes.begin(), E = Indexes.end();
|
||||||
I != E; ++I) {
|
I != E; ++I)
|
||||||
Operands[*I] = MDNodeElement(To, this);
|
Operands[*I].set(To, this);
|
||||||
}
|
|
||||||
|
|
||||||
// Insert updated "this" into the context's folding node set.
|
// Insert updated "this" into the context's folding node set.
|
||||||
// If a node with same element list already exist then before inserting
|
// If a node with same element list already exist then before inserting
|
||||||
|
Loading…
Reference in New Issue
Block a user