diff options
Diffstat (limited to 'lib/Transforms/Utils/CloneFunction.cpp')
-rw-r--r-- | lib/Transforms/Utils/CloneFunction.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Transforms/Utils/CloneFunction.cpp b/lib/Transforms/Utils/CloneFunction.cpp index 154a082b3a..29c7aaa037 100644 --- a/lib/Transforms/Utils/CloneFunction.cpp +++ b/lib/Transforms/Utils/CloneFunction.cpp @@ -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... |