From: Duncan P. N. Exon Smith Date: Mon, 19 Jan 2015 21:30:48 +0000 (+0000) Subject: CodeGen: Update LoopAttributes for LLVM API change X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f2dc900c25c157acb4acb2fb1d9618cd1a807854;p=clang CodeGen: Update LoopAttributes for LLVM API change `MDNode::getTemporary()` returns a `unique_ptr<>` as of r226504. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@226505 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGLoopInfo.cpp b/lib/CodeGen/CGLoopInfo.cpp index 89f43c2815..011ae7e836 100644 --- a/lib/CodeGen/CGLoopInfo.cpp +++ b/lib/CodeGen/CGLoopInfo.cpp @@ -26,8 +26,8 @@ static MDNode *createMetadata(LLVMContext &Ctx, const LoopAttributes &Attrs) { SmallVector Args; // Reserve operand 0 for loop id self reference. - MDNode *TempNode = MDNode::getTemporary(Ctx, None); - Args.push_back(TempNode); + auto TempNode = MDNode::getTemporary(Ctx, None); + Args.push_back(TempNode.get()); // Setting vectorizer.width if (Attrs.VectorizerWidth > 0) { @@ -58,7 +58,6 @@ static MDNode *createMetadata(LLVMContext &Ctx, const LoopAttributes &Attrs) { // Set the first operand to itself. MDNode *LoopID = MDNode::get(Ctx, Args); LoopID->replaceOperandWith(0, LoopID); - MDNode::deleteTemporary(TempNode); return LoopID; }