IR: Make MDNodeFwdDecl destructor public

Now that the leak detector is gone, anyone can call this.

llvm-svn: 225689
This commit is contained in:
Duncan P. N. Exon Smith 2015-01-12 20:19:54 +00:00
parent b4b05017cf
commit b565b10956
2 changed files with 7 additions and 1 deletions

View File

@ -818,9 +818,11 @@ class MDNodeFwdDecl : public MDNode, ReplaceableMetadataImpl {
MDNodeFwdDecl(LLVMContext &C, ArrayRef<Metadata *> Vals)
: MDNode(C, MDNodeFwdDeclKind, Vals) {}
~MDNodeFwdDecl() { dropAllReferences(); }
public:
~MDNodeFwdDecl() { dropAllReferences(); }
using MDNode::operator delete;
static bool classof(const Metadata *MD) {
return MD->getMetadataID() == MDNodeFwdDeclKind;
}

View File

@ -129,6 +129,10 @@ TEST_F(MDNodeTest, Delete) {
delete I;
}
TEST_F(MDNodeTest, DeleteMDNodeFwdDecl) {
delete MDNode::getTemporary(Context, None);
}
TEST_F(MDNodeTest, SelfReference) {
// !0 = !{!0}
// !1 = !{!0}