mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-12 13:38:21 +00:00
Introduce a new temporary MDNode concept. Temporary MDNodes are
not part of the IR, are not uniqued, and may be safely RAUW'd. This replaces a variety of alternate mechanisms for achieving the same effect. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111681 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -333,9 +333,9 @@ void BitcodeReaderMDValueList::AssignValue(Value *V, unsigned Idx) {
|
||||
}
|
||||
|
||||
// If there was a forward reference to this value, replace it.
|
||||
Value *PrevVal = OldV;
|
||||
MDNode *PrevVal = cast<MDNode>(OldV);
|
||||
OldV->replaceAllUsesWith(V);
|
||||
delete PrevVal;
|
||||
MDNode::deleteTemporary(PrevVal);
|
||||
// Deleting PrevVal sets Idx value in MDValuePtrs to null. Set new
|
||||
// value for Idx.
|
||||
MDValuePtrs[Idx] = V;
|
||||
@ -351,7 +351,7 @@ Value *BitcodeReaderMDValueList::getValueFwdRef(unsigned Idx) {
|
||||
}
|
||||
|
||||
// Create and return a placeholder, which will later be RAUW'd.
|
||||
Value *V = new Argument(Type::getMetadataTy(Context));
|
||||
Value *V = MDNode::getTemporary(Context, 0, 0);
|
||||
MDValuePtrs[Idx] = V;
|
||||
return V;
|
||||
}
|
||||
|
Reference in New Issue
Block a user