Eliminate the remaining uses of getTypeSize. This
should only effect x86 when using long double. Now
12/16 bytes are output for long double globals (the
exact amount depends on the alignment). This brings
globals in line with the rest of LLVM: the space
reserved for an object is now always the ABI size.
One tricky point is that only 10 bytes should be
output for long double if it is a field in a packed
struct, which is the reason for the additional
argument to EmitGlobalConstant.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43688 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/X86/X86AsmPrinter.cpp b/lib/Target/X86/X86AsmPrinter.cpp
index 17bcaac..078709b 100644
--- a/lib/Target/X86/X86AsmPrinter.cpp
+++ b/lib/Target/X86/X86AsmPrinter.cpp
@@ -51,7 +51,7 @@
for (Function::const_arg_iterator AI = F->arg_begin(), AE = F->arg_end();
AI != AE; ++AI)
// Size should be aligned to DWORD boundary
- Size += ((TD->getTypeSize(AI->getType()) + 3)/4)*4;
+ Size += ((TD->getABITypeSize(AI->getType()) + 3)/4)*4;
// We're not supporting tooooo huge arguments :)
Info.setBytesToPopOnReturn((unsigned int)Size);
@@ -156,7 +156,7 @@
std::string name = Mang->getValueName(I);
Constant *C = I->getInitializer();
const Type *Type = C->getType();
- unsigned Size = TD->getTypeSize(Type);
+ unsigned Size = TD->getABITypeSize(Type);
unsigned Align = TD->getPreferredAlignmentLog(I);
if (I->hasHiddenVisibility()) {