forked from OSchip/llvm-project
IR: Use std::vector instead of SmallPtrSet for distinct nodes, NFC
We never use the set-ness of SmallPtrSet for distinct nodes. Eventually we may start garbage-collecting or reference-counting nodes (in which cases we'd want to remove things from this collection, and a fast erase would be valuable), but in the meantime a vector is sufficient. llvm-svn: 266835
This commit is contained in:
parent
029a0567fa
commit
3eef9d180d
|
@ -33,6 +33,7 @@
|
|||
#include "llvm/IR/Metadata.h"
|
||||
#include "llvm/IR/ValueHandle.h"
|
||||
#include "llvm/Support/Dwarf.h"
|
||||
#include <vector>
|
||||
|
||||
namespace llvm {
|
||||
|
||||
|
@ -1026,9 +1027,9 @@ public:
|
|||
|
||||
// MDNodes may be uniqued or not uniqued. When they're not uniqued, they
|
||||
// aren't in the MDNodeSet, but they're still shared between objects, so no
|
||||
// one object can destroy them. This set allows us to at least destroy them
|
||||
// on Context destruction.
|
||||
SmallPtrSet<MDNode *, 1> DistinctMDNodes;
|
||||
// one object can destroy them. Keep track of them here so we can delete
|
||||
// them on context teardown.
|
||||
std::vector<MDNode *> DistinctMDNodes;
|
||||
|
||||
DenseMap<Type*, ConstantAggregateZero*> CAZConstants;
|
||||
|
||||
|
|
|
@ -806,7 +806,7 @@ void MDNode::storeDistinctInContext() {
|
|||
#include "llvm/IR/Metadata.def"
|
||||
}
|
||||
|
||||
getContext().pImpl->DistinctMDNodes.insert(this);
|
||||
getContext().pImpl->DistinctMDNodes.push_back(this);
|
||||
}
|
||||
|
||||
void MDNode::replaceOperandWith(unsigned I, Metadata *New) {
|
||||
|
|
Loading…
Reference in New Issue