Account for global variables resolved more accurately.
llvm-svn: 4143
This commit is contained in:
parent
88dbc4dbe9
commit
5f9f4e3aac
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue