[llvm] r220949 - Move definition closer to use. NFC.

Rafael Espindola rafael.espindola at gmail.com
Thu Oct 30 21:46:38 PDT 2014


Author: rafael
Date: Thu Oct 30 23:46:38 2014
New Revision: 220949

URL: http://llvm.org/viewvc/llvm-project?rev=220949&view=rev
Log:
Move definition closer to use. NFC.

Modified:
    llvm/trunk/lib/Linker/LinkModules.cpp

Modified: llvm/trunk/lib/Linker/LinkModules.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Linker/LinkModules.cpp?rev=220949&r1=220948&r2=220949&view=diff
==============================================================================
--- llvm/trunk/lib/Linker/LinkModules.cpp (original)
+++ llvm/trunk/lib/Linker/LinkModules.cpp Thu Oct 30 23:46:38 2014
@@ -690,9 +690,6 @@ bool ModuleLinker::shouldLinkFromSource(
   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.
@@ -723,6 +720,9 @@ bool ModuleLinker::shouldLinkFromSource(
       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;





More information about the llvm-commits mailing list