+ if (!DGV && !SGA->hasInternalLinkage()) {
+ DGV = Dest->getFunction(SGA->getName());
+
+ // If types don't agree due to opaque types, try to resolve them.
+ if (DGV && DGV->getType() != SGA->getType())
+ if (RecursiveResolveTypes(SGA->getType(), DGV->getType(),
+ &Dest->getTypeSymbolTable(), ""))
+ return Error(Err, "Alias Collision on '" + SGA->getName()+
+ "': aliases have different types");
+ }
+
+ // No linking to be performed on internal stuff.
+ if (DGV && DGV->hasInternalLinkage())
+ DGV = NULL;
+
+ if (GlobalAlias *DGA = dyn_cast_or_null<GlobalAlias>(DGV)) {
+ // Types are known to be the same, check whether aliasees equal. As