Skip to content
Commit 9c3b8944 authored by Duncan P. N. Exon Smith's avatar Duncan P. N. Exon Smith
Browse files

DebugInfo: Use TempMDNode in DIDescriptor::replaceAllUsesWith()

Start using `TempMDNode` in `DIDescriptor::replaceAllUsesWith()`
(effectively `std::unique_ptr<MDNode, MDNode::deleteTemporary>`).

Besides making ownership more explicit, this prepares for when
`DIDescriptor` refers to nodes that are *not* `MDTuple`.  The old logic
for "replacing" a node with itself used `MDNode::get()` to return a new
(uniqued) `MDTuple`, while the new logic just defers to
`MDNode::replaceWithUniqued()` (which also typically saves an allocation
and RAUW traffic by mutating the temporary in place).

llvm-svn: 230879
parent db962e2a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment