llvm.org GIT mirror llvm / 45db33d
IR: Make MDNodeFwdDecl destructor public Now that the leak detector is gone, anyone can call this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225689 91177308-0d34-0410-b5e6-96231b3b80d8 Duncan P. N. Exon Smith 5 years ago
2 changed file(s) with 8 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
817817
818818 MDNodeFwdDecl(LLVMContext &C, ArrayRef Vals)
819819 : MDNode(C, MDNodeFwdDeclKind, Vals) {}
820
821 public:
820822 ~MDNodeFwdDecl() { dropAllReferences(); }
821
822 public:
823 using MDNode::operator delete;
824
823825 static bool classof(const Metadata *MD) {
824826 return MD->getMetadataID() == MDNodeFwdDeclKind;
825827 }
128128 delete I;
129129 }
130130
131 TEST_F(MDNodeTest, DeleteMDNodeFwdDecl) {
132 delete MDNode::getTemporary(Context, None);
133 }
134
131135 TEST_F(MDNodeTest, SelfReference) {
132136 // !0 = !{!0}
133137 // !1 = !{!0}