]> granicus.if.org Git - clang/commitdiff
CodeGen: Update LoopAttributes for LLVM API change
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Mon, 19 Jan 2015 21:30:48 +0000 (21:30 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Mon, 19 Jan 2015 21:30:48 +0000 (21:30 +0000)
`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

lib/CodeGen/CGLoopInfo.cpp

index 89f43c28159048776607bf261756b8935bb32952..011ae7e836aeef26275c35f901c175849d5ae942 100644 (file)
@@ -26,8 +26,8 @@ static MDNode *createMetadata(LLVMContext &Ctx, const LoopAttributes &Attrs) {
 
   SmallVector<Metadata *, 4> 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;
 }