mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-19 19:29:31 +00:00
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:
parent
66c25ff438
commit
eaa359586c
@ -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
Block a user