From: Duncan P. N. Exon Smith Date: Tue, 13 Jan 2015 00:57:27 +0000 (+0000) Subject: IR: Use unique_ptr, NFC X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=6e4bbf0390ba812882b545611b4d25363dfd0d23;p=oota-llvm.git IR: Use unique_ptr, NFC Use `std::unique_ptr<>`, as suggested by David Blaikie. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225749 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/unittests/IR/MetadataTest.cpp b/unittests/IR/MetadataTest.cpp index d85225561b2..d07199cb336 100644 --- a/unittests/IR/MetadataTest.cpp +++ b/unittests/IR/MetadataTest.cpp @@ -303,19 +303,18 @@ TEST_F(MDNodeTest, handleChangedOperandRecursion) { MDNode *N0 = MDNode::get(Context, None); // !1 = !{!3, null} - MDNodeFwdDecl *Temp3 = MDNode::getTemporary(Context, None); - Metadata *Ops1[] = {Temp3, nullptr}; + std::unique_ptr Temp3(MDNode::getTemporary(Context, None)); + Metadata *Ops1[] = {Temp3.get(), nullptr}; MDNode *N1 = MDNode::get(Context, Ops1); // !2 = !{!3, !0} - Metadata *Ops2[] = {Temp3, N0}; + Metadata *Ops2[] = {Temp3.get(), N0}; MDNode *N2 = MDNode::get(Context, Ops2); // !3 = !{!2} Metadata *Ops3[] = {N2}; MDNode *N3 = MDNode::get(Context, Ops3); Temp3->replaceAllUsesWith(N3); - delete Temp3; // !4 = !{!1} Metadata *Ops4[] = {N1};