summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2014-12-10 01:45:04 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2014-12-10 01:45:04 +0000
commitf14b1df55b64aa66ec799b948ef99c1558a4c4c8 (patch)
tree81352ef2c591cd0847b22e579233573f495427a3
parent2dc1b0f51487e7f16c013074b618c2040f01f898 (diff)
downloadbcm5719-llvm-f14b1df55b64aa66ec799b948ef99c1558a4c4c8.tar.gz
bcm5719-llvm-f14b1df55b64aa66ec799b948ef99c1558a4c4c8.zip
IR: Move call to dropAllReferences() to MDNode subclasses
Don't call `dropAllReferences()` from `MDNode::~MDNode()`, call it directly from `~MDNodeFwdDecl()` and `~GenericMDNode()`. llvm-svn: 223904
-rw-r--r--llvm/include/llvm/IR/Metadata.h4
-rw-r--r--llvm/lib/IR/Metadata.cpp1
2 files changed, 3 insertions, 2 deletions
diff --git a/llvm/include/llvm/IR/Metadata.h b/llvm/include/llvm/IR/Metadata.h
index 573e49fbb06..5e1b294fa1f 100644
--- a/llvm/include/llvm/IR/Metadata.h
+++ b/llvm/include/llvm/IR/Metadata.h
@@ -598,7 +598,7 @@ protected:
}
MDNode(LLVMContext &Context, unsigned ID, ArrayRef<Metadata *> MDs);
- ~MDNode() { dropAllReferences(); }
+ ~MDNode() {}
void dropAllReferences();
void storeDistinctInContext();
@@ -766,7 +766,7 @@ class MDNodeFwdDecl : public MDNode, ReplaceableMetadataImpl {
MDNodeFwdDecl(LLVMContext &C, ArrayRef<Metadata *> Vals)
: MDNode(C, MDNodeFwdDeclKind, Vals) {}
- ~MDNodeFwdDecl() {}
+ ~MDNodeFwdDecl() { dropAllReferences(); }
public:
static bool classof(const Metadata *MD) {
diff --git a/llvm/lib/IR/Metadata.cpp b/llvm/lib/IR/Metadata.cpp
index 0f748495261..506284fa87a 100644
--- a/llvm/lib/IR/Metadata.cpp
+++ b/llvm/lib/IR/Metadata.cpp
@@ -428,6 +428,7 @@ GenericMDNode::~GenericMDNode() {
pImpl->NonUniquedMDNodes.erase(this);
else
pImpl->MDNodeSet.erase(this);
+ dropAllReferences();
}
void GenericMDNode::resolve() {
OpenPOWER on IntegriCloud