Fix minor bugs

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4778 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2002-11-20 18:32:31 +00:00
parent 2c08dcc276
commit c09aab0a4d

View 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...