summaryrefslogtreecommitdiffstats
path: root/lib/Target
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2009-01-12 20:38:59 +0000
committerDuncan Sands <baldrick@free.fr>2009-01-12 20:38:59 +0000
commitceb4d1aecb9deffe59b3dcdc9a783ffde8477be9 (patch)
treeb81070777ea57a00082bbc345c47a9499d77d24d /lib/Target
parentccca7fe6a30ec536de3823c0867806c1f86b2212 (diff)
downloadexternal_llvm-ceb4d1aecb9deffe59b3dcdc9a783ffde8477be9.zip
external_llvm-ceb4d1aecb9deffe59b3dcdc9a783ffde8477be9.tar.gz
external_llvm-ceb4d1aecb9deffe59b3dcdc9a783ffde8477be9.tar.bz2
Rename getABITypeSize to getTypePaddedSize, as
suggested by Chris. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62099 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r--lib/Target/ARM/ARMConstantIslandPass.cpp2
-rw-r--r--lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp2
-rw-r--r--lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp2
-rw-r--r--lib/Target/CBackend/CBackend.cpp4
-rw-r--r--lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp2
-rw-r--r--lib/Target/DarwinTargetAsmInfo.cpp4
-rw-r--r--lib/Target/ELFTargetAsmInfo.cpp4
-rw-r--r--lib/Target/IA64/IA64AsmPrinter.cpp2
-rw-r--r--lib/Target/MSIL/MSILWriter.cpp21
-rw-r--r--lib/Target/Mips/MipsAsmPrinter.cpp2
-rw-r--r--lib/Target/Mips/MipsISelLowering.cpp4
-rw-r--r--lib/Target/Mips/MipsTargetAsmInfo.cpp2
-rw-r--r--lib/Target/PIC16/PIC16AsmPrinter.cpp8
-rw-r--r--lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp4
-rw-r--r--lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp2
-rw-r--r--lib/Target/Target.cpp2
-rw-r--r--lib/Target/TargetData.cpp6
-rw-r--r--lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp4
-rw-r--r--lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp2
-rw-r--r--lib/Target/X86/X86FastISel.cpp4
-rw-r--r--lib/Target/XCore/XCoreAsmPrinter.cpp2
-rw-r--r--lib/Target/XCore/XCoreISelLowering.cpp2
-rw-r--r--lib/Target/XCore/XCoreTargetAsmInfo.cpp2
23 files changed, 45 insertions, 44 deletions
diff --git a/lib/Target/ARM/ARMConstantIslandPass.cpp b/lib/Target/ARM/ARMConstantIslandPass.cpp
index 16de615..e544c67 100644
--- a/lib/Target/ARM/ARMConstantIslandPass.cpp
+++ b/lib/Target/ARM/ARMConstantIslandPass.cpp
@@ -295,7 +295,7 @@ void ARMConstantIslands::DoInitialPlacement(MachineFunction &Fn,
const TargetData &TD = *Fn.getTarget().getTargetData();
for (unsigned i = 0, e = CPs.size(); i != e; ++i) {
- unsigned Size = TD.getABITypeSize(CPs[i].getType());
+ unsigned Size = TD.getTypePaddedSize(CPs[i].getType());
// Verify that all constant pool entries are a multiple of 4 bytes. If not,
// we would have to pad them out or something so that instructions stay
// aligned.
diff --git a/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp b/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
index 27d28a6..40153dc 100644
--- a/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
+++ b/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
@@ -825,7 +825,7 @@ void ARMAsmPrinter::printModuleLevelGV(const GlobalVariable* GVar) {
std::string name = Mang->getValueName(GVar);
Constant *C = GVar->getInitializer();
const Type *Type = C->getType();
- unsigned Size = TD->getABITypeSize(Type);
+ unsigned Size = TD->getTypePaddedSize(Type);
unsigned Align = TD->getPreferredAlignmentLog(GVar);
bool isDarwin = Subtarget->isTargetDarwin();
diff --git a/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp b/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp
index 5fb6918..35a43fb 100644
--- a/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp
+++ b/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp
@@ -216,7 +216,7 @@ void AlphaAsmPrinter::printModuleLevelGV(const GlobalVariable* GVar) {
std::string name = Mang->getValueName(GVar);
Constant *C = GVar->getInitializer();
- unsigned Size = TD->getABITypeSize(C->getType());
+ unsigned Size = TD->getTypePaddedSize(C->getType());
unsigned Align = TD->getPreferredAlignmentLog(GVar);
// 0: Switch to section
diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp
index cbdbdcd..6f40cae 100644
--- a/lib/Target/CBackend/CBackend.cpp
+++ b/lib/Target/CBackend/CBackend.cpp
@@ -490,7 +490,7 @@ CWriter::printSimpleType(raw_ostream &Out, const Type *Ty, bool isSigned,
const VectorType *VTy = cast<VectorType>(Ty);
return printSimpleType(Out, VTy->getElementType(), isSigned,
" __attribute__((vector_size(" +
- utostr(TD->getABITypeSize(VTy)) + " ))) " + NameSoFar);
+ utostr(TD->getTypePaddedSize(VTy)) + " ))) " + NameSoFar);
}
default:
@@ -535,7 +535,7 @@ CWriter::printSimpleType(std::ostream &Out, const Type *Ty, bool isSigned,
const VectorType *VTy = cast<VectorType>(Ty);
return printSimpleType(Out, VTy->getElementType(), isSigned,
" __attribute__((vector_size(" +
- utostr(TD->getABITypeSize(VTy)) + " ))) " + NameSoFar);
+ utostr(TD->getTypePaddedSize(VTy)) + " ))) " + NameSoFar);
}
default:
diff --git a/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp b/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp
index 31daab1..d7b582b 100644
--- a/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp
+++ b/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp
@@ -529,7 +529,7 @@ void LinuxAsmPrinter::printModuleLevelGV(const GlobalVariable* GVar) {
Constant *C = GVar->getInitializer();
const Type *Type = C->getType();
- unsigned Size = TD->getABITypeSize(Type);
+ unsigned Size = TD->getTypePaddedSize(Type);
unsigned Align = TD->getPreferredAlignmentLog(GVar);
SwitchToSection(TAI->SectionForGlobal(GVar));
diff --git a/lib/Target/DarwinTargetAsmInfo.cpp b/lib/Target/DarwinTargetAsmInfo.cpp
index 7121cab..ed32d39 100644
--- a/lib/Target/DarwinTargetAsmInfo.cpp
+++ b/lib/Target/DarwinTargetAsmInfo.cpp
@@ -117,7 +117,7 @@ DarwinTargetAsmInfo::MergeableStringSection(const GlobalVariable *GV) const {
Constant *C = cast<GlobalVariable>(GV)->getInitializer();
const Type *Type = cast<ConstantArray>(C)->getType()->getElementType();
- unsigned Size = TD->getABITypeSize(Type);
+ unsigned Size = TD->getTypePaddedSize(Type);
if (Size) {
unsigned Align = TD->getPreferredAlignment(GV);
if (Align <= 32)
@@ -138,7 +138,7 @@ inline const Section*
DarwinTargetAsmInfo::MergeableConstSection(const Type *Ty) const {
const TargetData *TD = TM.getTargetData();
- unsigned Size = TD->getABITypeSize(Ty);
+ unsigned Size = TD->getTypePaddedSize(Ty);
if (Size == 4)
return FourByteConstantSection;
else if (Size == 8)
diff --git a/lib/Target/ELFTargetAsmInfo.cpp b/lib/Target/ELFTargetAsmInfo.cpp
index 76e0b1b..bf96d9b 100644
--- a/lib/Target/ELFTargetAsmInfo.cpp
+++ b/lib/Target/ELFTargetAsmInfo.cpp
@@ -109,7 +109,7 @@ ELFTargetAsmInfo::MergeableConstSection(const Type *Ty) const {
// FIXME: string here is temporary, until stuff will fully land in.
// We cannot use {Four,Eight,Sixteen}ByteConstantSection here, since it's
// currently directly used by asmprinter.
- unsigned Size = TD->getABITypeSize(Ty);
+ unsigned Size = TD->getTypePaddedSize(Ty);
if (Size == 4 || Size == 8 || Size == 16) {
std::string Name = ".rodata.cst" + utostr(Size);
@@ -128,7 +128,7 @@ ELFTargetAsmInfo::MergeableStringSection(const GlobalVariable *GV) const {
const ConstantArray *CVA = cast<ConstantArray>(C);
const Type *Ty = CVA->getType()->getElementType();
- unsigned Size = TD->getABITypeSize(Ty);
+ unsigned Size = TD->getTypePaddedSize(Ty);
if (Size <= 16) {
assert(getCStringSection() && "Should have string section prefix");
diff --git a/lib/Target/IA64/IA64AsmPrinter.cpp b/lib/Target/IA64/IA64AsmPrinter.cpp
index 3a44b46..3948212 100644
--- a/lib/Target/IA64/IA64AsmPrinter.cpp
+++ b/lib/Target/IA64/IA64AsmPrinter.cpp
@@ -266,7 +266,7 @@ void IA64AsmPrinter::printModuleLevelGV(const GlobalVariable* GVar) {
O << "\n\n";
std::string name = Mang->getValueName(GVar);
Constant *C = GVar->getInitializer();
- unsigned Size = TD->getABITypeSize(C->getType());
+ unsigned Size = TD->getTypePaddedSize(C->getType());
unsigned Align = TD->getPreferredAlignmentLog(GVar);
printVisibility(name, GVar->getVisibility());
diff --git a/lib/Target/MSIL/MSILWriter.cpp b/lib/Target/MSIL/MSILWriter.cpp
index 0cbd011..8843d95 100644
--- a/lib/Target/MSIL/MSILWriter.cpp
+++ b/lib/Target/MSIL/MSILWriter.cpp
@@ -378,7 +378,7 @@ std::string MSILWriter::getTypePostfix(const Type* Ty, bool Expand,
case Type::DoubleTyID:
return "r8";
case Type::PointerTyID:
- return "i"+utostr(TD->getABITypeSize(Ty));
+ return "i"+utostr(TD->getTypePaddedSize(Ty));
default:
cerr << "TypeID = " << Ty->getTypeID() << '\n';
assert(0 && "Invalid type in TypeToPostfix()");
@@ -688,14 +688,14 @@ void MSILWriter::printGepInstruction(const Value* V, gep_type_iterator I,
uint64_t FieldIndex = cast<ConstantInt>(IndexValue)->getZExtValue();
// Offset is the sum of all previous structure fields.
for (uint64_t F = 0; F<FieldIndex; ++F)
- Size += TD->getABITypeSize(StrucTy->getContainedType((unsigned)F));
+ Size += TD->getTypePaddedSize(StrucTy->getContainedType((unsigned)F));
printPtrLoad(Size);
printSimpleInstruction("add");
continue;
} else if (const SequentialType* SeqTy = dyn_cast<SequentialType>(*I)) {
- Size = TD->getABITypeSize(SeqTy->getElementType());
+ Size = TD->getTypePaddedSize(SeqTy->getElementType());
} else {
- Size = TD->getABITypeSize(*I);
+ Size = TD->getTypePaddedSize(*I);
}
// Add offset of current element to stack top.
if (!isZeroValue(IndexValue)) {
@@ -1020,7 +1020,7 @@ void MSILWriter::printVAArgInstruction(const VAArgInst* Inst) {
void MSILWriter::printAllocaInstruction(const AllocaInst* Inst) {
- uint64_t Size = TD->getABITypeSize(Inst->getAllocatedType());
+ uint64_t Size = TD->getTypePaddedSize(Inst->getAllocatedType());
// Constant optimization.
if (const ConstantInt* CInt = dyn_cast<ConstantInt>(Inst->getOperand(0))) {
printPtrLoad(CInt->getZExtValue()*Size);
@@ -1436,7 +1436,8 @@ void MSILWriter::printDeclarations(const TypeSymbolTable& ST) {
// Print not duplicated type
if (Printed.insert(Ty).second) {
Out << ".class value explicit ansi sealed '" << Name << "'";
- Out << " { .pack " << 1 << " .size " << TD->getABITypeSize(Ty)<< " }\n\n";
+ Out << " { .pack " << 1 << " .size " << TD->getTypePaddedSize(Ty);
+ Out << " }\n\n";
}
}
}
@@ -1465,7 +1466,7 @@ void MSILWriter::printStaticConstant(const Constant* C, uint64_t& Offset) {
const Type* Ty = C->getType();
// Print zero initialized constant.
if (isa<ConstantAggregateZero>(C) || C->isNullValue()) {
- TySize = TD->getABITypeSize(C->getType());
+ TySize = TD->getTypePaddedSize(C->getType());
Offset += TySize;
Out << "int8 (0) [" << TySize << "]";
return;
@@ -1473,14 +1474,14 @@ void MSILWriter::printStaticConstant(const Constant* C, uint64_t& Offset) {
// Print constant initializer
switch (Ty->getTypeID()) {
case Type::IntegerTyID: {
- TySize = TD->getABITypeSize(Ty);
+ TySize = TD->getTypePaddedSize(Ty);
const ConstantInt* Int = cast<ConstantInt>(C);
Out << getPrimitiveTypeName(Ty,true) << "(" << Int->getSExtValue() << ")";
break;
}
case Type::FloatTyID:
case Type::DoubleTyID: {
- TySize = TD->getABITypeSize(Ty);
+ TySize = TD->getTypePaddedSize(Ty);
const ConstantFP* FP = cast<ConstantFP>(C);
if (Ty->getTypeID() == Type::FloatTyID)
Out << "int32 (" <<
@@ -1499,7 +1500,7 @@ void MSILWriter::printStaticConstant(const Constant* C, uint64_t& Offset) {
}
break;
case Type::PointerTyID:
- TySize = TD->getABITypeSize(C->getType());
+ TySize = TD->getTypePaddedSize(C->getType());
// Initialize with global variable address
if (const GlobalVariable *G = dyn_cast<GlobalVariable>(C)) {
std::string name = getValueName(G);
diff --git a/lib/Target/Mips/MipsAsmPrinter.cpp b/lib/Target/Mips/MipsAsmPrinter.cpp
index 85abd80..3971c75 100644
--- a/lib/Target/Mips/MipsAsmPrinter.cpp
+++ b/lib/Target/Mips/MipsAsmPrinter.cpp
@@ -480,7 +480,7 @@ printModuleLevelGV(const GlobalVariable* GVar) {
std::string name = Mang->getValueName(GVar);
Constant *C = GVar->getInitializer();
const Type *CTy = C->getType();
- unsigned Size = TD->getABITypeSize(CTy);
+ unsigned Size = TD->getTypePaddedSize(CTy);
const ConstantArray *CVA = dyn_cast<ConstantArray>(C);
bool printSizeAndType = true;
diff --git a/lib/Target/Mips/MipsISelLowering.cpp b/lib/Target/Mips/MipsISelLowering.cpp
index e636e78..bca5ab2 100644
--- a/lib/Target/Mips/MipsISelLowering.cpp
+++ b/lib/Target/Mips/MipsISelLowering.cpp
@@ -212,7 +212,7 @@ bool MipsTargetLowering::IsGlobalInSmallSection(GlobalValue *GV)
return false;
const Type *Ty = GV->getType()->getElementType();
- unsigned Size = TD->getABITypeSize(Ty);
+ unsigned Size = TD->getTypePaddedSize(Ty);
// if this is a internal constant string, there is a special
// section for it, but not in small data/bss.
@@ -543,7 +543,7 @@ LowerConstantPool(SDValue Op, SelectionDAG &DAG)
// hacking it. This feature should come soon so we can uncomment the
// stuff below.
//if (!Subtarget->hasABICall() &&
- // IsInSmallSection(getTargetData()->getABITypeSize(C->getType()))) {
+ // IsInSmallSection(getTargetData()->getTypePaddedSize(C->getType()))) {
// SDValue GPRelNode = DAG.getNode(MipsISD::GPRel, MVT::i32, CP);
// SDValue GOT = DAG.getNode(ISD::GLOBAL_OFFSET_TABLE, MVT::i32);
// ResNode = DAG.getNode(ISD::ADD, MVT::i32, GOT, GPRelNode);
diff --git a/lib/Target/Mips/MipsTargetAsmInfo.cpp b/lib/Target/Mips/MipsTargetAsmInfo.cpp
index 900a1bd..7566f41 100644
--- a/lib/Target/Mips/MipsTargetAsmInfo.cpp
+++ b/lib/Target/Mips/MipsTargetAsmInfo.cpp
@@ -66,7 +66,7 @@ SectionKindForGlobal(const GlobalValue *GV) const {
if (isa<GlobalVariable>(GV)) {
const TargetData *TD = TM.getTargetData();
- unsigned Size = TD->getABITypeSize(GV->getType()->getElementType());
+ unsigned Size = TD->getTypePaddedSize(GV->getType()->getElementType());
unsigned Threshold = Subtarget->getSSectionThreshold();
if (Size > 0 && Size <= Threshold) {
diff --git a/lib/Target/PIC16/PIC16AsmPrinter.cpp b/lib/Target/PIC16/PIC16AsmPrinter.cpp
index 6bb3b5d..d468efd 100644
--- a/lib/Target/PIC16/PIC16AsmPrinter.cpp
+++ b/lib/Target/PIC16/PIC16AsmPrinter.cpp
@@ -299,7 +299,7 @@ void PIC16AsmPrinter::EmitUnInitData (Module &M)
continue;
const Type *Ty = C->getType();
- unsigned Size = TD->getABITypeSize(Ty);
+ unsigned Size = TD->getTypePaddedSize(Ty);
O << name << " " <<"RES"<< " " << Size ;
O << "\n";
}
@@ -327,7 +327,7 @@ void PIC16AsmPrinter::emitFunctionData(MachineFunction &MF) {
O << CurrentFnName << ".retval:\n";
const Type *RetType = F->getReturnType();
if (RetType->getTypeID() != Type::VoidTyID) {
- unsigned RetSize = TD->getABITypeSize(RetType);
+ unsigned RetSize = TD->getTypePaddedSize(RetType);
if (RetSize > 0)
O << CurrentFnName << ".retval" << " RES " << RetSize;
}
@@ -337,7 +337,7 @@ void PIC16AsmPrinter::emitFunctionData(MachineFunction &MF) {
AI != AE; ++AI) {
std::string ArgName = Mang->getValueName(AI);
const Type *ArgTy = AI->getType();
- unsigned ArgSize = TD->getABITypeSize(ArgTy);
+ unsigned ArgSize = TD->getTypePaddedSize(ArgTy);
O << CurrentFnName << ".args." << ArgName << " RES " << ArgSize;
}
// Emit the function variables.
@@ -357,7 +357,7 @@ void PIC16AsmPrinter::emitFunctionData(MachineFunction &MF) {
Constant *C = I->getInitializer();
const Type *Ty = C->getType();
- unsigned Size = TD->getABITypeSize(Ty);
+ unsigned Size = TD->getTypePaddedSize(Ty);
// Emit memory reserve directive.
O << VarName << " RES " << Size << "\n";
}
diff --git a/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp b/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
index 2058993..605e631 100644
--- a/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
+++ b/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
@@ -679,7 +679,7 @@ void PPCLinuxAsmPrinter::printModuleLevelGV(const GlobalVariable* GVar) {
Constant *C = GVar->getInitializer();
const Type *Type = C->getType();
- unsigned Size = TD->getABITypeSize(Type);
+ unsigned Size = TD->getTypePaddedSize(Type);
unsigned Align = TD->getPreferredAlignmentLog(GVar);
SwitchToSection(TAI->SectionForGlobal(GVar));
@@ -904,7 +904,7 @@ void PPCDarwinAsmPrinter::printModuleLevelGV(const GlobalVariable* GVar) {
Constant *C = GVar->getInitializer();
const Type *Type = C->getType();
- unsigned Size = TD->getABITypeSize(Type);
+ unsigned Size = TD->getTypePaddedSize(Type);
unsigned Align = TD->getPreferredAlignmentLog(GVar);
SwitchToSection(TAI->SectionForGlobal(GVar));
diff --git a/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp b/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp
index 703a54e..af7c4d9 100644
--- a/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp
+++ b/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp
@@ -246,7 +246,7 @@ void SparcAsmPrinter::printModuleLevelGV(const GlobalVariable* GVar) {
O << "\n\n";
std::string name = Mang->getValueName(GVar);
Constant *C = GVar->getInitializer();
- unsigned Size = TD->getABITypeSize(C->getType());
+ unsigned Size = TD->getTypePaddedSize(C->getType());
unsigned Align = TD->getPreferredAlignment(GVar);
printVisibility(name, GVar->getVisibility());
diff --git a/lib/Target/Target.cpp b/lib/Target/Target.cpp
index 35cf648..933ac82 100644
--- a/lib/Target/Target.cpp
+++ b/lib/Target/Target.cpp
@@ -53,7 +53,7 @@ unsigned long long LLVMStoreSizeOfType(LLVMTargetDataRef TD, LLVMTypeRef Ty) {
}
unsigned long long LLVMABISizeOfType(LLVMTargetDataRef TD, LLVMTypeRef Ty) {
- return unwrap(TD)->getABITypeSize(unwrap(Ty));
+ return unwrap(TD)->getTypePaddedSize(unwrap(Ty));
}
unsigned LLVMABIAlignmentOfType(LLVMTargetDataRef TD, LLVMTypeRef Ty) {
diff --git a/lib/Target/TargetData.cpp b/lib/Target/TargetData.cpp
index 859b9ce..d543f24 100644
--- a/lib/Target/TargetData.cpp
+++ b/lib/Target/TargetData.cpp
@@ -58,7 +58,7 @@ StructLayout::StructLayout(const StructType *ST, const TargetData &TD) {
StructAlignment = std::max(TyAlign, StructAlignment);
MemberOffsets[i] = StructSize;
- StructSize += TD.getABITypeSize(Ty); // Consume space for this data item
+ StructSize += TD.getTypePaddedSize(Ty); // Consume space for this data item
}
// Empty structures have alignment of 1 byte.
@@ -425,7 +425,7 @@ uint64_t TargetData::getTypeSizeInBits(const Type *Ty) const {
return getPointerSizeInBits();
case Type::ArrayTyID: {
const ArrayType *ATy = cast<ArrayType>(Ty);
- return getABITypeSizeInBits(ATy->getElementType())*ATy->getNumElements();
+ return getTypePaddedSizeInBits(ATy->getElementType())*ATy->getNumElements();
}
case Type::StructTyID:
// Get the layout annotation... which is lazily created on demand.
@@ -568,7 +568,7 @@ uint64_t TargetData::getIndexedOffset(const Type *ptrTy, Value* const* Indices,
// Get the array index and the size of each array element.
int64_t arrayIdx = cast<ConstantInt>(Indices[CurIDX])->getSExtValue();
- Result += arrayIdx * (int64_t)getABITypeSize(Ty);
+ Result += arrayIdx * (int64_t)getTypePaddedSize(Ty);
}
}
diff --git a/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp b/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
index e8a77a8..5378967 100644
--- a/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
+++ b/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
@@ -75,7 +75,7 @@ static X86MachineFunctionInfo calculateFunctionInfo(const Function *F,
Ty = cast<PointerType>(Ty)->getElementType();
// Size should be aligned to DWORD boundary
- Size += ((TD->getABITypeSize(Ty) + 3)/4)*4;
+ Size += ((TD->getTypePaddedSize(Ty) + 3)/4)*4;
}
// We're not supporting tooooo huge arguments :)
@@ -767,7 +767,7 @@ void X86ATTAsmPrinter::printModuleLevelGV(const GlobalVariable* GVar) {
std::string name = Mang->getValueName(GVar);
Constant *C = GVar->getInitializer();
const Type *Type = C->getType();
- unsigned Size = TD->getABITypeSize(Type);
+ unsigned Size = TD->getTypePaddedSize(Type);
unsigned Align = TD->getPreferredAlignmentLog(GVar);
printVisibility(name, GVar->getVisibility());
diff --git a/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp b/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp
index 1d4a695..58bd8de 100644
--- a/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp
+++ b/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp
@@ -58,7 +58,7 @@ static X86MachineFunctionInfo calculateFunctionInfo(const Function *F,
Ty = cast<PointerType>(Ty)->getElementType();
// Size should be aligned to DWORD boundary
- Size += ((TD->getABITypeSize(Ty) + 3)/4)*4;
+ Size += ((TD->getTypePaddedSize(Ty) + 3)/4)*4;
}
// We're not supporting tooooo huge arguments :)
diff --git a/lib/Target/X86/X86FastISel.cpp b/lib/Target/X86/X86FastISel.cpp
index 2cb05e2..f7784b4 100644
--- a/lib/Target/X86/X86FastISel.cpp
+++ b/lib/Target/X86/X86FastISel.cpp
@@ -386,7 +386,7 @@ bool X86FastISel::X86SelectAddress(Value *V, X86AddressMode &AM, bool isCall) {
unsigned Idx = cast<ConstantInt>(Op)->getZExtValue();
Disp += SL->getElementOffset(Idx);
} else {
- uint64_t S = TD.getABITypeSize(GTI.getIndexedType());
+ uint64_t S = TD.getTypePaddedSize(GTI.getIndexedType());
if (ConstantInt *CI = dyn_cast<ConstantInt>(Op)) {
// Constant-offset addressing.
Disp += CI->getSExtValue() * S;
@@ -1469,7 +1469,7 @@ unsigned X86FastISel::TargetMaterializeConstant(Constant *C) {
unsigned Align = TD.getPreferredTypeAlignmentShift(C->getType());
if (Align == 0) {
// Alignment of vector types. FIXME!
- Align = TD.getABITypeSize(C->getType());
+ Align = TD.getTypePaddedSize(C->getType());
Align = Log2_64(Align);
}
diff --git a/lib/Target/XCore/XCoreAsmPrinter.cpp b/lib/Target/XCore/XCoreAsmPrinter.cpp
index 0786f61..57530c3 100644
--- a/lib/Target/XCore/XCoreAsmPrinter.cpp
+++ b/lib/Target/XCore/XCoreAsmPrinter.cpp
@@ -214,7 +214,7 @@ emitGlobal(const GlobalVariable *GV)
EmitAlignment(Align, GV, 2);
- unsigned Size = TD->getABITypeSize(C->getType());
+ unsigned Size = TD->getTypePaddedSize(C->getType());
if (GV->isThreadLocal()) {
Size *= MaxThreads;
}
diff --git a/lib/Target/XCore/XCoreISelLowering.cpp b/lib/Target/XCore/XCoreISelLowering.cpp
index e2d2ab7..82595bc 100644
--- a/lib/Target/XCore/XCoreISelLowering.cpp
+++ b/lib/Target/XCore/XCoreISelLowering.cpp
@@ -265,7 +265,7 @@ LowerGlobalTLSAddress(SDValue Op, SelectionDAG &DAG)
}
SDValue base = getGlobalAddressWrapper(GA, GV, DAG);
const TargetData *TD = TM.getTargetData();
- unsigned Size = TD->getABITypeSize(Ty);
+ unsigned Size = TD->getTypePaddedSize(Ty);
SDValue offset = DAG.getNode(ISD::MUL, MVT::i32, BuildGetId(DAG),
DAG.getConstant(Size, MVT::i32));
return DAG.getNode(ISD::ADD, MVT::i32, base, offset);
diff --git a/lib/Target/XCore/XCoreTargetAsmInfo.cpp b/lib/Target/XCore/XCoreTargetAsmInfo.cpp
index e2fabe2..847224c 100644
--- a/lib/Target/XCore/XCoreTargetAsmInfo.cpp
+++ b/lib/Target/XCore/XCoreTargetAsmInfo.cpp
@@ -106,7 +106,7 @@ inline const Section*
XCoreTargetAsmInfo::MergeableConstSection(const Type *Ty) const {
const TargetData *TD = TM.getTargetData();
- unsigned Size = TD->getABITypeSize(Ty);
+ unsigned Size = TD->getTypePaddedSize(Ty);
if (Size == 4 || Size == 8 || Size == 16) {
std::string Name = ".cp.const" + utostr(Size);