mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-23 01:24:30 +00:00
IR: Split MDNode into GenericMDNode and MDNodeFwdDecl
Split `MDNode` into two classes: - `GenericMDNode`, which is uniquable (and for now, always starts uniqued). Once `Metadata` is split from the `Value` hierarchy, this class will lose the ability to RAUW itself. - `MDNodeFwdDecl`, which is used for the "temporary" interface, is never uniqued, and isn't managed by `LLVMContext` at all. I've left most of the guts in `MDNode` for now, but I'll incrementally move things to the right places (or delete the functionality, as appropriate). Part of PR21532. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222205 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -122,13 +122,12 @@ LLVMContextImpl::~LLVMContextImpl() {
|
||||
|
||||
// Destroy MDNodes. ~MDNode can move and remove nodes between the MDNodeSet
|
||||
// and the NonUniquedMDNodes sets, so copy the values out first.
|
||||
SmallVector<MDNode*, 8> MDNodes;
|
||||
SmallVector<GenericMDNode *, 8> MDNodes;
|
||||
MDNodes.reserve(MDNodeSet.size() + NonUniquedMDNodes.size());
|
||||
MDNodes.append(MDNodeSet.begin(), MDNodeSet.end());
|
||||
MDNodes.append(NonUniquedMDNodes.begin(), NonUniquedMDNodes.end());
|
||||
for (SmallVectorImpl<MDNode *>::iterator I = MDNodes.begin(),
|
||||
E = MDNodes.end(); I != E; ++I)
|
||||
(*I)->destroy();
|
||||
for (auto &I : MDNodes)
|
||||
I->destroy();
|
||||
assert(MDNodeSet.empty() && NonUniquedMDNodes.empty() &&
|
||||
"Destroying all MDNodes didn't empty the Context's sets.");
|
||||
|
||||
|
Reference in New Issue
Block a user