diff options
author | Chris Lattner <sabre@nondot.org> | 2002-10-13 17:30:30 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-10-13 17:30:30 +0000 |
commit | eaa359586c45712cb1e4be0cc8d9e6da5448963a (patch) | |
tree | 40435c5d4f86344a816aedc9528421e8ea60df49 /lib/Transforms/IPO/FunctionResolution.cpp | |
parent | 66c25ff4382d5ef08a0b34c843b058da3099a963 (diff) |
Account for global variables resolved more accurately.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4143 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO/FunctionResolution.cpp')
-rw-r--r-- | lib/Transforms/IPO/FunctionResolution.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/Transforms/IPO/FunctionResolution.cpp b/lib/Transforms/IPO/FunctionResolution.cpp index f26438dbd2..09d46bedd9 100644 --- a/lib/Transforms/IPO/FunctionResolution.cpp +++ b/lib/Transforms/IPO/FunctionResolution.cpp @@ -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. |