Replace calls of the form V1->setName(V2->getName()) with V1->takeName(V2),
[oota-llvm.git] / lib / Transforms / Scalar / TailDuplication.cpp
index 929d11374506ea0f9128db8731fce7f59354b3d1..5d802a6e7a70bba8318466e5fac2c150aaf333f8 100644 (file)
@@ -317,7 +317,7 @@ void TailDup::eliminateUnconditionalBranch(BranchInst *Branch) {
   //
   for (; BI != DestBlock->end(); ++BI) {
     Instruction *New = BI->clone();
-    New->setName(BI->getName());
+    New->takeName(BI);
     SourceBlock->getInstList().push_back(New);
     ValueMapping[BI] = New;
   }