Move most user of TargetMachine::getDataLayout to the Module one
[oota-llvm.git] / lib / Target / Hexagon / HexagonTargetObjectFile.cpp
index 4ea0e0d119980d89d49c81ed9ffc1162ccc8bd43..f6983aa1251aab3a541e5986febaa9b5952d8ad0 100644 (file)
@@ -75,7 +75,8 @@ IsGlobalInSmallSection(const GlobalValue *GV, const TargetMachine &TM,
 
   if (Kind.isBSS() || Kind.isDataNoRel() || Kind.isCommon()) {
     Type *Ty = GV->getType()->getElementType();
-    return IsInSmallSection(TM.getDataLayout()->getTypeAllocSize(Ty));
+    return IsInSmallSection(
+        GV->getParent()->getDataLayout().getTypeAllocSize(Ty));
   }
 
   return false;