[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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user