bool SrcIsDeclaration = Src.isDeclarationForLinker();
bool DestIsDeclaration = Dest.isDeclarationForLinker();
- // FIXME: Make datalayout mandatory and just use getDataLayout().
- DataLayout DL(Dest.getParent());
-
if (SrcIsDeclaration) {
// If Src is external or if both Src & Dest are external.. Just link the
// external globals, we aren't adding anything.
return false;
}
+ // FIXME: Make datalayout mandatory and just use getDataLayout().
+ DataLayout DL(Dest.getParent());
+
uint64_t DestSize = DL.getTypeAllocSize(Dest.getType()->getElementType());
uint64_t SrcSize = DL.getTypeAllocSize(Src.getType()->getElementType());
LinkFromSrc = SrcSize > DestSize;