mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-06 03:08:43 +00:00
Fix bug: FunctionResolve/2003-05-31-AllInternalDecls.ll
llvm-svn: 6486
This commit is contained in:
parent
037fce29a8
commit
0897583c5c
@ -309,6 +309,23 @@ static bool ProcessGlobalsWithSameName(Module &M,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (Globals.size() > 1) { // Found a multiply defined global...
|
if (Globals.size() > 1) { // Found a multiply defined global...
|
||||||
|
// If there are no external declarations, and there is at most one
|
||||||
|
// externally visible instance of the global, then there is nothing to do.
|
||||||
|
//
|
||||||
|
bool HasExternal = false;
|
||||||
|
unsigned NumInstancesWithExternalLinkage = 0;
|
||||||
|
|
||||||
|
for (unsigned i = 0, e = Globals.size(); i != e; ++i) {
|
||||||
|
if (Globals[i]->isExternal())
|
||||||
|
HasExternal = true;
|
||||||
|
else if (!Globals[i]->hasInternalLinkage())
|
||||||
|
NumInstancesWithExternalLinkage++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!HasExternal && NumInstancesWithExternalLinkage <= 1)
|
||||||
|
return false; // Nothing to do? Must have multiple internal definitions.
|
||||||
|
|
||||||
|
|
||||||
// We should find exactly one concrete function definition, which is
|
// We should find exactly one concrete function definition, which is
|
||||||
// probably the implementation. Change all of the function definitions and
|
// probably the implementation. Change all of the function definitions and
|
||||||
// uses to use it instead.
|
// uses to use it instead.
|
||||||
|
Loading…
Reference in New Issue
Block a user