Don't increment a dead iterator

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17904 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2004-11-16 19:04:40 +00:00
parent 429a9cbc2e
commit a63acbfeab

View File

@ -404,7 +404,7 @@ static bool LinkGlobals(Module *Dest, const Module *Src,
GlobalsByName.find(SGV->getName());
if (EGV != GlobalsByName.end())
DGV = dyn_cast<GlobalVariable>(EGV->second);
if (DGV && RecursiveResolveTypes(SGV->getType(), DGV->getType(), ST, ""))
if (DGV && RecursiveResolveTypes(SGV->getType(), DGV->getType(),ST, ""))
DGV = 0; // FIXME: gross.
}
@ -691,8 +691,7 @@ static bool LinkFunctionBody(Function *Dest, Function *Src,
*OI = RemapOperand(*OI, GlobalMap);
// There is no need to map the arguments anymore.
for (Function::aiterator I = Src->abegin(), E = Src->aend();
I != E; ++I, ++DI)
for (Function::aiterator I = Src->abegin(), E = Src->aend(); I != E; ++I)
GlobalMap.erase(I);
return false;