Fix minor bugs
authorChris Lattner <sabre@nondot.org>
Wed, 20 Nov 2002 18:32:31 +0000 (18:32 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 20 Nov 2002 18:32:31 +0000 (18:32 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4778 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Utils/CloneFunction.cpp

index 154a082b3aa77c06b6f4bcf1da402c3de2d51e5b..29c7aaa037427c365b4874f932a4fc13b015524b 100644 (file)
@@ -117,9 +117,9 @@ Function *CloneFunction(const Function *F,
   // Loop over the arguments, copying the names of the mapped arguments over...
   Function::aiterator DestI = NewF->abegin();
   for (Function::const_aiterator I = F->abegin(), E = F->aend(); I != E; ++I)
-    if (ValueMap.count(I)) {        // Is this argument preserved?
+    if (ValueMap.count(I) == 0) {   // Is this argument preserved?
       DestI->setName(I->getName()); // Copy the name over...
-      ValueMap[I] = DestI;          // Add mapping to ValueMap
+      ValueMap[I] = DestI++;        // Add mapping to ValueMap
     }
 
   std::vector<ReturnInst*> Returns;  // Ignore returns cloned...