aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Utils/CloneFunction.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-11-20 18:32:31 +0000
committerChris Lattner <sabre@nondot.org>2002-11-20 18:32:31 +0000
commitc09aab0a4de7e3f65dd830803faadb7abae28872 (patch)
treecd9fc9962c18973909eeb912e1616e07389f50ee /lib/Transforms/Utils/CloneFunction.cpp
parent2c08dcc276e218193beffbddf2a30f4d88e8af58 (diff)
Fix minor bugs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4778 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils/CloneFunction.cpp')
-rw-r--r--lib/Transforms/Utils/CloneFunction.cpp4
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...