From c09aab0a4de7e3f65dd830803faadb7abae28872 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 20 Nov 2002 18:32:31 +0000 Subject: [PATCH] Fix minor bugs git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4778 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Utils/CloneFunction.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Transforms/Utils/CloneFunction.cpp b/lib/Transforms/Utils/CloneFunction.cpp index 154a082b3aa..29c7aaa0374 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 Returns; // Ignore returns cloned...