aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/IPO/FunctionResolution.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms/IPO/FunctionResolution.cpp')
-rw-r--r--lib/Transforms/IPO/FunctionResolution.cpp8
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.