[SplitModule] In split module utility we should never separate alias with its aliasee.

Summary: When splitting module with preserving locals, we currently do not handle case of global alias being separated with its aliasee.

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D16585

llvm-svn: 259075
This commit is contained in:
Sergei Larin
2016-01-28 18:59:28 +00:00
parent bff6b581e2
commit 427f570ce1
3 changed files with 92 additions and 0 deletions

View File

@@ -88,6 +88,13 @@ static void findPartitions(Module *M, ClusterIDMapType &ClusterIDMap,
Member = &GV;
}
// For aliases we should not separate them from their aliasees regardless
// of linkage.
if (GlobalAlias *GA = dyn_cast<GlobalAlias>(&GV)) {
if (const GlobalObject *Base = GA->getBaseObject())
GVtoClusterMap.unionSets(&GV, Base);
}
// Further only iterate over local GVs.
if (!GV.hasLocalLinkage())
return;