Replace calls of the form V1->setName(V2->getName()) with V1->takeName(V2),
[oota-llvm.git] / lib / Transforms / Scalar / LoopRotation.cpp
index 51e2cd8900c2aec82ffb7801297078a0308151e9..53473fdfd37296d3f931987dcb23400962551de3 100644 (file)
@@ -226,7 +226,7 @@ bool LoopRotate::rotateLoop(Loop *Lp, LPPassManager &LPM) {
     // If this instruction is using a value from same basic block then
     // update it to use value from cloned instruction.
     Instruction *C = In->clone();
-    C->setName(In->getName());
+    C->takeName(In);
     OrigPreHeader->getInstList().push_back(C);
 
     for (unsigned opi = 0, e = In->getNumOperands(); opi != e; ++opi) {