From 7c6d9d9eaca381cdeba24640ffcdce297851feb1 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 20 Nov 2002 18:32:31 +0000 Subject: Fix minor bugs llvm-svn: 4778 --- llvm/lib/Transforms/Utils/CloneFunction.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'llvm/lib/Transforms/Utils/CloneFunction.cpp') diff --git a/llvm/lib/Transforms/Utils/CloneFunction.cpp b/llvm/lib/Transforms/Utils/CloneFunction.cpp index 154a082b3aa..29c7aaa0374 100644 --- a/llvm/lib/Transforms/Utils/CloneFunction.cpp +++ b/llvm/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... -- cgit v1.2.3