Account for global variables resolved more accurately.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4143 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2002-10-13 17:30:30 +00:00
parent 66c25ff438
commit eaa359586c

View File

@ -236,14 +236,16 @@ static bool ProcessGlobalsWithSameName(Module &M,
// later.
//
if (Globals[i]->isExternal() && Globals[i]->use_empty()) {
if (isFunction)
if (isFunction) {
M.getFunctionList().erase(cast<Function>(Globals[i]));
else
++NumResolved;
} else {
M.getGlobalList().erase(cast<GlobalVariable>(Globals[i]));
++NumGlobals;
}
Globals.erase(Globals.begin()+i);
Changed = true;
++NumResolved;
} else if (isFunction) {
// For functions, we look to merge functions definitions of "int (...)"
// to 'int (int)' or 'int ()' or whatever else is not completely generic.