r226505 - CodeGen: Update LoopAttributes for LLVM API change

Duncan P. N. Exon Smith dexonsmith at apple.com
Mon Jan 19 13:30:49 PST 2015


Author: dexonsmith
Date: Mon Jan 19 15:30:48 2015
New Revision: 226505

URL: http://llvm.org/viewvc/llvm-project?rev=226505&view=rev
Log:
CodeGen: Update LoopAttributes for LLVM API change

`MDNode::getTemporary()` returns a `unique_ptr<>` as of r226504.

Modified:
    cfe/trunk/lib/CodeGen/CGLoopInfo.cpp

Modified: cfe/trunk/lib/CodeGen/CGLoopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGLoopInfo.cpp?rev=226505&r1=226504&r2=226505&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGLoopInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGLoopInfo.cpp Mon Jan 19 15:30:48 2015
@@ -26,8 +26,8 @@ static MDNode *createMetadata(LLVMContex
 
   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(LLVMContex
   // Set the first operand to itself.
   MDNode *LoopID = MDNode::get(Ctx, Args);
   LoopID->replaceOperandWith(0, LoopID);
-  MDNode::deleteTemporary(TempNode);
   return LoopID;
 }
 





More information about the cfe-commits mailing list