mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-24 06:25:18 +00:00
Move definition closer to use. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220949 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -690,9 +690,6 @@ bool ModuleLinker::shouldLinkFromSource(bool &LinkFromSrc,
|
|||||||
bool SrcIsDeclaration = Src.isDeclarationForLinker();
|
bool SrcIsDeclaration = Src.isDeclarationForLinker();
|
||||||
bool DestIsDeclaration = Dest.isDeclarationForLinker();
|
bool DestIsDeclaration = Dest.isDeclarationForLinker();
|
||||||
|
|
||||||
// FIXME: Make datalayout mandatory and just use getDataLayout().
|
|
||||||
DataLayout DL(Dest.getParent());
|
|
||||||
|
|
||||||
if (SrcIsDeclaration) {
|
if (SrcIsDeclaration) {
|
||||||
// If Src is external or if both Src & Dest are external.. Just link the
|
// If Src is external or if both Src & Dest are external.. Just link the
|
||||||
// external globals, we aren't adding anything.
|
// external globals, we aren't adding anything.
|
||||||
@@ -723,6 +720,9 @@ bool ModuleLinker::shouldLinkFromSource(bool &LinkFromSrc,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FIXME: Make datalayout mandatory and just use getDataLayout().
|
||||||
|
DataLayout DL(Dest.getParent());
|
||||||
|
|
||||||
uint64_t DestSize = DL.getTypeAllocSize(Dest.getType()->getElementType());
|
uint64_t DestSize = DL.getTypeAllocSize(Dest.getType()->getElementType());
|
||||||
uint64_t SrcSize = DL.getTypeAllocSize(Src.getType()->getElementType());
|
uint64_t SrcSize = DL.getTypeAllocSize(Src.getType()->getElementType());
|
||||||
LinkFromSrc = SrcSize > DestSize;
|
LinkFromSrc = SrcSize > DestSize;
|
||||||
|
Reference in New Issue
Block a user