Rename PaddedSize to AllocSize, in the hope that this
authorDuncan Sands <baldrick@free.fr>
Sat, 9 May 2009 07:06:46 +0000 (07:06 +0000)
committerDuncan Sands <baldrick@free.fr>
Sat, 9 May 2009 07:06:46 +0000 (07:06 +0000)
will make it more obvious what it represents, and stop
it being confused with the StoreSize.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71349 91177308-0d34-0410-b5e6-96231b3b80d8

53 files changed:
bindings/ocaml/target/llvm_target.mli
include/llvm-c/Target.h
include/llvm/Target/TargetData.h
lib/Analysis/BasicAliasAnalysis.cpp
lib/Analysis/ConstantFolding.cpp
lib/Analysis/ScalarEvolution.cpp
lib/Analysis/ValueTracking.cpp
lib/CodeGen/AsmPrinter/AsmPrinter.cpp
lib/CodeGen/ELFWriter.cpp
lib/CodeGen/MachOWriter.cpp
lib/CodeGen/MachOWriter.h
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
lib/CodeGen/SelectionDAG/FastISel.cpp
lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
lib/CodeGen/SelectionDAG/ScheduleDAGSDNodesEmit.cpp
lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
lib/CodeGen/StackProtector.cpp
lib/ExecutionEngine/ExecutionEngine.cpp
lib/ExecutionEngine/Interpreter/Execution.cpp
lib/ExecutionEngine/JIT/JIT.cpp
lib/ExecutionEngine/JIT/JITEmitter.cpp
lib/Target/ARM/ARMConstantIslandPass.cpp
lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp
lib/Target/CBackend/CBackend.cpp
lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp
lib/Target/DarwinTargetAsmInfo.cpp
lib/Target/ELFTargetAsmInfo.cpp
lib/Target/IA64/AsmPrinter/IA64AsmPrinter.cpp
lib/Target/MSIL/MSILWriter.cpp
lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp
lib/Target/Mips/MipsISelLowering.cpp
lib/Target/Mips/MipsTargetAsmInfo.cpp
lib/Target/PIC16/PIC16AsmPrinter.cpp
lib/Target/PIC16/PIC16TargetAsmInfo.cpp
lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp
lib/Target/Target.cpp
lib/Target/TargetData.cpp
lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp
lib/Target/X86/X86FastISel.cpp
lib/Target/XCore/XCoreAsmPrinter.cpp
lib/Target/XCore/XCoreISelLowering.cpp
lib/Target/XCore/XCoreTargetAsmInfo.cpp
lib/Transforms/IPO/GlobalOpt.cpp
lib/Transforms/Scalar/DeadStoreElimination.cpp
lib/Transforms/Scalar/InstructionCombining.cpp
lib/Transforms/Scalar/MemCpyOptimizer.cpp
lib/Transforms/Scalar/ScalarReplAggregates.cpp
lib/Transforms/Utils/AddrModeMatcher.cpp
lib/Transforms/Utils/LowerAllocations.cpp
utils/TableGen/CallingConvEmitter.cpp

index 9378900a03cebae39977fc02ef69423c9cddead3..a82e1b684fadb4c29a2ceafa1b852641940541ce 100644 (file)
@@ -70,7 +70,7 @@ external size_in_bits : TargetData.t -> Llvm.lltype -> Int64.t
 external store_size : TargetData.t -> Llvm.lltype -> Int64.t = "llvm_store_size"
 
 (** Computes the ABI size of a type in bytes for a target.
 external store_size : TargetData.t -> Llvm.lltype -> Int64.t = "llvm_store_size"
 
 (** Computes the ABI size of a type in bytes for a target.
-    See the method llvm::TargetData::getTypePaddedSize. *)
+    See the method llvm::TargetData::getTypeAllocSize. *)
 external abi_size : TargetData.t -> Llvm.lltype -> Int64.t = "llvm_abi_size"
 
 (** Computes the ABI alignment of a type in bytes for a target.
 external abi_size : TargetData.t -> Llvm.lltype -> Int64.t = "llvm_abi_size"
 
 (** Computes the ABI alignment of a type in bytes for a target.
index 2aa5bd9f76e365b23a47e980638466bfd671103c..5de5bc78574330da9a6c19792cc910364e4171f1 100644 (file)
@@ -70,7 +70,7 @@ unsigned long long LLVMSizeOfTypeInBits(LLVMTargetDataRef, LLVMTypeRef);
 unsigned long long LLVMStoreSizeOfType(LLVMTargetDataRef, LLVMTypeRef);
 
 /** Computes the ABI size of a type in bytes for a target.
 unsigned long long LLVMStoreSizeOfType(LLVMTargetDataRef, LLVMTypeRef);
 
 /** Computes the ABI size of a type in bytes for a target.
-    See the method llvm::TargetData::getTypePaddedSize. */
+    See the method llvm::TargetData::getTypeAllocSize. */
 unsigned long long LLVMABISizeOfType(LLVMTargetDataRef, LLVMTypeRef);
 
 /** Computes the ABI alignment of a type in bytes for a target.
 unsigned long long LLVMABISizeOfType(LLVMTargetDataRef, LLVMTypeRef);
 
 /** Computes the ABI alignment of a type in bytes for a target.
index 8e5c4c34ea9e4b1ee33c7993601c084f73e1182e..71236c021fee66d059134b1808dd444c0ec31ae3 100644 (file)
@@ -157,8 +157,8 @@ public:
 
   /// Size examples:
   ///
 
   /// Size examples:
   ///
-  /// Type        SizeInBits  StoreSizeInBits  PaddedSizeInBits[*]
-  /// ----        ----------  ---------------  ----------------
+  /// Type        SizeInBits  StoreSizeInBits  AllocSizeInBits[*]
+  /// ----        ----------  ---------------  ---------------
   ///  i1            1           8                8
   ///  i8            8           8                8
   ///  i19          19          24               32
   ///  i1            1           8                8
   ///  i8            8           8                8
   ///  i19          19          24               32
@@ -169,7 +169,7 @@ public:
   ///  Double       64          64               64
   ///  X86_FP80     80          80               96
   ///
   ///  Double       64          64               64
   ///  X86_FP80     80          80               96
   ///
-  /// [*] The padded size depends on the alignment, and thus on the target.
+  /// [*] The alloc size depends on the alignment, and thus on the target.
   ///     These values are for x86-32 linux.
 
   /// getTypeSizeInBits - Return the number of bits necessary to hold the
   ///     These values are for x86-32 linux.
 
   /// getTypeSizeInBits - Return the number of bits necessary to hold the
@@ -190,21 +190,21 @@ public:
     return 8*getTypeStoreSize(Ty);
   }
 
     return 8*getTypeStoreSize(Ty);
   }
 
-  /// getTypePaddedSize - Return the offset in bytes between successive objects
+  /// getTypeAllocSize - Return the offset in bytes between successive objects
   /// of the specified type, including alignment padding.  This is the amount
   /// that alloca reserves for this type.  For example, returns 12 or 16 for
   /// x86_fp80, depending on alignment.
   /// of the specified type, including alignment padding.  This is the amount
   /// that alloca reserves for this type.  For example, returns 12 or 16 for
   /// x86_fp80, depending on alignment.
-  uint64_t getTypePaddedSize(const Type* Ty) const {
+  uint64_t getTypeAllocSize(const Type* Ty) const {
     // Round up to the next alignment boundary.
     return RoundUpAlignment(getTypeStoreSize(Ty), getABITypeAlignment(Ty));
   }
 
     // Round up to the next alignment boundary.
     return RoundUpAlignment(getTypeStoreSize(Ty), getABITypeAlignment(Ty));
   }
 
-  /// getTypePaddedSizeInBits - Return the offset in bits between successive
+  /// getTypeAllocSizeInBits - Return the offset in bits between successive
   /// objects of the specified type, including alignment padding; always a
   /// multiple of 8.  This is the amount that alloca reserves for this type.
   /// For example, returns 96 or 128 for x86_fp80, depending on alignment.
   /// objects of the specified type, including alignment padding; always a
   /// multiple of 8.  This is the amount that alloca reserves for this type.
   /// For example, returns 96 or 128 for x86_fp80, depending on alignment.
-  uint64_t getTypePaddedSizeInBits(const Type* Ty) const {
-    return 8*getTypePaddedSize(Ty);
+  uint64_t getTypeAllocSizeInBits(const Type* Ty) const {
+    return 8*getTypeAllocSize(Ty);
   }
 
   /// getABITypeAlignment - Return the minimum ABI-required alignment for the
   }
 
   /// getABITypeAlignment - Return the minimum ABI-required alignment for the
index fe71f04098b13061a0b04c4dcf2a99bc3fd7f9dd..d958746359119487c892e8872cfebee22fc5febf 100644 (file)
@@ -123,7 +123,7 @@ static bool isObjectSmallerThan(const Value *V, unsigned Size,
   }
   
   if (AccessTy->isSized())
   }
   
   if (AccessTy->isSized())
-    return TD.getTypePaddedSize(AccessTy) < Size;
+    return TD.getTypeAllocSize(AccessTy) < Size;
   return false;
 }
 
   return false;
 }
 
index 7c99325b2dd1e8eaf3298181c146809d55a60965..00b54413aa27433da611e66f69e059b79ef93a39 100644 (file)
@@ -77,7 +77,7 @@ static bool IsConstantOffsetFromGlobal(Constant *C, GlobalValue *&GV,
         Offset += TD.getStructLayout(ST)->getElementOffset(CI->getZExtValue());
       } else {
         const SequentialType *SQT = cast<SequentialType>(*GTI);
         Offset += TD.getStructLayout(ST)->getElementOffset(CI->getZExtValue());
       } else {
         const SequentialType *SQT = cast<SequentialType>(*GTI);
-        Offset += TD.getTypePaddedSize(SQT->getElementType())*CI->getSExtValue();
+        Offset += TD.getTypeAllocSize(SQT->getElementType())*CI->getSExtValue();
       }
     }
     return true;
       }
     }
     return true;
@@ -405,8 +405,8 @@ Constant *llvm::ConstantFoldInstOperands(unsigned Opcode, const Type *DestTy,
                   if (const ArrayType *AT =
                         dyn_cast<ArrayType>(GVTy->getElementType())) {
                     const Type *ElTy = AT->getElementType();
                   if (const ArrayType *AT =
                         dyn_cast<ArrayType>(GVTy->getElementType())) {
                     const Type *ElTy = AT->getElementType();
-                    uint64_t PaddedSize = TD->getTypePaddedSize(ElTy);
-                    APInt PSA(L->getValue().getBitWidth(), PaddedSize);
+                    uint64_t AllocSize = TD->getTypeAllocSize(ElTy);
+                    APInt PSA(L->getValue().getBitWidth(), AllocSize);
                     if (ElTy == cast<PointerType>(DestTy)->getElementType() &&
                         L->getValue().urem(PSA) == 0) {
                       APInt ElemIdx = L->getValue().udiv(PSA);
                     if (ElTy == cast<PointerType>(DestTy)->getElementType() &&
                         L->getValue().urem(PSA) == 0) {
                       APInt ElemIdx = L->getValue().udiv(PSA);
index 3f2656240e4bdecfdbe8b7ab970cab6d0d678d4c..e65cdd218a71ce35dadd07da46b6506c547bee04 100644 (file)
@@ -1961,7 +1961,7 @@ SCEVHandle ScalarEvolution::createNodeForGEP(User *GEP) {
                                               IntPtrTy);
       LocalOffset =
         getMulExpr(LocalOffset,
                                               IntPtrTy);
       LocalOffset =
         getMulExpr(LocalOffset,
-                   getIntegerSCEV(TD->getTypePaddedSize(*GTI),
+                   getIntegerSCEV(TD->getTypeAllocSize(*GTI),
                                   IntPtrTy));
       TotalOffset = getAddExpr(TotalOffset, LocalOffset);
     }
                                   IntPtrTy));
       TotalOffset = getAddExpr(TotalOffset, LocalOffset);
     }
index 20fa69ea24f59c3238eb406a10a559983fa903b0..c4f6faf612ff2b6fdef5de098501a12d5e4b8912 100644 (file)
@@ -459,7 +459,7 @@ void llvm::ComputeMaskedBits(Value *V, const APInt &Mask,
         const Type *IndexedTy = GTI.getIndexedType();
         if (!IndexedTy->isSized()) return;
         unsigned GEPOpiBits = Index->getType()->getPrimitiveSizeInBits();
         const Type *IndexedTy = GTI.getIndexedType();
         if (!IndexedTy->isSized()) return;
         unsigned GEPOpiBits = Index->getType()->getPrimitiveSizeInBits();
-        uint64_t TypeSize = TD ? TD->getTypePaddedSize(IndexedTy) : 1;
+        uint64_t TypeSize = TD ? TD->getTypeAllocSize(IndexedTy) : 1;
         LocalMask = APInt::getAllOnesValue(GEPOpiBits);
         LocalKnownZero = LocalKnownOne = APInt(GEPOpiBits, 0);
         ComputeMaskedBits(Index, LocalMask,
         LocalMask = APInt::getAllOnesValue(GEPOpiBits);
         LocalKnownZero = LocalKnownOne = APInt(GEPOpiBits, 0);
         ComputeMaskedBits(Index, LocalMask,
index 0d9d77762b730fb6ac543a01c81581b628059913..45462da0d26a575d98bfbd5690665675890f627e 100644 (file)
@@ -313,7 +313,7 @@ void AsmPrinter::EmitConstantPool(MachineConstantPool *MCP) {
       EmitZeros(NewOffset - Offset);
 
       const Type *Ty = CPE.getType();
       EmitZeros(NewOffset - Offset);
 
       const Type *Ty = CPE.getType();
-      Offset = NewOffset + TM.getTargetData()->getTypePaddedSize(Ty);
+      Offset = NewOffset + TM.getTargetData()->getTypeAllocSize(Ty);
 
       O << TAI->getPrivateGlobalPrefix() << "CPI" << getFunctionNumber() << '_'
         << CPI << ":\t\t\t\t\t";
 
       O << TAI->getPrivateGlobalPrefix() << "CPI" << getFunctionNumber() << '_'
         << CPI << ":\t\t\t\t\t";
@@ -889,12 +889,12 @@ void AsmPrinter::EmitConstantValueOnly(const Constant *CV) {
 
       // We can emit the pointer value into this slot if the slot is an
       // integer slot greater or equal to the size of the pointer.
 
       // We can emit the pointer value into this slot if the slot is an
       // integer slot greater or equal to the size of the pointer.
-      if (TD->getTypePaddedSize(Ty) >= TD->getTypePaddedSize(Op->getType()))
+      if (TD->getTypeAllocSize(Ty) >= TD->getTypeAllocSize(Op->getType()))
         return EmitConstantValueOnly(Op);
 
       O << "((";
       EmitConstantValueOnly(Op);
         return EmitConstantValueOnly(Op);
 
       O << "((";
       EmitConstantValueOnly(Op);
-      APInt ptrMask = APInt::getAllOnesValue(TD->getTypePaddedSizeInBits(Ty));
+      APInt ptrMask = APInt::getAllOnesValue(TD->getTypeAllocSizeInBits(Ty));
       
       SmallString<40> S;
       ptrMask.toStringUnsigned(S);
       
       SmallString<40> S;
       ptrMask.toStringUnsigned(S);
@@ -992,14 +992,14 @@ void AsmPrinter::EmitGlobalConstantStruct(const ConstantStruct *CVS,
                                           unsigned AddrSpace) {
   // Print the fields in successive locations. Pad to align if needed!
   const TargetData *TD = TM.getTargetData();
                                           unsigned AddrSpace) {
   // Print the fields in successive locations. Pad to align if needed!
   const TargetData *TD = TM.getTargetData();
-  unsigned Size = TD->getTypePaddedSize(CVS->getType());
+  unsigned Size = TD->getTypeAllocSize(CVS->getType());
   const StructLayout *cvsLayout = TD->getStructLayout(CVS->getType());
   uint64_t sizeSoFar = 0;
   for (unsigned i = 0, e = CVS->getNumOperands(); i != e; ++i) {
     const Constant* field = CVS->getOperand(i);
 
     // Check if padding is needed and insert one or more 0s.
   const StructLayout *cvsLayout = TD->getStructLayout(CVS->getType());
   uint64_t sizeSoFar = 0;
   for (unsigned i = 0, e = CVS->getNumOperands(); i != e; ++i) {
     const Constant* field = CVS->getOperand(i);
 
     // Check if padding is needed and insert one or more 0s.
-    uint64_t fieldSize = TD->getTypePaddedSize(field->getType());
+    uint64_t fieldSize = TD->getTypeAllocSize(field->getType());
     uint64_t padSize = ((i == e-1 ? Size : cvsLayout->getElementOffset(i+1))
                         - cvsLayout->getElementOffset(i)) - fieldSize;
     sizeSoFar += fieldSize + padSize;
     uint64_t padSize = ((i == e-1 ? Size : cvsLayout->getElementOffset(i+1))
                         - cvsLayout->getElementOffset(i)) - fieldSize;
     sizeSoFar += fieldSize + padSize;
@@ -1123,7 +1123,7 @@ void AsmPrinter::EmitGlobalConstantFP(const ConstantFP *CFP,
           << " long double most significant halfword";
       O << '\n';
     }
           << " long double most significant halfword";
       O << '\n';
     }
-    EmitZeros(TD->getTypePaddedSize(Type::X86_FP80Ty) -
+    EmitZeros(TD->getTypeAllocSize(Type::X86_FP80Ty) -
               TD->getTypeStoreSize(Type::X86_FP80Ty), AddrSpace);
     return;
   } else if (CFP->getType() == Type::PPC_FP128Ty) {
               TD->getTypeStoreSize(Type::X86_FP80Ty), AddrSpace);
     return;
   } else if (CFP->getType() == Type::PPC_FP128Ty) {
@@ -1228,7 +1228,7 @@ void AsmPrinter::EmitGlobalConstantLargeInt(const ConstantInt *CI,
 void AsmPrinter::EmitGlobalConstant(const Constant *CV, unsigned AddrSpace) {
   const TargetData *TD = TM.getTargetData();
   const Type *type = CV->getType();
 void AsmPrinter::EmitGlobalConstant(const Constant *CV, unsigned AddrSpace) {
   const TargetData *TD = TM.getTargetData();
   const Type *type = CV->getType();
-  unsigned Size = TD->getTypePaddedSize(type);
+  unsigned Size = TD->getTypeAllocSize(type);
 
   if (CV->isNullValue() || isa<UndefValue>(CV)) {
     EmitZeros(Size, AddrSpace);
 
   if (CV->isNullValue() || isa<UndefValue>(CV)) {
     EmitZeros(Size, AddrSpace);
index ddc4e3588b82fe9243d546af8aaae0f2aa119985..7cc1162352436fef9651871b28eb9a4f44603073 100644 (file)
@@ -284,7 +284,7 @@ void ELFWriter::EmitGlobal(GlobalVariable *GV) {
 
   unsigned Align = TM.getTargetData()->getPreferredAlignment(GV);
   unsigned Size  =
 
   unsigned Align = TM.getTargetData()->getPreferredAlignment(GV);
   unsigned Size  =
-    TM.getTargetData()->getTypePaddedSize(GV->getType()->getElementType());
+    TM.getTargetData()->getTypeAllocSize(GV->getType()->getElementType());
 
   // If this global has a zero initializer, it is part of the .bss or common
   // section.
 
   // If this global has a zero initializer, it is part of the .bss or common
   // section.
index d2e87917afb84725e8c2629c978b833975f1ed7a..c8787987a3e24f296486006e1d8564ebde103b15 100644 (file)
@@ -281,7 +281,7 @@ void MachOCodeEmitter::emitConstantPool(MachineConstantPool *MCP) {
   // "giant object for PIC" optimization.
   for (unsigned i = 0, e = CP.size(); i != e; ++i) {
     const Type *Ty = CP[i].getType();
   // "giant object for PIC" optimization.
   for (unsigned i = 0, e = CP.size(); i != e; ++i) {
     const Type *Ty = CP[i].getType();
-    unsigned Size = TM.getTargetData()->getTypePaddedSize(Ty);
+    unsigned Size = TM.getTargetData()->getTypeAllocSize(Ty);
 
     MachOWriter::MachOSection *Sec = MOW.getConstSection(CP[i].Val.ConstVal);
     OutputBuffer SecDataOut(Sec->SectionData, is64Bit, isLittleEndian);
 
     MachOWriter::MachOSection *Sec = MOW.getConstSection(CP[i].Val.ConstVal);
     OutputBuffer SecDataOut(Sec->SectionData, is64Bit, isLittleEndian);
@@ -355,7 +355,7 @@ MachOWriter::~MachOWriter() {
 
 void MachOWriter::AddSymbolToSection(MachOSection *Sec, GlobalVariable *GV) {
   const Type *Ty = GV->getType()->getElementType();
 
 void MachOWriter::AddSymbolToSection(MachOSection *Sec, GlobalVariable *GV) {
   const Type *Ty = GV->getType()->getElementType();
-  unsigned Size = TM.getTargetData()->getTypePaddedSize(Ty);
+  unsigned Size = TM.getTargetData()->getTypeAllocSize(Ty);
   unsigned Align = TM.getTargetData()->getPreferredAlignment(GV);
 
   // Reserve space in the .bss section for this symbol while maintaining the
   unsigned Align = TM.getTargetData()->getPreferredAlignment(GV);
 
   // Reserve space in the .bss section for this symbol while maintaining the
@@ -400,7 +400,7 @@ void MachOWriter::AddSymbolToSection(MachOSection *Sec, GlobalVariable *GV) {
 
 void MachOWriter::EmitGlobal(GlobalVariable *GV) {
   const Type *Ty = GV->getType()->getElementType();
 
 void MachOWriter::EmitGlobal(GlobalVariable *GV) {
   const Type *Ty = GV->getType()->getElementType();
-  unsigned Size = TM.getTargetData()->getTypePaddedSize(Ty);
+  unsigned Size = TM.getTargetData()->getTypeAllocSize(Ty);
   bool NoInit = !GV->hasInitializer();
   
   // If this global has a zero initializer, it is part of the .bss or common
   bool NoInit = !GV->hasInitializer();
   
   // If this global has a zero initializer, it is part of the .bss or common
@@ -825,7 +825,7 @@ void MachOWriter::InitMem(const Constant *C, void *Addr, intptr_t Offset,
       continue;
     } else if (const ConstantVector *CP = dyn_cast<ConstantVector>(PC)) {
       unsigned ElementSize =
       continue;
     } else if (const ConstantVector *CP = dyn_cast<ConstantVector>(PC)) {
       unsigned ElementSize =
-        TD->getTypePaddedSize(CP->getType()->getElementType());
+        TD->getTypeAllocSize(CP->getType()->getElementType());
       for (unsigned i = 0, e = CP->getNumOperands(); i != e; ++i)
         WorkList.push_back(CPair(CP->getOperand(i), PA+i*ElementSize));
     } else if (const ConstantExpr *CE = dyn_cast<ConstantExpr>(PC)) {
       for (unsigned i = 0, e = CP->getNumOperands(); i != e; ++i)
         WorkList.push_back(CPair(CP->getOperand(i), PA+i*ElementSize));
     } else if (const ConstantExpr *CE = dyn_cast<ConstantExpr>(PC)) {
@@ -926,10 +926,10 @@ void MachOWriter::InitMem(const Constant *C, void *Addr, intptr_t Offset,
         abort();
       }
     } else if (isa<ConstantAggregateZero>(PC)) {
         abort();
       }
     } else if (isa<ConstantAggregateZero>(PC)) {
-      memset((void*)PA, 0, (size_t)TD->getTypePaddedSize(PC->getType()));
+      memset((void*)PA, 0, (size_t)TD->getTypeAllocSize(PC->getType()));
     } else if (const ConstantArray *CPA = dyn_cast<ConstantArray>(PC)) {
       unsigned ElementSize =
     } else if (const ConstantArray *CPA = dyn_cast<ConstantArray>(PC)) {
       unsigned ElementSize =
-        TD->getTypePaddedSize(CPA->getType()->getElementType());
+        TD->getTypeAllocSize(CPA->getType()->getElementType());
       for (unsigned i = 0, e = CPA->getNumOperands(); i != e; ++i)
         WorkList.push_back(CPair(CPA->getOperand(i), PA+i*ElementSize));
     } else if (const ConstantStruct *CPS = dyn_cast<ConstantStruct>(PC)) {
       for (unsigned i = 0, e = CPA->getNumOperands(); i != e; ++i)
         WorkList.push_back(CPair(CPA->getOperand(i), PA+i*ElementSize));
     } else if (const ConstantStruct *CPS = dyn_cast<ConstantStruct>(PC)) {
index aacaf2c9e038cb9bcc7e2c99e0ee1461c0c1074a..20a4084638ea46a49263177e17ec47065bcddbf1 100644 (file)
@@ -468,7 +468,7 @@ namespace llvm {
       
       const Type *Ty = C->getType();
       if (Ty->isPrimitiveType() || Ty->isInteger()) {
       
       const Type *Ty = C->getType();
       if (Ty->isPrimitiveType() || Ty->isInteger()) {
-        unsigned Size = TM.getTargetData()->getTypePaddedSize(Ty);
+        unsigned Size = TM.getTargetData()->getTypeAllocSize(Ty);
         switch(Size) {
         default: break; // Fall through to __TEXT,__const
         case 4:
         switch(Size) {
         default: break; // Fall through to __TEXT,__const
         case 4:
index 10b7576a69c53aa67ce4d1c44abe8d2b1eac7a86..8a1dc5d93703e16fc2dca7b8cb6324dddf8ff114 100644 (file)
@@ -5694,7 +5694,7 @@ SDValue DAGCombiner::SimplifySelectCC(DebugLoc DL, SDValue N0, SDValue N1,
         // Get the offsets to the 0 and 1 element of the array so that we can
         // select between them.
         SDValue Zero = DAG.getIntPtrConstant(0);
         // Get the offsets to the 0 and 1 element of the array so that we can
         // select between them.
         SDValue Zero = DAG.getIntPtrConstant(0);
-        unsigned EltSize = (unsigned)TD.getTypePaddedSize(Elts[0]->getType());
+        unsigned EltSize = (unsigned)TD.getTypeAllocSize(Elts[0]->getType());
         SDValue One = DAG.getIntPtrConstant(EltSize);
         
         SDValue Cond = DAG.getSetCC(DL,
         SDValue One = DAG.getIntPtrConstant(EltSize);
         
         SDValue Cond = DAG.getSetCC(DL,
index 22051867a001ba81d81debb9ab78e63acb53d1b9..367cf4cd5cc85869549ef676c5748a2e749ebe0e 100644 (file)
@@ -285,7 +285,7 @@ bool FastISel::SelectGetElementPtr(User *I) {
       if (ConstantInt *CI = dyn_cast<ConstantInt>(Idx)) {
         if (CI->getZExtValue() == 0) continue;
         uint64_t Offs = 
       if (ConstantInt *CI = dyn_cast<ConstantInt>(Idx)) {
         if (CI->getZExtValue() == 0) continue;
         uint64_t Offs = 
-          TD.getTypePaddedSize(Ty)*cast<ConstantInt>(CI)->getSExtValue();
+          TD.getTypeAllocSize(Ty)*cast<ConstantInt>(CI)->getSExtValue();
         N = FastEmit_ri_(VT, ISD::ADD, N, Offs, VT);
         if (N == 0)
           // Unhandled operand. Halt "fast" selection and bail.
         N = FastEmit_ri_(VT, ISD::ADD, N, Offs, VT);
         if (N == 0)
           // Unhandled operand. Halt "fast" selection and bail.
@@ -294,7 +294,7 @@ bool FastISel::SelectGetElementPtr(User *I) {
       }
       
       // N = N + Idx * ElementSize;
       }
       
       // N = N + Idx * ElementSize;
-      uint64_t ElementSize = TD.getTypePaddedSize(Ty);
+      uint64_t ElementSize = TD.getTypeAllocSize(Ty);
       unsigned IdxN = getRegForGEPIndex(Idx);
       if (IdxN == 0)
         // Unhandled operand. Halt "fast" selection and bail.
       unsigned IdxN = getRegForGEPIndex(Idx);
       if (IdxN == 0)
         // Unhandled operand. Halt "fast" selection and bail.
index 0787f933be2f724d8d44cb99edebfe072f9028a9..1a3370f0a06e7649646e46d6e26690ea60f53135 100644 (file)
@@ -3638,7 +3638,7 @@ SDValue SelectionDAGLegalize::LegalizeOp(SDValue Op) {
       // Increment the pointer, VAList, to the next vaarg
       Tmp3 = DAG.getNode(ISD::ADD, dl, TLI.getPointerTy(), VAList,
                          DAG.getConstant(TLI.getTargetData()->
       // Increment the pointer, VAList, to the next vaarg
       Tmp3 = DAG.getNode(ISD::ADD, dl, TLI.getPointerTy(), VAList,
                          DAG.getConstant(TLI.getTargetData()->
-                                         getTypePaddedSize(VT.getTypeForMVT()),
+                                         getTypeAllocSize(VT.getTypeForMVT()),
                                          TLI.getPointerTy()));
       // Store the incremented VAList to the legalized pointer
       Tmp3 = DAG.getStore(VAList.getValue(1), dl, Tmp3, Tmp2, V, 0);
                                          TLI.getPointerTy()));
       // Store the incremented VAList to the legalized pointer
       Tmp3 = DAG.getStore(VAList.getValue(1), dl, Tmp3, Tmp2, V, 0);
index 6e38590e248e34d213b123463487e447db8cc903..f1da2583f346c15fd1679dddb57a445a35638a73 100644 (file)
@@ -295,7 +295,7 @@ void ScheduleDAGSDNodes::AddOperand(MachineInstr *MI, SDValue Op,
       Align = TM.getTargetData()->getPrefTypeAlignment(Type);
       if (Align == 0) {
         // Alignment of vector types.  FIXME!
       Align = TM.getTargetData()->getPrefTypeAlignment(Type);
       if (Align == 0) {
         // Alignment of vector types.  FIXME!
-        Align = TM.getTargetData()->getTypePaddedSize(Type);
+        Align = TM.getTargetData()->getTypeAllocSize(Type);
       }
     }
     
       }
     }
     
index 1562c13a3f1b3ac2a6ecbb95b98d1130866aebb1..b340d0c971bc22dfc318989f499c56091c2f8b3c 100644 (file)
@@ -128,7 +128,7 @@ static void ComputeValueVTs(const TargetLowering &TLI, const Type *Ty,
   // Given an array type, recursively traverse the elements.
   if (const ArrayType *ATy = dyn_cast<ArrayType>(Ty)) {
     const Type *EltTy = ATy->getElementType();
   // Given an array type, recursively traverse the elements.
   if (const ArrayType *ATy = dyn_cast<ArrayType>(Ty)) {
     const Type *EltTy = ATy->getElementType();
-    uint64_t EltSize = TLI.getTargetData()->getTypePaddedSize(EltTy);
+    uint64_t EltSize = TLI.getTargetData()->getTypeAllocSize(EltTy);
     for (unsigned i = 0, e = ATy->getNumElements(); i != e; ++i)
       ComputeValueVTs(TLI, EltTy, ValueVTs, Offsets,
                       StartingOffset + i * EltSize);
     for (unsigned i = 0, e = ATy->getNumElements(); i != e; ++i)
       ComputeValueVTs(TLI, EltTy, ValueVTs, Offsets,
                       StartingOffset + i * EltSize);
@@ -294,7 +294,7 @@ void FunctionLoweringInfo::set(Function &fn, MachineFunction &mf,
     if (AllocaInst *AI = dyn_cast<AllocaInst>(I))
       if (ConstantInt *CUI = dyn_cast<ConstantInt>(AI->getArraySize())) {
         const Type *Ty = AI->getAllocatedType();
     if (AllocaInst *AI = dyn_cast<AllocaInst>(I))
       if (ConstantInt *CUI = dyn_cast<ConstantInt>(AI->getArraySize())) {
         const Type *Ty = AI->getAllocatedType();
-        uint64_t TySize = TLI.getTargetData()->getTypePaddedSize(Ty);
+        uint64_t TySize = TLI.getTargetData()->getTypeAllocSize(Ty);
         unsigned Align =
           std::max((unsigned)TLI.getTargetData()->getPrefTypeAlignment(Ty),
                    AI->getAlignment());
         unsigned Align =
           std::max((unsigned)TLI.getTargetData()->getPrefTypeAlignment(Ty),
                    AI->getAlignment());
@@ -2700,7 +2700,7 @@ void SelectionDAGLowering::visitGetElementPtr(User &I) {
       if (ConstantInt *CI = dyn_cast<ConstantInt>(Idx)) {
         if (CI->getZExtValue() == 0) continue;
         uint64_t Offs =
       if (ConstantInt *CI = dyn_cast<ConstantInt>(Idx)) {
         if (CI->getZExtValue() == 0) continue;
         uint64_t Offs =
-            TD->getTypePaddedSize(Ty)*cast<ConstantInt>(CI)->getSExtValue();
+            TD->getTypeAllocSize(Ty)*cast<ConstantInt>(CI)->getSExtValue();
         SDValue OffsVal;
         unsigned PtrBits = TLI.getPointerTy().getSizeInBits();
         if (PtrBits < 64) {
         SDValue OffsVal;
         unsigned PtrBits = TLI.getPointerTy().getSizeInBits();
         if (PtrBits < 64) {
@@ -2715,7 +2715,7 @@ void SelectionDAGLowering::visitGetElementPtr(User &I) {
       }
 
       // N = N + Idx * ElementSize;
       }
 
       // N = N + Idx * ElementSize;
-      uint64_t ElementSize = TD->getTypePaddedSize(Ty);
+      uint64_t ElementSize = TD->getTypeAllocSize(Ty);
       SDValue IdxN = getValue(Idx);
 
       // If the index is smaller or larger than intptr_t, truncate or extend
       SDValue IdxN = getValue(Idx);
 
       // If the index is smaller or larger than intptr_t, truncate or extend
@@ -2756,7 +2756,7 @@ void SelectionDAGLowering::visitAlloca(AllocaInst &I) {
     return;   // getValue will auto-populate this.
 
   const Type *Ty = I.getAllocatedType();
     return;   // getValue will auto-populate this.
 
   const Type *Ty = I.getAllocatedType();
-  uint64_t TySize = TLI.getTargetData()->getTypePaddedSize(Ty);
+  uint64_t TySize = TLI.getTargetData()->getTypeAllocSize(Ty);
   unsigned Align =
     std::max((unsigned)TLI.getTargetData()->getPrefTypeAlignment(Ty),
              I.getAlignment());
   unsigned Align =
     std::max((unsigned)TLI.getTargetData()->getPrefTypeAlignment(Ty),
              I.getAlignment());
@@ -5199,7 +5199,7 @@ void SelectionDAGLowering::visitInlineAsm(CallSite CS) {
         // Otherwise, create a stack slot and emit a store to it before the
         // asm.
         const Type *Ty = OpVal->getType();
         // Otherwise, create a stack slot and emit a store to it before the
         // asm.
         const Type *Ty = OpVal->getType();
-        uint64_t TySize = TLI.getTargetData()->getTypePaddedSize(Ty);
+        uint64_t TySize = TLI.getTargetData()->getTypeAllocSize(Ty);
         unsigned Align  = TLI.getTargetData()->getPrefTypeAlignment(Ty);
         MachineFunction &MF = DAG.getMachineFunction();
         int SSFI = MF.getFrameInfo()->CreateStackObject(TySize, Align);
         unsigned Align  = TLI.getTargetData()->getPrefTypeAlignment(Ty);
         MachineFunction &MF = DAG.getMachineFunction();
         int SSFI = MF.getFrameInfo()->CreateStackObject(TySize, Align);
@@ -5500,7 +5500,7 @@ void SelectionDAGLowering::visitMalloc(MallocInst &I) {
   // i32-ness of the optimizer: we do not want to promote to i64 and then
   // multiply on 64-bit targets.
   // FIXME: Malloc inst should go away: PR715.
   // i32-ness of the optimizer: we do not want to promote to i64 and then
   // multiply on 64-bit targets.
   // FIXME: Malloc inst should go away: PR715.
-  uint64_t ElementSize = TD->getTypePaddedSize(I.getType()->getElementType());
+  uint64_t ElementSize = TD->getTypeAllocSize(I.getType()->getElementType());
   if (ElementSize != 1)
     Src = DAG.getNode(ISD::MUL, getCurDebugLoc(), Src.getValueType(),
                       Src, DAG.getConstant(ElementSize, Src.getValueType()));
   if (ElementSize != 1)
     Src = DAG.getNode(ISD::MUL, getCurDebugLoc(), Src.getValueType(),
                       Src, DAG.getConstant(ElementSize, Src.getValueType()));
@@ -5614,7 +5614,7 @@ void TargetLowering::LowerArguments(Function &F, SelectionDAG &DAG,
         const PointerType *Ty = cast<PointerType>(I->getType());
         const Type *ElementTy = Ty->getElementType();
         unsigned FrameAlign = getByValTypeAlignment(ElementTy);
         const PointerType *Ty = cast<PointerType>(I->getType());
         const Type *ElementTy = Ty->getElementType();
         unsigned FrameAlign = getByValTypeAlignment(ElementTy);
-        unsigned FrameSize  = getTargetData()->getTypePaddedSize(ElementTy);
+        unsigned FrameSize  = getTargetData()->getTypeAllocSize(ElementTy);
         // For ByVal, alignment should be passed from FE.  BE will guess if
         // this info is not there but there are cases it cannot get right.
         if (F.getParamAlignment(j))
         // For ByVal, alignment should be passed from FE.  BE will guess if
         // this info is not there but there are cases it cannot get right.
         if (F.getParamAlignment(j))
@@ -5747,7 +5747,7 @@ TargetLowering::LowerCallTo(SDValue Chain, const Type *RetTy,
         const PointerType *Ty = cast<PointerType>(Args[i].Ty);
         const Type *ElementTy = Ty->getElementType();
         unsigned FrameAlign = getByValTypeAlignment(ElementTy);
         const PointerType *Ty = cast<PointerType>(Args[i].Ty);
         const Type *ElementTy = Ty->getElementType();
         unsigned FrameAlign = getByValTypeAlignment(ElementTy);
-        unsigned FrameSize  = getTargetData()->getTypePaddedSize(ElementTy);
+        unsigned FrameSize  = getTargetData()->getTypeAllocSize(ElementTy);
         // For ByVal, alignment should come from FE.  BE will guess if this
         // info is not there but there are cases it cannot get right.
         if (Args[i].Alignment)
         // For ByVal, alignment should come from FE.  BE will guess if this
         // info is not there but there are cases it cannot get right.
         if (Args[i].Alignment)
index c333acd42a8b543e2ba23f33a266b16ef4a5d568..c179f1e3df97cea83db1dd22641ffcb36c5e6988 100644 (file)
@@ -114,7 +114,7 @@ bool StackProtector::RequiresStackProtector() const {
         if (const ArrayType *AT = dyn_cast<ArrayType>(AI->getAllocatedType()))
           // If an array has more than SSPBufferSize bytes of allocated space,
           // then we emit stack protectors.
         if (const ArrayType *AT = dyn_cast<ArrayType>(AI->getAllocatedType()))
           // If an array has more than SSPBufferSize bytes of allocated space,
           // then we emit stack protectors.
-          if (SSPBufferSize <= TD->getTypePaddedSize(AT))
+          if (SSPBufferSize <= TD->getTypeAllocSize(AT))
             return true;
       }
   }
             return true;
       }
   }
index 9cd03dac27ecdc661d64bf39843a4472104ee4da..29a05bbbdb64c7c89be8ac10622705f54f9b9d6f 100644 (file)
@@ -55,7 +55,7 @@ ExecutionEngine::~ExecutionEngine() {
 
 char* ExecutionEngine::getMemoryForGV(const GlobalVariable* GV) {
   const Type *ElTy = GV->getType()->getElementType();
 
 char* ExecutionEngine::getMemoryForGV(const GlobalVariable* GV) {
   const Type *ElTy = GV->getType()->getElementType();
-  size_t GVSize = (size_t)getTargetData()->getTypePaddedSize(ElTy);
+  size_t GVSize = (size_t)getTargetData()->getTypeAllocSize(ElTy);
   return new char[GVSize];
 }
 
   return new char[GVSize];
 }
 
@@ -848,16 +848,16 @@ void ExecutionEngine::InitializeMemory(const Constant *Init, void *Addr) {
     return;
   } else if (const ConstantVector *CP = dyn_cast<ConstantVector>(Init)) {
     unsigned ElementSize =
     return;
   } else if (const ConstantVector *CP = dyn_cast<ConstantVector>(Init)) {
     unsigned ElementSize =
-      getTargetData()->getTypePaddedSize(CP->getType()->getElementType());
+      getTargetData()->getTypeAllocSize(CP->getType()->getElementType());
     for (unsigned i = 0, e = CP->getNumOperands(); i != e; ++i)
       InitializeMemory(CP->getOperand(i), (char*)Addr+i*ElementSize);
     return;
   } else if (isa<ConstantAggregateZero>(Init)) {
     for (unsigned i = 0, e = CP->getNumOperands(); i != e; ++i)
       InitializeMemory(CP->getOperand(i), (char*)Addr+i*ElementSize);
     return;
   } else if (isa<ConstantAggregateZero>(Init)) {
-    memset(Addr, 0, (size_t)getTargetData()->getTypePaddedSize(Init->getType()));
+    memset(Addr, 0, (size_t)getTargetData()->getTypeAllocSize(Init->getType()));
     return;
   } else if (const ConstantArray *CPA = dyn_cast<ConstantArray>(Init)) {
     unsigned ElementSize =
     return;
   } else if (const ConstantArray *CPA = dyn_cast<ConstantArray>(Init)) {
     unsigned ElementSize =
-      getTargetData()->getTypePaddedSize(CPA->getType()->getElementType());
+      getTargetData()->getTypeAllocSize(CPA->getType()->getElementType());
     for (unsigned i = 0, e = CPA->getNumOperands(); i != e; ++i)
       InitializeMemory(CPA->getOperand(i), (char*)Addr+i*ElementSize);
     return;
     for (unsigned i = 0, e = CPA->getNumOperands(); i != e; ++i)
       InitializeMemory(CPA->getOperand(i), (char*)Addr+i*ElementSize);
     return;
@@ -1004,7 +1004,7 @@ void ExecutionEngine::EmitGlobalVariable(const GlobalVariable *GV) {
     InitializeMemory(GV->getInitializer(), GA);
   
   const Type *ElTy = GV->getType()->getElementType();
     InitializeMemory(GV->getInitializer(), GA);
   
   const Type *ElTy = GV->getType()->getElementType();
-  size_t GVSize = (size_t)getTargetData()->getTypePaddedSize(ElTy);
+  size_t GVSize = (size_t)getTargetData()->getTypeAllocSize(ElTy);
   NumInitBytes += (unsigned)GVSize;
   ++NumGlobals;
 }
   NumInitBytes += (unsigned)GVSize;
   ++NumGlobals;
 }
index a79bcc2803129c41529ed56a71bf2326d9c7e0ab..765fed248f9881ab7329840eccd45c3b32a7a4aa 100644 (file)
@@ -750,7 +750,7 @@ void Interpreter::visitAllocationInst(AllocationInst &I) {
   unsigned NumElements = 
     getOperandValue(I.getOperand(0), SF).IntVal.getZExtValue();
 
   unsigned NumElements = 
     getOperandValue(I.getOperand(0), SF).IntVal.getZExtValue();
 
-  unsigned TypeSize = (size_t)TD.getTypePaddedSize(Ty);
+  unsigned TypeSize = (size_t)TD.getTypeAllocSize(Ty);
 
   // Avoid malloc-ing zero bytes, use max()...
   unsigned MemToAlloc = std::max(1U, NumElements * TypeSize);
 
   // Avoid malloc-ing zero bytes, use max()...
   unsigned MemToAlloc = std::max(1U, NumElements * TypeSize);
@@ -810,7 +810,7 @@ GenericValue Interpreter::executeGEPOperation(Value *Ptr, gep_type_iterator I,
         assert(BitWidth == 64 && "Invalid index type for getelementptr");
         Idx = (int64_t)IdxGV.IntVal.getZExtValue();
       }
         assert(BitWidth == 64 && "Invalid index type for getelementptr");
         Idx = (int64_t)IdxGV.IntVal.getZExtValue();
       }
-      Total += TD.getTypePaddedSize(ST->getElementType())*Idx;
+      Total += TD.getTypeAllocSize(ST->getElementType())*Idx;
     }
   }
 
     }
   }
 
index 28ff253c371bfe5dd29d286e431d29ac29a7b732..21e670aadc9cb0a25ae5164e0938c3255678dd0c 100644 (file)
@@ -632,7 +632,7 @@ void *JIT::getOrEmitGlobalVariable(const GlobalVariable *GV) {
     // emit it into memory.  It goes in the same array as the generated
     // code, jump tables, etc.
     const Type *GlobalType = GV->getType()->getElementType();
     // emit it into memory.  It goes in the same array as the generated
     // code, jump tables, etc.
     const Type *GlobalType = GV->getType()->getElementType();
-    size_t S = getTargetData()->getTypePaddedSize(GlobalType);
+    size_t S = getTargetData()->getTypeAllocSize(GlobalType);
     size_t A = getTargetData()->getPreferredAlignment(GV);
     if (GV->isThreadLocal()) {
       MutexGuard locked(lock);
     size_t A = getTargetData()->getPreferredAlignment(GV);
     if (GV->isThreadLocal()) {
       MutexGuard locked(lock);
@@ -687,7 +687,7 @@ void *JIT::recompileAndRelinkFunction(Function *F) {
 ///
 char* JIT::getMemoryForGV(const GlobalVariable* GV) {
   const Type *ElTy = GV->getType()->getElementType();
 ///
 char* JIT::getMemoryForGV(const GlobalVariable* GV) {
   const Type *ElTy = GV->getType()->getElementType();
-  size_t GVSize = (size_t)getTargetData()->getTypePaddedSize(ElTy);
+  size_t GVSize = (size_t)getTargetData()->getTypeAllocSize(ElTy);
   if (GV->isThreadLocal()) {
     MutexGuard locked(lock);
     return TJI.allocateThreadLocalMemory(GVSize);
   if (GV->isThreadLocal()) {
     MutexGuard locked(lock);
     return TJI.allocateThreadLocalMemory(GVSize);
index 7356df4e4f7be1c5053cfc73aa4f0918ff4a9e42..58563563887c3b6233d705364f190a06ae8592e5 100644 (file)
@@ -809,7 +809,7 @@ static unsigned GetConstantPoolSizeInBytes(MachineConstantPool *MCP,
     unsigned AlignMask = CPE.getAlignment() - 1;
     Size = (Size + AlignMask) & ~AlignMask;
     const Type *Ty = CPE.getType();
     unsigned AlignMask = CPE.getAlignment() - 1;
     Size = (Size + AlignMask) & ~AlignMask;
     const Type *Ty = CPE.getType();
-    Size += TD->getTypePaddedSize(Ty);
+    Size += TD->getTypeAllocSize(Ty);
   }
   return Size;
 }
   }
   return Size;
 }
@@ -838,7 +838,7 @@ static uintptr_t RoundUpToAlign(uintptr_t Size, unsigned Alignment) {
 
 unsigned JITEmitter::addSizeOfGlobal(const GlobalVariable *GV, unsigned Size) {
   const Type *ElTy = GV->getType()->getElementType();
 
 unsigned JITEmitter::addSizeOfGlobal(const GlobalVariable *GV, unsigned Size) {
   const Type *ElTy = GV->getType()->getElementType();
-  size_t GVSize = (size_t)TheJIT->getTargetData()->getTypePaddedSize(ElTy);
+  size_t GVSize = (size_t)TheJIT->getTargetData()->getTypeAllocSize(ElTy);
   size_t GVAlign = 
       (size_t)TheJIT->getTargetData()->getPreferredAlignment(GV);
   DOUT << "JIT: Adding in size " << GVSize << " alignment " << GVAlign;
   size_t GVAlign = 
       (size_t)TheJIT->getTargetData()->getPreferredAlignment(GV);
   DOUT << "JIT: Adding in size " << GVSize << " alignment " << GVAlign;
@@ -1322,7 +1322,7 @@ void JITEmitter::emitConstantPool(MachineConstantPool *MCP) {
          << std::hex << CAddr << std::dec << "]\n";
 
     const Type *Ty = CPE.Val.ConstVal->getType();
          << std::hex << CAddr << std::dec << "]\n";
 
     const Type *Ty = CPE.Val.ConstVal->getType();
-    Offset += TheJIT->getTargetData()->getTypePaddedSize(Ty);
+    Offset += TheJIT->getTargetData()->getTypeAllocSize(Ty);
   }
 }
 
   }
 }
 
index 746d5edf17c0cd4069c9d362b0ecfd27bc01daa8..89f77b263fbb1b7583ff1fe9a8182204cc46d1ee 100644 (file)
@@ -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) {
   
   const TargetData &TD = *Fn.getTarget().getTargetData();
   for (unsigned i = 0, e = CPs.size(); i != e; ++i) {
-    unsigned Size = TD.getTypePaddedSize(CPs[i].getType());
+    unsigned Size = TD.getTypeAllocSize(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.
     // 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.
index d5def375c0b0ed708a44592003ec0f95d92b9bc1..062423a04e64c1b45139b500df3d698cd66aac13 100644 (file)
@@ -838,7 +838,7 @@ void ARMAsmPrinter::printModuleLevelGV(const GlobalVariable* GVar) {
   std::string name = Mang->getValueName(GVar);
   Constant *C = GVar->getInitializer();
   const Type *Type = C->getType();
   std::string name = Mang->getValueName(GVar);
   Constant *C = GVar->getInitializer();
   const Type *Type = C->getType();
-  unsigned Size = TD->getTypePaddedSize(Type);
+  unsigned Size = TD->getTypeAllocSize(Type);
   unsigned Align = TD->getPreferredAlignmentLog(GVar);
   bool isDarwin = Subtarget->isTargetDarwin();
 
   unsigned Align = TD->getPreferredAlignmentLog(GVar);
   bool isDarwin = Subtarget->isTargetDarwin();
 
index 0d200c5a1de2cde4308d6f4c009d47f87c32d068..74b48ee662354a48dc11ba922e7eb01bb722b81f 100644 (file)
@@ -224,7 +224,7 @@ void AlphaAsmPrinter::printModuleLevelGV(const GlobalVariable* GVar) {
 
   std::string name = Mang->getValueName(GVar);
   Constant *C = GVar->getInitializer();
 
   std::string name = Mang->getValueName(GVar);
   Constant *C = GVar->getInitializer();
-  unsigned Size = TD->getTypePaddedSize(C->getType());
+  unsigned Size = TD->getTypeAllocSize(C->getType());
   unsigned Align = TD->getPreferredAlignmentLog(GVar);
 
   // 0: Switch to section
   unsigned Align = TD->getPreferredAlignmentLog(GVar);
 
   // 0: Switch to section
index 5b35580a7dba10a40d8d4793e13bace1c25e0ead..bd926f609fae1168a755809a88017a3788f5df67 100644 (file)
@@ -497,7 +497,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(" +
     const VectorType *VTy = cast<VectorType>(Ty);
     return printSimpleType(Out, VTy->getElementType(), isSigned,
                      " __attribute__((vector_size(" +
-                     utostr(TD->getTypePaddedSize(VTy)) + " ))) " + NameSoFar);
+                     utostr(TD->getTypeAllocSize(VTy)) + " ))) " + NameSoFar);
   }
     
   default:
   }
     
   default:
@@ -542,7 +542,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(" +
     const VectorType *VTy = cast<VectorType>(Ty);
     return printSimpleType(Out, VTy->getElementType(), isSigned,
                      " __attribute__((vector_size(" +
-                     utostr(TD->getTypePaddedSize(VTy)) + " ))) " + NameSoFar);
+                     utostr(TD->getTypeAllocSize(VTy)) + " ))) " + NameSoFar);
   }
     
   default:
   }
     
   default:
index 15cacd146aab13eb3133c2f7163193f3e92d22ba..da1bf074de96a57fd31a11fed20b1fd0f981dff0 100644 (file)
@@ -530,7 +530,7 @@ void LinuxAsmPrinter::printModuleLevelGV(const GlobalVariable* GVar) {
 
   Constant *C = GVar->getInitializer();
   const Type *Type = C->getType();
 
   Constant *C = GVar->getInitializer();
   const Type *Type = C->getType();
-  unsigned Size = TD->getTypePaddedSize(Type);
+  unsigned Size = TD->getTypeAllocSize(Type);
   unsigned Align = TD->getPreferredAlignmentLog(GVar);
 
   SwitchToSection(TAI->SectionForGlobal(GVar));
   unsigned Align = TD->getPreferredAlignmentLog(GVar);
 
   SwitchToSection(TAI->SectionForGlobal(GVar));
index 927fdd295361943308f8a90596fad777780d68b8..05d2351776423198047b04a05f6346621bfc99d4 100644 (file)
@@ -117,7 +117,7 @@ DarwinTargetAsmInfo::MergeableStringSection(const GlobalVariable *GV) const {
   Constant *C = cast<GlobalVariable>(GV)->getInitializer();
   const Type *Ty = cast<ArrayType>(C->getType())->getElementType();
 
   Constant *C = cast<GlobalVariable>(GV)->getInitializer();
   const Type *Ty = cast<ArrayType>(C->getType())->getElementType();
 
-  unsigned Size = TD->getTypePaddedSize(Ty);
+  unsigned Size = TD->getTypeAllocSize(Ty);
   if (Size) {
     unsigned Align = TD->getPreferredAlignment(GV);
     if (Align <= 32)
   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();
 
 DarwinTargetAsmInfo::MergeableConstSection(const Type *Ty) const {
   const TargetData *TD = TM.getTargetData();
 
-  unsigned Size = TD->getTypePaddedSize(Ty);
+  unsigned Size = TD->getTypeAllocSize(Ty);
   if (Size == 4)
     return FourByteConstantSection;
   else if (Size == 8)
   if (Size == 4)
     return FourByteConstantSection;
   else if (Size == 8)
index 6bf7fd693b55375256b5fcdd551e16ca3f76a24e..8f6e96e2751dfec4bba4b7343b2aa5e7dfa1a8fc 100644 (file)
@@ -151,7 +151,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.
   // 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->getTypePaddedSize(Ty);
+  unsigned Size = TD->getTypeAllocSize(Ty);
   if (Size == 4 || Size == 8 || Size == 16) {
     std::string Name =  ".rodata.cst" + utostr(Size);
 
   if (Size == 4 || Size == 8 || Size == 16) {
     std::string Name =  ".rodata.cst" + utostr(Size);
 
@@ -169,7 +169,7 @@ ELFTargetAsmInfo::MergeableStringSection(const GlobalVariable *GV) const {
   Constant *C = cast<GlobalVariable>(GV)->getInitializer();
   const Type *Ty = cast<ArrayType>(C->getType())->getElementType();
 
   Constant *C = cast<GlobalVariable>(GV)->getInitializer();
   const Type *Ty = cast<ArrayType>(C->getType())->getElementType();
 
-  unsigned Size = TD->getTypePaddedSize(Ty);
+  unsigned Size = TD->getTypeAllocSize(Ty);
   if (Size <= 16) {
     assert(getCStringSection() && "Should have string section prefix");
 
   if (Size <= 16) {
     assert(getCStringSection() && "Should have string section prefix");
 
index 9cdcd73c633ae0b824a616110a820ea48a9e6792..fc54e23a44d7ee342310c37d17e335d85dbf644f 100644 (file)
@@ -269,7 +269,7 @@ void IA64AsmPrinter::printModuleLevelGV(const GlobalVariable* GVar) {
   O << "\n\n";
   std::string name = Mang->getValueName(GVar);
   Constant *C = GVar->getInitializer();
   O << "\n\n";
   std::string name = Mang->getValueName(GVar);
   Constant *C = GVar->getInitializer();
-  unsigned Size = TD->getTypePaddedSize(C->getType());
+  unsigned Size = TD->getTypeAllocSize(C->getType());
   unsigned Align = TD->getPreferredAlignmentLog(GVar);
 
   printVisibility(name, GVar->getVisibility());
   unsigned Align = TD->getPreferredAlignmentLog(GVar);
 
   printVisibility(name, GVar->getVisibility());
index e5a1203d92c7b047469f50f31660ee4dfa84ef7f..ada851d4f226c44b83edfed67c59797ebc353848 100644 (file)
@@ -385,7 +385,7 @@ std::string MSILWriter::getTypePostfix(const Type* Ty, bool Expand,
   case Type::DoubleTyID:
     return "r8";
   case Type::PointerTyID:
   case Type::DoubleTyID:
     return "r8";
   case Type::PointerTyID:
-    return "i"+utostr(TD->getTypePaddedSize(Ty));
+    return "i"+utostr(TD->getTypeAllocSize(Ty));
   default:
     cerr << "TypeID = " << Ty->getTypeID() << '\n';
     assert(0 && "Invalid type in TypeToPostfix()");
   default:
     cerr << "TypeID = " << Ty->getTypeID() << '\n';
     assert(0 && "Invalid type in TypeToPostfix()");
@@ -695,14 +695,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)
       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->getTypePaddedSize(StrucTy->getContainedType((unsigned)F));
+        Size += TD->getTypeAllocSize(StrucTy->getContainedType((unsigned)F));
       printPtrLoad(Size);
       printSimpleInstruction("add");
       continue;
     } else if (const SequentialType* SeqTy = dyn_cast<SequentialType>(*I)) {
       printPtrLoad(Size);
       printSimpleInstruction("add");
       continue;
     } else if (const SequentialType* SeqTy = dyn_cast<SequentialType>(*I)) {
-      Size = TD->getTypePaddedSize(SeqTy->getElementType());
+      Size = TD->getTypeAllocSize(SeqTy->getElementType());
     } else {
     } else {
-      Size = TD->getTypePaddedSize(*I);
+      Size = TD->getTypeAllocSize(*I);
     }
     // Add offset of current element to stack top.
     if (!isZeroValue(IndexValue)) {
     }
     // Add offset of current element to stack top.
     if (!isZeroValue(IndexValue)) {
@@ -1027,7 +1027,7 @@ void MSILWriter::printVAArgInstruction(const VAArgInst* Inst) {
 
 
 void MSILWriter::printAllocaInstruction(const AllocaInst* Inst) {
 
 
 void MSILWriter::printAllocaInstruction(const AllocaInst* Inst) {
-  uint64_t Size = TD->getTypePaddedSize(Inst->getAllocatedType());
+  uint64_t Size = TD->getTypeAllocSize(Inst->getAllocatedType());
   // Constant optimization.
   if (const ConstantInt* CInt = dyn_cast<ConstantInt>(Inst->getOperand(0))) {
     printPtrLoad(CInt->getZExtValue()*Size);
   // Constant optimization.
   if (const ConstantInt* CInt = dyn_cast<ConstantInt>(Inst->getOperand(0))) {
     printPtrLoad(CInt->getZExtValue()*Size);
@@ -1443,7 +1443,7 @@ void MSILWriter::printDeclarations(const TypeSymbolTable& ST) {
     // Print not duplicated type
     if (Printed.insert(Ty).second) {
       Out << ".class value explicit ansi sealed '" << Name << "'";
     // Print not duplicated type
     if (Printed.insert(Ty).second) {
       Out << ".class value explicit ansi sealed '" << Name << "'";
-      Out << " { .pack " << 1 << " .size " << TD->getTypePaddedSize(Ty);
+      Out << " { .pack " << 1 << " .size " << TD->getTypeAllocSize(Ty);
       Out << " }\n\n";
     }
   }
       Out << " }\n\n";
     }
   }
@@ -1473,7 +1473,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()) {
   const Type* Ty = C->getType();
   // Print zero initialized constant.
   if (isa<ConstantAggregateZero>(C) || C->isNullValue()) {
-    TySize = TD->getTypePaddedSize(C->getType());
+    TySize = TD->getTypeAllocSize(C->getType());
     Offset += TySize;
     Out << "int8 (0) [" << TySize << "]";
     return;
     Offset += TySize;
     Out << "int8 (0) [" << TySize << "]";
     return;
@@ -1481,14 +1481,14 @@ void MSILWriter::printStaticConstant(const Constant* C, uint64_t& Offset) {
   // Print constant initializer
   switch (Ty->getTypeID()) {
   case Type::IntegerTyID: {
   // Print constant initializer
   switch (Ty->getTypeID()) {
   case Type::IntegerTyID: {
-    TySize = TD->getTypePaddedSize(Ty);
+    TySize = TD->getTypeAllocSize(Ty);
     const ConstantInt* Int = cast<ConstantInt>(C);
     Out << getPrimitiveTypeName(Ty,true) << "(" << Int->getSExtValue() << ")";
     break;
   }
   case Type::FloatTyID:
   case Type::DoubleTyID: {
     const ConstantInt* Int = cast<ConstantInt>(C);
     Out << getPrimitiveTypeName(Ty,true) << "(" << Int->getSExtValue() << ")";
     break;
   }
   case Type::FloatTyID:
   case Type::DoubleTyID: {
-    TySize = TD->getTypePaddedSize(Ty);
+    TySize = TD->getTypeAllocSize(Ty);
     const ConstantFP* FP = cast<ConstantFP>(C);
     if (Ty->getTypeID() == Type::FloatTyID)
       Out << "int32 (" << 
     const ConstantFP* FP = cast<ConstantFP>(C);
     if (Ty->getTypeID() == Type::FloatTyID)
       Out << "int32 (" << 
@@ -1507,7 +1507,7 @@ void MSILWriter::printStaticConstant(const Constant* C, uint64_t& Offset) {
     }
     break;
   case Type::PointerTyID:
     }
     break;
   case Type::PointerTyID:
-    TySize = TD->getTypePaddedSize(C->getType());
+    TySize = TD->getTypeAllocSize(C->getType());
     // Initialize with global variable address
     if (const GlobalVariable *G = dyn_cast<GlobalVariable>(C)) {
       std::string name = getValueName(G);
     // Initialize with global variable address
     if (const GlobalVariable *G = dyn_cast<GlobalVariable>(C)) {
       std::string name = getValueName(G);
index fd2ae51b975e8303d39dedfe94b17bc42ec8b99a..dfb62382e75d99b454a1b5295b2117a31f702be4 100644 (file)
@@ -484,7 +484,7 @@ printModuleLevelGV(const GlobalVariable* GVar) {
   std::string name = Mang->getValueName(GVar);
   Constant *C = GVar->getInitializer();
   const Type *CTy = C->getType();
   std::string name = Mang->getValueName(GVar);
   Constant *C = GVar->getInitializer();
   const Type *CTy = C->getType();
-  unsigned Size = TD->getTypePaddedSize(CTy);
+  unsigned Size = TD->getTypeAllocSize(CTy);
   const ConstantArray *CVA = dyn_cast<ConstantArray>(C);
   bool printSizeAndType = true;
 
   const ConstantArray *CVA = dyn_cast<ConstantArray>(C);
   bool printSizeAndType = true;
 
index 9432e486db25a420b91d21a159468ada5e8bc6df..a0e5f30d78760da7981a0939cac7f3f9632d79cb 100644 (file)
@@ -210,7 +210,7 @@ bool MipsTargetLowering::IsGlobalInSmallSection(GlobalValue *GV)
     return false;
   
   const Type *Ty = GV->getType()->getElementType();
     return false;
   
   const Type *Ty = GV->getType()->getElementType();
-  unsigned Size = TD->getTypePaddedSize(Ty);
+  unsigned Size = TD->getTypeAllocSize(Ty);
 
   // if this is a internal constant string, there is a special
   // section for it, but not in small data/bss.
 
   // if this is a internal constant string, there is a special
   // section for it, but not in small data/bss.
@@ -551,7 +551,7 @@ LowerConstantPool(SDValue Op, SelectionDAG &DAG)
   // hacking it. This feature should come soon so we can uncomment the 
   // stuff below.
   //if (!Subtarget->hasABICall() &&  
   // hacking it. This feature should come soon so we can uncomment the 
   // stuff below.
   //if (!Subtarget->hasABICall() &&  
-  //    IsInSmallSection(getTargetData()->getTypePaddedSize(C->getType()))) {
+  //    IsInSmallSection(getTargetData()->getTypeAllocSize(C->getType()))) {
   //  SDValue GPRelNode = DAG.getNode(MipsISD::GPRel, MVT::i32, CP);
   //  SDValue GOT = DAG.getGLOBAL_OFFSET_TABLE(MVT::i32);
   //  ResNode = DAG.getNode(ISD::ADD, MVT::i32, GOT, GPRelNode); 
   //  SDValue GPRelNode = DAG.getNode(MipsISD::GPRel, MVT::i32, CP);
   //  SDValue GOT = DAG.getGLOBAL_OFFSET_TABLE(MVT::i32);
   //  ResNode = DAG.getNode(ISD::ADD, MVT::i32, GOT, GPRelNode); 
index 3eee3beef1257f4f4992ba94193a994d56876c9f..c197b0c2981cce105fffc91bb6eacbc0882cdaa8 100644 (file)
@@ -66,7 +66,7 @@ SectionKindForGlobal(const GlobalValue *GV) const {
 
   if (isa<GlobalVariable>(GV)) {
     const TargetData *TD = TM.getTargetData();
 
   if (isa<GlobalVariable>(GV)) {
     const TargetData *TD = TM.getTargetData();
-    unsigned Size = TD->getTypePaddedSize(GV->getType()->getElementType());
+    unsigned Size = TD->getTypeAllocSize(GV->getType()->getElementType());
     unsigned Threshold = Subtarget->getSSectionThreshold();
 
     if (Size > 0 && Size <= Threshold) {
     unsigned Threshold = Subtarget->getSSectionThreshold();
 
     if (Size > 0 && Size <= Threshold) {
index 87ecb2004bc68d53d2afb31a78b9ff2446a1e261..51787b85acf1820e5d48f18159092f6736d1f2ff 100644 (file)
@@ -286,7 +286,7 @@ void PIC16AsmPrinter::emitFunctionData(MachineFunction &MF) {
   const Type *RetType = F->getReturnType();
   unsigned RetSize = 0; 
   if (RetType->getTypeID() != Type::VoidTyID) 
   const Type *RetType = F->getReturnType();
   unsigned RetSize = 0; 
   if (RetType->getTypeID() != Type::VoidTyID) 
-    RetSize = TD->getTypePaddedSize(RetType);
+    RetSize = TD->getTypeAllocSize(RetType);
   
   //Emit function return value space
   if(RetSize > 0)
   
   //Emit function return value space
   if(RetSize > 0)
@@ -300,7 +300,7 @@ void PIC16AsmPrinter::emitFunctionData(MachineFunction &MF) {
   for (Function::const_arg_iterator argi = F->arg_begin(),
            arge = F->arg_end(); argi != arge ; ++argi) {
     const Type *Ty = argi->getType();
   for (Function::const_arg_iterator argi = F->arg_begin(),
            arge = F->arg_end(); argi != arge ; ++argi) {
     const Type *Ty = argi->getType();
-    ArgSize += TD->getTypePaddedSize(Ty);
+    ArgSize += TD->getTypeAllocSize(Ty);
    }
   O << FunctionLabelBegin << CurrentFnName << ".args.      RES  " << ArgSize 
     << "\n";
    }
   O << FunctionLabelBegin << CurrentFnName << ".args.      RES  " << ArgSize 
     << "\n";
@@ -340,7 +340,7 @@ void PIC16AsmPrinter::emitFunctionData(MachineFunction &MF) {
     I->setSection("fadata." + CurrentFnName + ".#");
     Constant *C = I->getInitializer();
     const Type *Ty = C->getType();
     I->setSection("fadata." + CurrentFnName + ".#");
     Constant *C = I->getInitializer();
     const Type *Ty = C->getType();
-    unsigned Size = TD->getTypePaddedSize(Ty);
+    unsigned Size = TD->getTypeAllocSize(Ty);
     FrameSize += Size; 
     // Emit memory reserve directive.
     O << FunctionLabelBegin << VarName << "  RES  " << Size << "\n";
     FrameSize += Size; 
     // Emit memory reserve directive.
     O << FunctionLabelBegin << VarName << "  RES  " << Size << "\n";
@@ -374,7 +374,7 @@ void PIC16AsmPrinter::EmitGlobalData (Module &M)
       std::string Name = Mang->getValueName(Items[j]);
       Constant *C = Items[j]->getInitializer();
       const Type *Ty = C->getType();
       std::string Name = Mang->getValueName(Items[j]);
       Constant *C = Items[j]->getInitializer();
       const Type *Ty = C->getType();
-      unsigned Size = TD->getTypePaddedSize(Ty);
+      unsigned Size = TD->getTypeAllocSize(Ty);
 
       O << Name << " " <<"RES"<< " " << Size ;
       O << "\n";
 
       O << Name << " " <<"RES"<< " " << Size ;
       O << "\n";
index 8be9a33b9308b20dce3f7f2682b93da516927d55..8c1daac3845ef24d410da804b41fb1633c385b2d 100644 (file)
@@ -72,7 +72,7 @@ PIC16TargetAsmInfo::getBSSSectionForGlobal(const GlobalVariable *GV) const {
   // Find how much space this global needs.
   const TargetData *TD = TM.getTargetData();
   const Type *Ty = C->getType(); 
   // Find how much space this global needs.
   const TargetData *TD = TM.getTargetData();
   const Type *Ty = C->getType(); 
-  unsigned ValSize = TD->getTypePaddedSize(Ty);
+  unsigned ValSize = TD->getTypeAllocSize(Ty);
  
   // Go through all BSS Sections and assign this variable
   // to the first available section having enough space.
  
   // Go through all BSS Sections and assign this variable
   // to the first available section having enough space.
@@ -118,7 +118,7 @@ PIC16TargetAsmInfo::getIDATASectionForGlobal(const GlobalVariable *GV) const {
   // Find how much space this global needs.
   const TargetData *TD = TM.getTargetData();
   const Type *Ty = C->getType(); 
   // Find how much space this global needs.
   const TargetData *TD = TM.getTargetData();
   const Type *Ty = C->getType(); 
-  unsigned ValSize = TD->getTypePaddedSize(Ty);
+  unsigned ValSize = TD->getTypeAllocSize(Ty);
  
   // Go through all IDATA Sections and assign this variable
   // to the first available section having enough space.
  
   // Go through all IDATA Sections and assign this variable
   // to the first available section having enough space.
index 96c86655d9665d29cf76b177c23a01f5bb0a7f91..7723982f69ad01ab45f4e9f6097e7fbbf97d5c39 100644 (file)
@@ -687,7 +687,7 @@ void PPCLinuxAsmPrinter::printModuleLevelGV(const GlobalVariable* GVar) {
 
   Constant *C = GVar->getInitializer();
   const Type *Type = C->getType();
 
   Constant *C = GVar->getInitializer();
   const Type *Type = C->getType();
-  unsigned Size = TD->getTypePaddedSize(Type);
+  unsigned Size = TD->getTypeAllocSize(Type);
   unsigned Align = TD->getPreferredAlignmentLog(GVar);
 
   SwitchToSection(TAI->SectionForGlobal(GVar));
   unsigned Align = TD->getPreferredAlignmentLog(GVar);
 
   SwitchToSection(TAI->SectionForGlobal(GVar));
@@ -927,7 +927,7 @@ void PPCDarwinAsmPrinter::printModuleLevelGV(const GlobalVariable* GVar) {
 
   Constant *C = GVar->getInitializer();
   const Type *Type = C->getType();
 
   Constant *C = GVar->getInitializer();
   const Type *Type = C->getType();
-  unsigned Size = TD->getTypePaddedSize(Type);
+  unsigned Size = TD->getTypeAllocSize(Type);
   unsigned Align = TD->getPreferredAlignmentLog(GVar);
 
   SwitchToSection(TAI->SectionForGlobal(GVar));
   unsigned Align = TD->getPreferredAlignmentLog(GVar);
 
   SwitchToSection(TAI->SectionForGlobal(GVar));
index 115f9b05d2f5e53efb902bd91b3566c97d41e6c3..61707f5556fb10bffc3236b5ee09b2dd438d2617 100644 (file)
@@ -253,7 +253,7 @@ void SparcAsmPrinter::printModuleLevelGV(const GlobalVariable* GVar) {
   O << "\n\n";
   std::string name = Mang->getValueName(GVar);
   Constant *C = GVar->getInitializer();
   O << "\n\n";
   std::string name = Mang->getValueName(GVar);
   Constant *C = GVar->getInitializer();
-  unsigned Size = TD->getTypePaddedSize(C->getType());
+  unsigned Size = TD->getTypeAllocSize(C->getType());
   unsigned Align = TD->getPreferredAlignment(GVar);
 
   printVisibility(name, GVar->getVisibility());
   unsigned Align = TD->getPreferredAlignment(GVar);
 
   printVisibility(name, GVar->getVisibility());
index 933ac82ca1d87d4be6bbdf7aef8541c761e6947b..ed544b73eaeda36d5bc33a9354daeca6e785f7a1 100644 (file)
@@ -53,7 +53,7 @@ unsigned long long LLVMStoreSizeOfType(LLVMTargetDataRef TD, LLVMTypeRef Ty) {
 }
 
 unsigned long long LLVMABISizeOfType(LLVMTargetDataRef TD, LLVMTypeRef Ty) {
 }
 
 unsigned long long LLVMABISizeOfType(LLVMTargetDataRef TD, LLVMTypeRef Ty) {
-  return unwrap(TD)->getTypePaddedSize(unwrap(Ty));
+  return unwrap(TD)->getTypeAllocSize(unwrap(Ty));
 }
 
 unsigned LLVMABIAlignmentOfType(LLVMTargetDataRef TD, LLVMTypeRef Ty) {
 }
 
 unsigned LLVMABIAlignmentOfType(LLVMTargetDataRef TD, LLVMTypeRef Ty) {
index 29004dad2841983935bb820378ce78e3aaeb3494..3ff1f0b20b123c1a5733177b6caf4013392a235d 100644 (file)
@@ -58,7 +58,7 @@ StructLayout::StructLayout(const StructType *ST, const TargetData &TD) {
     StructAlignment = std::max(TyAlign, StructAlignment);
 
     MemberOffsets[i] = StructSize;
     StructAlignment = std::max(TyAlign, StructAlignment);
 
     MemberOffsets[i] = StructSize;
-    StructSize += TD.getTypePaddedSize(Ty); // Consume space for this data item
+    StructSize += TD.getTypeAllocSize(Ty); // Consume space for this data item
   }
 
   // Empty structures have alignment of 1 byte.
   }
 
   // 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 getPointerSizeInBits();
   case Type::ArrayTyID: {
     const ArrayType *ATy = cast<ArrayType>(Ty);
-    return getTypePaddedSizeInBits(ATy->getElementType())*ATy->getNumElements();
+    return getTypeAllocSizeInBits(ATy->getElementType())*ATy->getNumElements();
   }
   case Type::StructTyID:
     // Get the layout annotation... which is lazily created on demand.
   }
   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();
 
       // Get the array index and the size of each array element.
       int64_t arrayIdx = cast<ConstantInt>(Indices[CurIDX])->getSExtValue();
-      Result += arrayIdx * (int64_t)getTypePaddedSize(Ty);
+      Result += arrayIdx * (int64_t)getTypeAllocSize(Ty);
     }
   }
 
     }
   }
 
index b3f4e15f022ef877dee6b6854d955124d42496a9..c88af21784c34eb3705469607a141995d7ea4452 100644 (file)
@@ -76,7 +76,7 @@ static X86MachineFunctionInfo calculateFunctionInfo(const Function *F,
       Ty = cast<PointerType>(Ty)->getElementType();
 
     // Size should be aligned to DWORD boundary
       Ty = cast<PointerType>(Ty)->getElementType();
 
     // Size should be aligned to DWORD boundary
-    Size += ((TD->getTypePaddedSize(Ty) + 3)/4)*4;
+    Size += ((TD->getTypeAllocSize(Ty) + 3)/4)*4;
   }
 
   // We're not supporting tooooo huge arguments :)
   }
 
   // We're not supporting tooooo huge arguments :)
@@ -811,7 +811,7 @@ void X86ATTAsmPrinter::printModuleLevelGV(const GlobalVariable* GVar) {
   std::string name = Mang->getValueName(GVar);
   Constant *C = GVar->getInitializer();
   const Type *Type = C->getType();
   std::string name = Mang->getValueName(GVar);
   Constant *C = GVar->getInitializer();
   const Type *Type = C->getType();
-  unsigned Size = TD->getTypePaddedSize(Type);
+  unsigned Size = TD->getTypeAllocSize(Type);
   unsigned Align = TD->getPreferredAlignmentLog(GVar);
 
   printVisibility(name, GVar->getVisibility());
   unsigned Align = TD->getPreferredAlignmentLog(GVar);
 
   printVisibility(name, GVar->getVisibility());
index b694a185100469d27f0c40372a1d20fdc928ea29..659934930d46c2f3d4b049a206770462f24f0113 100644 (file)
@@ -59,7 +59,7 @@ static X86MachineFunctionInfo calculateFunctionInfo(const Function *F,
       Ty = cast<PointerType>(Ty)->getElementType();
 
     // Size should be aligned to DWORD boundary
       Ty = cast<PointerType>(Ty)->getElementType();
 
     // Size should be aligned to DWORD boundary
-    Size += ((TD->getTypePaddedSize(Ty) + 3)/4)*4;
+    Size += ((TD->getTypeAllocSize(Ty) + 3)/4)*4;
   }
 
   // We're not supporting tooooo huge arguments :)
   }
 
   // We're not supporting tooooo huge arguments :)
index 811887bdc61b074607e0148184ad7c0568808fac..b3667be0d035203b60298bcf7c898d6825342651 100644 (file)
@@ -393,7 +393,7 @@ bool X86FastISel::X86SelectAddress(Value *V, X86AddressMode &AM, bool isCall) {
         unsigned Idx = cast<ConstantInt>(Op)->getZExtValue();
         Disp += SL->getElementOffset(Idx);
       } else {
         unsigned Idx = cast<ConstantInt>(Op)->getZExtValue();
         Disp += SL->getElementOffset(Idx);
       } else {
-        uint64_t S = TD.getTypePaddedSize(GTI.getIndexedType());
+        uint64_t S = TD.getTypeAllocSize(GTI.getIndexedType());
         if (ConstantInt *CI = dyn_cast<ConstantInt>(Op)) {
           // Constant-offset addressing.
           Disp += CI->getSExtValue() * S;
         if (ConstantInt *CI = dyn_cast<ConstantInt>(Op)) {
           // Constant-offset addressing.
           Disp += CI->getSExtValue() * S;
@@ -1490,7 +1490,7 @@ unsigned X86FastISel::TargetMaterializeConstant(Constant *C) {
   unsigned Align = TD.getPrefTypeAlignment(C->getType());
   if (Align == 0) {
     // Alignment of vector types.  FIXME!
   unsigned Align = TD.getPrefTypeAlignment(C->getType());
   if (Align == 0) {
     // Alignment of vector types.  FIXME!
-    Align = TD.getTypePaddedSize(C->getType());
+    Align = TD.getTypeAllocSize(C->getType());
   }
   
   // x86-32 PIC requires a PIC base register for constant pools.
   }
   
   // x86-32 PIC requires a PIC base register for constant pools.
index 45b3c37aeb9191a08a1ff7f4fe225d85c5b5d6fd..c9a6d8afd31619a92d651ead9d3d46d77268fbd4 100644 (file)
@@ -220,7 +220,7 @@ emitGlobal(const GlobalVariable *GV)
 
     EmitAlignment(Align, GV, 2);
     
 
     EmitAlignment(Align, GV, 2);
     
-    unsigned Size = TD->getTypePaddedSize(C->getType());
+    unsigned Size = TD->getTypeAllocSize(C->getType());
     if (GV->isThreadLocal()) {
       Size *= MaxThreads;
     }
     if (GV->isThreadLocal()) {
       Size *= MaxThreads;
     }
index 971c88320d84c326f001cb5b6ab3a98be59c9006..93c5f59f642b66245b404d2d8703f946cf78586c 100644 (file)
@@ -270,7 +270,7 @@ LowerGlobalTLSAddress(SDValue Op, SelectionDAG &DAG)
   }
   SDValue base = getGlobalAddressWrapper(GA, GV, DAG);
   const TargetData *TD = TM.getTargetData();
   }
   SDValue base = getGlobalAddressWrapper(GA, GV, DAG);
   const TargetData *TD = TM.getTargetData();
-  unsigned Size = TD->getTypePaddedSize(Ty);
+  unsigned Size = TD->getTypeAllocSize(Ty);
   SDValue offset = DAG.getNode(ISD::MUL, dl, MVT::i32, BuildGetId(DAG, dl),
                        DAG.getConstant(Size, MVT::i32));
   return DAG.getNode(ISD::ADD, dl, MVT::i32, base, offset);
   SDValue offset = DAG.getNode(ISD::MUL, dl, MVT::i32, BuildGetId(DAG, dl),
                        DAG.getConstant(Size, MVT::i32));
   return DAG.getNode(ISD::ADD, dl, MVT::i32, base, offset);
index 78eb90c3b14bbbd326c6763e4a9c4eefc84c78f8..55137621deaed64cd868b2f88e84019cb9b0c3bc 100644 (file)
@@ -106,7 +106,7 @@ inline const Section*
 XCoreTargetAsmInfo::MergeableConstSection(const Type *Ty) const {
   const TargetData *TD = TM.getTargetData();
 
 XCoreTargetAsmInfo::MergeableConstSection(const Type *Ty) const {
   const TargetData *TD = TM.getTargetData();
 
-  unsigned Size = TD->getTypePaddedSize(Ty);
+  unsigned Size = TD->getTypeAllocSize(Ty);
   if (Size == 4 || Size == 8 || Size == 16) {
     std::string Name =  ".cp.const" + utostr(Size);
 
   if (Size == 4 || Size == 8 || Size == 16) {
     std::string Name =  ".cp.const" + utostr(Size);
 
index b804e2b35876b0bcbcb8e685d5a79dd20785cf94..8a752c2b6c1c181c56c4f2cc3ca67a252505b520 100644 (file)
@@ -513,7 +513,7 @@ static GlobalVariable *SRAGlobal(GlobalVariable *GV, const TargetData &TD) {
       return 0; // It's not worth it.
     NewGlobals.reserve(NumElements);
     
       return 0; // It's not worth it.
     NewGlobals.reserve(NumElements);
     
-    uint64_t EltSize = TD.getTypePaddedSize(STy->getElementType());
+    uint64_t EltSize = TD.getTypeAllocSize(STy->getElementType());
     unsigned EltAlign = TD.getABITypeAlignment(STy->getElementType());
     for (unsigned i = 0, e = NumElements; i != e; ++i) {
       Constant *In = getAggregateConstantElement(Init,
     unsigned EltAlign = TD.getABITypeAlignment(STy->getElementType());
     for (unsigned i = 0, e = NumElements; i != e; ++i) {
       Constant *In = getAggregateConstantElement(Init,
@@ -1448,7 +1448,7 @@ static bool TryToOptimizeStoreOfMallocToGlobal(GlobalVariable *GV,
     // (2048 bytes currently), as we don't want to introduce a 16M global or
     // something.
     if (NElements->getZExtValue()*
     // (2048 bytes currently), as we don't want to introduce a 16M global or
     // something.
     if (NElements->getZExtValue()*
-        TD.getTypePaddedSize(MI->getAllocatedType()) < 2048) {
+        TD.getTypeAllocSize(MI->getAllocatedType()) < 2048) {
       GVI = OptimizeGlobalAddressOfMalloc(GV, MI);
       return true;
     }
       GVI = OptimizeGlobalAddressOfMalloc(GV, MI);
       return true;
     }
index 2d38e76dbe84342b8fdec30a7539f5a7193f3bd7..b923c92bd300768772aafda9fc0c5a826e9fed38 100644 (file)
@@ -305,11 +305,11 @@ bool DSE::handleEndBlock(BasicBlock &BB) {
         if (AllocaInst* A = dyn_cast<AllocaInst>(*I)) {
           if (ConstantInt* C = dyn_cast<ConstantInt>(A->getArraySize()))
             pointerSize = C->getZExtValue() *
         if (AllocaInst* A = dyn_cast<AllocaInst>(*I)) {
           if (ConstantInt* C = dyn_cast<ConstantInt>(A->getArraySize()))
             pointerSize = C->getZExtValue() *
-                          TD.getTypePaddedSize(A->getAllocatedType());
+                          TD.getTypeAllocSize(A->getAllocatedType());
         } else {
           const PointerType* PT = cast<PointerType>(
                                                  cast<Argument>(*I)->getType());
         } else {
           const PointerType* PT = cast<PointerType>(
                                                  cast<Argument>(*I)->getType());
-          pointerSize = TD.getTypePaddedSize(PT->getElementType());
+          pointerSize = TD.getTypeAllocSize(PT->getElementType());
         }
 
         // See if the call site touches it
         }
 
         // See if the call site touches it
@@ -382,10 +382,10 @@ bool DSE::RemoveUndeadPointers(Value* killPointer, uint64_t killPointerSize,
     if (AllocaInst* A = dyn_cast<AllocaInst>(*I)) {
       if (ConstantInt* C = dyn_cast<ConstantInt>(A->getArraySize()))
         pointerSize = C->getZExtValue() *
     if (AllocaInst* A = dyn_cast<AllocaInst>(*I)) {
       if (ConstantInt* C = dyn_cast<ConstantInt>(A->getArraySize()))
         pointerSize = C->getZExtValue() *
-                      TD.getTypePaddedSize(A->getAllocatedType());
+                      TD.getTypeAllocSize(A->getAllocatedType());
     } else {
       const PointerType* PT = cast<PointerType>(cast<Argument>(*I)->getType());
     } else {
       const PointerType* PT = cast<PointerType>(cast<Argument>(*I)->getType());
-      pointerSize = TD.getTypePaddedSize(PT->getElementType());
+      pointerSize = TD.getTypeAllocSize(PT->getElementType());
     }
 
     // See if this pointer could alias it
     }
 
     // See if this pointer could alias it
index b80fc4991afd15ad3b036792c026b68cf9c0d958..c76403e03904594bb4b51be75fbd6c63a52e77b1 100644 (file)
@@ -5202,7 +5202,7 @@ static Value *EmitGEPOffset(User *GEP, Instruction &I, InstCombiner &IC) {
   for (User::op_iterator i = GEP->op_begin() + 1, e = GEP->op_end(); i != e;
        ++i, ++GTI) {
     Value *Op = *i;
   for (User::op_iterator i = GEP->op_begin() + 1, e = GEP->op_end(); i != e;
        ++i, ++GTI) {
     Value *Op = *i;
-    uint64_t Size = TD.getTypePaddedSize(GTI.getIndexedType()) & PtrSizeMask;
+    uint64_t Size = TD.getTypeAllocSize(GTI.getIndexedType()) & PtrSizeMask;
     if (ConstantInt *OpC = dyn_cast<ConstantInt>(Op)) {
       if (OpC->isZero()) continue;
       
     if (ConstantInt *OpC = dyn_cast<ConstantInt>(Op)) {
       if (OpC->isZero()) continue;
       
@@ -5294,7 +5294,7 @@ static Value *EvaluateGEPOffsetExpression(User *GEP, Instruction &I,
       if (const StructType *STy = dyn_cast<StructType>(*GTI)) {
         Offset += TD.getStructLayout(STy)->getElementOffset(CI->getZExtValue());
       } else {
       if (const StructType *STy = dyn_cast<StructType>(*GTI)) {
         Offset += TD.getStructLayout(STy)->getElementOffset(CI->getZExtValue());
       } else {
-        uint64_t Size = TD.getTypePaddedSize(GTI.getIndexedType());
+        uint64_t Size = TD.getTypeAllocSize(GTI.getIndexedType());
         Offset += Size*CI->getSExtValue();
       }
     } else {
         Offset += Size*CI->getSExtValue();
       }
     } else {
@@ -5310,7 +5310,7 @@ static Value *EvaluateGEPOffsetExpression(User *GEP, Instruction &I,
   Value *VariableIdx = GEP->getOperand(i);
   // Determine the scale factor of the variable element.  For example, this is
   // 4 if the variable index is into an array of i32.
   Value *VariableIdx = GEP->getOperand(i);
   // Determine the scale factor of the variable element.  For example, this is
   // 4 if the variable index is into an array of i32.
-  uint64_t VariableScale = TD.getTypePaddedSize(GTI.getIndexedType());
+  uint64_t VariableScale = TD.getTypeAllocSize(GTI.getIndexedType());
   
   // Verify that there are no other variable indices.  If so, emit the hard way.
   for (++i, ++GTI; i != e; ++i, ++GTI) {
   
   // Verify that there are no other variable indices.  If so, emit the hard way.
   for (++i, ++GTI; i != e; ++i, ++GTI) {
@@ -5324,7 +5324,7 @@ static Value *EvaluateGEPOffsetExpression(User *GEP, Instruction &I,
     if (const StructType *STy = dyn_cast<StructType>(*GTI)) {
       Offset += TD.getStructLayout(STy)->getElementOffset(CI->getZExtValue());
     } else {
     if (const StructType *STy = dyn_cast<StructType>(*GTI)) {
       Offset += TD.getStructLayout(STy)->getElementOffset(CI->getZExtValue());
     } else {
-      uint64_t Size = TD.getTypePaddedSize(GTI.getIndexedType());
+      uint64_t Size = TD.getTypeAllocSize(GTI.getIndexedType());
       Offset += Size*CI->getSExtValue();
     }
   }
       Offset += Size*CI->getSExtValue();
     }
   }
@@ -7606,8 +7606,8 @@ Instruction *InstCombiner::PromoteCastOfAllocation(BitCastInst &CI,
   if (!AI.hasOneUse() && !hasOneUsePlusDeclare(&AI) &&
       CastElTyAlign == AllocElTyAlign) return 0;
 
   if (!AI.hasOneUse() && !hasOneUsePlusDeclare(&AI) &&
       CastElTyAlign == AllocElTyAlign) return 0;
 
-  uint64_t AllocElTySize = TD->getTypePaddedSize(AllocElTy);
-  uint64_t CastElTySize = TD->getTypePaddedSize(CastElTy);
+  uint64_t AllocElTySize = TD->getTypeAllocSize(AllocElTy);
+  uint64_t CastElTySize = TD->getTypeAllocSize(CastElTy);
   if (CastElTySize == 0 || AllocElTySize == 0) return 0;
 
   // See if we can satisfy the modulus by pulling a scale out of the array
   if (CastElTySize == 0 || AllocElTySize == 0) return 0;
 
   // See if we can satisfy the modulus by pulling a scale out of the array
@@ -7905,7 +7905,7 @@ static const Type *FindElementAtOffset(const Type *Ty, int64_t Offset,
   // is something like [0 x {int, int}]
   const Type *IntPtrTy = TD->getIntPtrType();
   int64_t FirstIdx = 0;
   // is something like [0 x {int, int}]
   const Type *IntPtrTy = TD->getIntPtrType();
   int64_t FirstIdx = 0;
-  if (int64_t TySize = TD->getTypePaddedSize(Ty)) {
+  if (int64_t TySize = TD->getTypeAllocSize(Ty)) {
     FirstIdx = Offset/TySize;
     Offset -= FirstIdx*TySize;
     
     FirstIdx = Offset/TySize;
     Offset -= FirstIdx*TySize;
     
@@ -7937,7 +7937,7 @@ static const Type *FindElementAtOffset(const Type *Ty, int64_t Offset,
       Offset -= SL->getElementOffset(Elt);
       Ty = STy->getElementType(Elt);
     } else if (const ArrayType *AT = dyn_cast<ArrayType>(Ty)) {
       Offset -= SL->getElementOffset(Elt);
       Ty = STy->getElementType(Elt);
     } else if (const ArrayType *AT = dyn_cast<ArrayType>(Ty)) {
-      uint64_t EltSize = TD->getTypePaddedSize(AT->getElementType());
+      uint64_t EltSize = TD->getTypeAllocSize(AT->getElementType());
       assert(EltSize && "Cannot index into a zero-sized array");
       NewIndices.push_back(ConstantInt::get(IntPtrTy,Offset/EltSize));
       Offset %= EltSize;
       assert(EltSize && "Cannot index into a zero-sized array");
       NewIndices.push_back(ConstantInt::get(IntPtrTy,Offset/EltSize));
       Offset %= EltSize;
@@ -8687,7 +8687,7 @@ Instruction *InstCombiner::visitIntToPtr(IntToPtrInst &CI) {
     // is a single-index GEP.
     if (X->getType() == CI.getType()) {
       // Get the size of the pointee type.
     // is a single-index GEP.
     if (X->getType() == CI.getType()) {
       // Get the size of the pointee type.
-      uint64_t Size = TD->getTypePaddedSize(DestPointee);
+      uint64_t Size = TD->getTypeAllocSize(DestPointee);
 
       // Convert the constant to intptr type.
       APInt Offset = Cst->getValue();
 
       // Convert the constant to intptr type.
       APInt Offset = Cst->getValue();
@@ -8707,7 +8707,7 @@ Instruction *InstCombiner::visitIntToPtr(IntToPtrInst &CI) {
     // "inttoptr+GEP" instead of "add+intptr".
     
     // Get the size of the pointee type.
     // "inttoptr+GEP" instead of "add+intptr".
     
     // Get the size of the pointee type.
-    uint64_t Size = TD->getTypePaddedSize(DestPointee);
+    uint64_t Size = TD->getTypeAllocSize(DestPointee);
     
     // Convert the constant to intptr type.
     APInt Offset = Cst->getValue();
     
     // Convert the constant to intptr type.
     APInt Offset = Cst->getValue();
@@ -9811,7 +9811,7 @@ static bool isSafeToEliminateVarargsCast(const CallSite CS,
   const Type* DstTy = cast<PointerType>(CI->getType())->getElementType();
   if (!SrcTy->isSized() || !DstTy->isSized())
     return false;
   const Type* DstTy = cast<PointerType>(CI->getType())->getElementType();
   if (!SrcTy->isSized() || !DstTy->isSized())
     return false;
-  if (TD->getTypePaddedSize(SrcTy) != TD->getTypePaddedSize(DstTy))
+  if (TD->getTypeAllocSize(SrcTy) != TD->getTypeAllocSize(DstTy))
     return false;
   return true;
 }
     return false;
   return true;
 }
@@ -10966,8 +10966,8 @@ Instruction *InstCombiner::visitGetElementPtrInst(GetElementPtrInst &GEP) {
       const Type *SrcElTy = cast<PointerType>(X->getType())->getElementType();
       const Type *ResElTy=cast<PointerType>(PtrOp->getType())->getElementType();
       if (isa<ArrayType>(SrcElTy) &&
       const Type *SrcElTy = cast<PointerType>(X->getType())->getElementType();
       const Type *ResElTy=cast<PointerType>(PtrOp->getType())->getElementType();
       if (isa<ArrayType>(SrcElTy) &&
-          TD->getTypePaddedSize(cast<ArrayType>(SrcElTy)->getElementType()) ==
-          TD->getTypePaddedSize(ResElTy)) {
+          TD->getTypeAllocSize(cast<ArrayType>(SrcElTy)->getElementType()) ==
+          TD->getTypeAllocSize(ResElTy)) {
         Value *Idx[2];
         Idx[0] = Constant::getNullValue(Type::Int32Ty);
         Idx[1] = GEP.getOperand(1);
         Value *Idx[2];
         Idx[0] = Constant::getNullValue(Type::Int32Ty);
         Idx[1] = GEP.getOperand(1);
@@ -10984,7 +10984,7 @@ Instruction *InstCombiner::visitGetElementPtrInst(GetElementPtrInst &GEP) {
       
       if (isa<ArrayType>(SrcElTy) && ResElTy == Type::Int8Ty) {
         uint64_t ArrayEltSize =
       
       if (isa<ArrayType>(SrcElTy) && ResElTy == Type::Int8Ty) {
         uint64_t ArrayEltSize =
-            TD->getTypePaddedSize(cast<ArrayType>(SrcElTy)->getElementType());
+            TD->getTypeAllocSize(cast<ArrayType>(SrcElTy)->getElementType());
         
         // Check to see if "tmp" is a scale by a multiple of ArrayEltSize.  We
         // allow either a mul, shift, or constant here.
         
         // Check to see if "tmp" is a scale by a multiple of ArrayEltSize.  We
         // allow either a mul, shift, or constant here.
@@ -11137,7 +11137,7 @@ Instruction *InstCombiner::visitAllocationInst(AllocationInst &AI) {
     // If alloca'ing a zero byte object, replace the alloca with a null pointer.
     // Note that we only do this for alloca's, because malloc should allocate
     // and return a unique pointer, even for a zero byte allocation.
     // If alloca'ing a zero byte object, replace the alloca with a null pointer.
     // Note that we only do this for alloca's, because malloc should allocate
     // and return a unique pointer, even for a zero byte allocation.
-    if (TD->getTypePaddedSize(AI.getAllocatedType()) == 0)
+    if (TD->getTypeAllocSize(AI.getAllocatedType()) == 0)
       return ReplaceInstUsesWith(AI, Constant::getNullValue(AI.getType()));
 
     // If the alignment is 0 (unspecified), assign it the preferred alignment.
       return ReplaceInstUsesWith(AI, Constant::getNullValue(AI.getType()));
 
     // If the alignment is 0 (unspecified), assign it the preferred alignment.
index b6c4c45274a2181a49227a2bef70c2e2f58a752c..5cf05183ec0508d2e095e26f3e3fb4d86a4b6518 100644 (file)
@@ -104,7 +104,7 @@ static int64_t GetOffsetFromIndex(const GetElementPtrInst *GEP, unsigned Idx,
     
     // Otherwise, we have a sequential type like an array or vector.  Multiply
     // the index by the ElementSize.
     
     // Otherwise, we have a sequential type like an array or vector.  Multiply
     // the index by the ElementSize.
-    uint64_t Size = TD.getTypePaddedSize(GTI.getIndexedType());
+    uint64_t Size = TD.getTypeAllocSize(GTI.getIndexedType());
     Offset += Size*OpC->getSExtValue();
   }
 
     Offset += Size*OpC->getSExtValue();
   }
 
@@ -511,7 +511,7 @@ bool MemCpyOpt::performCallSlotOptzn(MemCpyInst *cpy, CallInst *C) {
   if (!srcArraySize)
     return false;
 
   if (!srcArraySize)
     return false;
 
-  uint64_t srcSize = TD.getTypePaddedSize(srcAlloca->getAllocatedType()) *
+  uint64_t srcSize = TD.getTypeAllocSize(srcAlloca->getAllocatedType()) *
     srcArraySize->getZExtValue();
 
   if (cpyLength->getZExtValue() < srcSize)
     srcArraySize->getZExtValue();
 
   if (cpyLength->getZExtValue() < srcSize)
@@ -526,7 +526,7 @@ bool MemCpyOpt::performCallSlotOptzn(MemCpyInst *cpy, CallInst *C) {
     if (!destArraySize)
       return false;
 
     if (!destArraySize)
       return false;
 
-    uint64_t destSize = TD.getTypePaddedSize(A->getAllocatedType()) *
+    uint64_t destSize = TD.getTypeAllocSize(A->getAllocatedType()) *
       destArraySize->getZExtValue();
 
     if (destSize < srcSize)
       destArraySize->getZExtValue();
 
     if (destSize < srcSize)
@@ -538,7 +538,7 @@ bool MemCpyOpt::performCallSlotOptzn(MemCpyInst *cpy, CallInst *C) {
       return false;
 
     const Type* StructTy = cast<PointerType>(A->getType())->getElementType();
       return false;
 
     const Type* StructTy = cast<PointerType>(A->getType())->getElementType();
-    uint64_t destSize = TD.getTypePaddedSize(StructTy);
+    uint64_t destSize = TD.getTypeAllocSize(StructTy);
 
     if (destSize < srcSize)
       return false;
 
     if (destSize < srcSize)
       return false;
index db6500c930b2a5106147786d2f34d373d44e6022..5e2859abae48913d4083e36cadd61f495eabfbbd 100644 (file)
@@ -252,7 +252,7 @@ bool SROA::performScalarRepl(Function &F) {
     // transform the allocation instruction if it is an array allocation
     // (allocations OF arrays are ok though), and an allocation of a scalar
     // value cannot be decomposed at all.
     // transform the allocation instruction if it is an array allocation
     // (allocations OF arrays are ok though), and an allocation of a scalar
     // value cannot be decomposed at all.
-    uint64_t AllocaSize = TD->getTypePaddedSize(AI->getAllocatedType());
+    uint64_t AllocaSize = TD->getTypeAllocSize(AI->getAllocatedType());
 
     // Do not promote any struct whose size is too big.
     if (AllocaSize > SRThreshold) continue;
 
     // Do not promote any struct whose size is too big.
     if (AllocaSize > SRThreshold) continue;
@@ -601,7 +601,7 @@ void SROA::isSafeMemIntrinsicOnAllocation(MemIntrinsic *MI, AllocationInst *AI,
   
   // If not the whole aggregate, give up.
   if (Length->getZExtValue() !=
   
   // If not the whole aggregate, give up.
   if (Length->getZExtValue() !=
-      TD->getTypePaddedSize(AI->getType()->getElementType()))
+      TD->getTypeAllocSize(AI->getType()->getElementType()))
     return MarkUnsafe(Info);
   
   // We only know about memcpy/memset/memmove.
     return MarkUnsafe(Info);
   
   // We only know about memcpy/memset/memmove.
@@ -637,8 +637,8 @@ void SROA::isSafeUseOfBitCastedAllocation(BitCastInst *BC, AllocationInst *AI,
       // cast a {i32,i32}* to i64* and store through it.  This is similar to the
       // memcpy case and occurs in various "byval" cases and emulated memcpys.
       if (isa<IntegerType>(SI->getOperand(0)->getType()) &&
       // cast a {i32,i32}* to i64* and store through it.  This is similar to the
       // memcpy case and occurs in various "byval" cases and emulated memcpys.
       if (isa<IntegerType>(SI->getOperand(0)->getType()) &&
-          TD->getTypePaddedSize(SI->getOperand(0)->getType()) ==
-          TD->getTypePaddedSize(AI->getType()->getElementType())) {
+          TD->getTypeAllocSize(SI->getOperand(0)->getType()) ==
+          TD->getTypeAllocSize(AI->getType()->getElementType())) {
         Info.isMemCpyDst = true;
         continue;
       }
         Info.isMemCpyDst = true;
         continue;
       }
@@ -652,8 +652,8 @@ void SROA::isSafeUseOfBitCastedAllocation(BitCastInst *BC, AllocationInst *AI,
       // cast a {i32,i32}* to i64* and load through it.  This is similar to the
       // memcpy case and occurs in various "byval" cases and emulated memcpys.
       if (isa<IntegerType>(LI->getType()) &&
       // cast a {i32,i32}* to i64* and load through it.  This is similar to the
       // memcpy case and occurs in various "byval" cases and emulated memcpys.
       if (isa<IntegerType>(LI->getType()) &&
-          TD->getTypePaddedSize(LI->getType()) ==
-          TD->getTypePaddedSize(AI->getType()->getElementType())) {
+          TD->getTypeAllocSize(LI->getType()) ==
+          TD->getTypeAllocSize(AI->getType()->getElementType())) {
         Info.isMemCpySrc = true;
         continue;
       }
         Info.isMemCpySrc = true;
         continue;
       }
@@ -782,7 +782,7 @@ void SROA::RewriteMemIntrinUserOfAlloca(MemIntrinsic *MI, Instruction *BCInst,
       } else {
         const Type *EltTy =
           cast<SequentialType>(OtherPtr->getType())->getElementType();
       } else {
         const Type *EltTy =
           cast<SequentialType>(OtherPtr->getType())->getElementType();
-        EltOffset = TD->getTypePaddedSize(EltTy)*i;
+        EltOffset = TD->getTypeAllocSize(EltTy)*i;
       }
       
       // The alignment of the other pointer is the guaranteed alignment of the
       }
       
       // The alignment of the other pointer is the guaranteed alignment of the
@@ -865,7 +865,7 @@ void SROA::RewriteMemIntrinUserOfAlloca(MemIntrinsic *MI, Instruction *BCInst,
       OtherElt = new BitCastInst(OtherElt, BytePtrTy,OtherElt->getNameStr(),
                                  MI);
     
       OtherElt = new BitCastInst(OtherElt, BytePtrTy,OtherElt->getNameStr(),
                                  MI);
     
-    unsigned EltSize = TD->getTypePaddedSize(EltTy);
+    unsigned EltSize = TD->getTypeAllocSize(EltTy);
     
     // Finally, insert the meminst for this element.
     if (isa<MemTransferInst>(MI)) {
     
     // Finally, insert the meminst for this element.
     if (isa<MemTransferInst>(MI)) {
@@ -899,7 +899,7 @@ void SROA::RewriteStoreUserOfWholeAlloca(StoreInst *SI,
   // and store the element value to the individual alloca.
   Value *SrcVal = SI->getOperand(0);
   const Type *AllocaEltTy = AI->getType()->getElementType();
   // and store the element value to the individual alloca.
   Value *SrcVal = SI->getOperand(0);
   const Type *AllocaEltTy = AI->getType()->getElementType();
-  uint64_t AllocaSizeBits = TD->getTypePaddedSizeInBits(AllocaEltTy);
+  uint64_t AllocaSizeBits = TD->getTypeAllocSizeInBits(AllocaEltTy);
   
   // If this isn't a store of an integer to the whole alloca, it may be a store
   // to the first element.  Just ignore the store in this case and normal SROA
   
   // If this isn't a store of an integer to the whole alloca, it may be a store
   // to the first element.  Just ignore the store in this case and normal SROA
@@ -922,7 +922,7 @@ void SROA::RewriteStoreUserOfWholeAlloca(StoreInst *SI,
       uint64_t Shift = Layout->getElementOffsetInBits(i);
       
       if (TD->isBigEndian())
       uint64_t Shift = Layout->getElementOffsetInBits(i);
       
       if (TD->isBigEndian())
-        Shift = AllocaSizeBits-Shift-TD->getTypePaddedSizeInBits(FieldTy);
+        Shift = AllocaSizeBits-Shift-TD->getTypeAllocSizeInBits(FieldTy);
       
       Value *EltVal = SrcVal;
       if (Shift) {
       
       Value *EltVal = SrcVal;
       if (Shift) {
@@ -957,7 +957,7 @@ void SROA::RewriteStoreUserOfWholeAlloca(StoreInst *SI,
   } else {
     const ArrayType *ATy = cast<ArrayType>(AllocaEltTy);
     const Type *ArrayEltTy = ATy->getElementType();
   } else {
     const ArrayType *ATy = cast<ArrayType>(AllocaEltTy);
     const Type *ArrayEltTy = ATy->getElementType();
-    uint64_t ElementOffset = TD->getTypePaddedSizeInBits(ArrayEltTy);
+    uint64_t ElementOffset = TD->getTypeAllocSizeInBits(ArrayEltTy);
     uint64_t ElementSizeBits = TD->getTypeSizeInBits(ArrayEltTy);
 
     uint64_t Shift;
     uint64_t ElementSizeBits = TD->getTypeSizeInBits(ArrayEltTy);
 
     uint64_t Shift;
@@ -1012,7 +1012,7 @@ void SROA::RewriteLoadUserOfWholeAlloca(LoadInst *LI, AllocationInst *AI,
   // Extract each element out of the NewElts according to its structure offset
   // and form the result value.
   const Type *AllocaEltTy = AI->getType()->getElementType();
   // Extract each element out of the NewElts according to its structure offset
   // and form the result value.
   const Type *AllocaEltTy = AI->getType()->getElementType();
-  uint64_t AllocaSizeBits = TD->getTypePaddedSizeInBits(AllocaEltTy);
+  uint64_t AllocaSizeBits = TD->getTypeAllocSizeInBits(AllocaEltTy);
   
   // If this isn't a load of the whole alloca to an integer, it may be a load
   // of the first element.  Just ignore the load in this case and normal SROA
   
   // If this isn't a load of the whole alloca to an integer, it may be a load
   // of the first element.  Just ignore the load in this case and normal SROA
@@ -1032,7 +1032,7 @@ void SROA::RewriteLoadUserOfWholeAlloca(LoadInst *LI, AllocationInst *AI,
     Layout = TD->getStructLayout(EltSTy);
   } else {
     const Type *ArrayEltTy = cast<ArrayType>(AllocaEltTy)->getElementType();
     Layout = TD->getStructLayout(EltSTy);
   } else {
     const Type *ArrayEltTy = cast<ArrayType>(AllocaEltTy)->getElementType();
-    ArrayEltBitOffset = TD->getTypePaddedSizeInBits(ArrayEltTy);
+    ArrayEltBitOffset = TD->getTypeAllocSizeInBits(ArrayEltTy);
   }    
     
   Value *ResultVal = Constant::getNullValue(LI->getType());
   }    
     
   Value *ResultVal = Constant::getNullValue(LI->getType());
@@ -1126,7 +1126,7 @@ static bool HasPadding(const Type *Ty, const TargetData &TD) {
   } else if (const VectorType *VTy = dyn_cast<VectorType>(Ty)) {
     return HasPadding(VTy->getElementType(), TD);
   }
   } else if (const VectorType *VTy = dyn_cast<VectorType>(Ty)) {
     return HasPadding(VTy->getElementType(), TD);
   }
-  return TD.getTypeSizeInBits(Ty) != TD.getTypePaddedSizeInBits(Ty);
+  return TD.getTypeSizeInBits(Ty) != TD.getTypeAllocSizeInBits(Ty);
 }
 
 /// isSafeStructAllocaToScalarRepl - Check to see if the specified allocation of
 }
 
 /// isSafeStructAllocaToScalarRepl - Check to see if the specified allocation of
@@ -1527,7 +1527,7 @@ Value *SROA::ConvertScalar_ExtractValue(Value *FromVal, const Type *ToType,
     // Otherwise it must be an element access.
     unsigned Elt = 0;
     if (Offset) {
     // Otherwise it must be an element access.
     unsigned Elt = 0;
     if (Offset) {
-      unsigned EltSize = TD->getTypePaddedSizeInBits(VTy->getElementType());
+      unsigned EltSize = TD->getTypeAllocSizeInBits(VTy->getElementType());
       Elt = Offset/EltSize;
       assert(EltSize*Elt == Offset && "Invalid modulus in validity checking");
     }
       Elt = Offset/EltSize;
       assert(EltSize*Elt == Offset && "Invalid modulus in validity checking");
     }
@@ -1555,7 +1555,7 @@ Value *SROA::ConvertScalar_ExtractValue(Value *FromVal, const Type *ToType,
   }
   
   if (const ArrayType *AT = dyn_cast<ArrayType>(ToType)) {
   }
   
   if (const ArrayType *AT = dyn_cast<ArrayType>(ToType)) {
-    uint64_t EltSize = TD->getTypePaddedSizeInBits(AT->getElementType());
+    uint64_t EltSize = TD->getTypeAllocSizeInBits(AT->getElementType());
     Value *Res = UndefValue::get(AT);
     for (unsigned i = 0, e = AT->getNumElements(); i != e; ++i) {
       Value *Elt = ConvertScalar_ExtractValue(FromVal, AT->getElementType(),
     Value *Res = UndefValue::get(AT);
     for (unsigned i = 0, e = AT->getNumElements(); i != e; ++i) {
       Value *Elt = ConvertScalar_ExtractValue(FromVal, AT->getElementType(),
@@ -1630,15 +1630,15 @@ Value *SROA::ConvertScalar_InsertValue(Value *SV, Value *Old,
   const Type *AllocaType = Old->getType();
 
   if (const VectorType *VTy = dyn_cast<VectorType>(AllocaType)) {
   const Type *AllocaType = Old->getType();
 
   if (const VectorType *VTy = dyn_cast<VectorType>(AllocaType)) {
-    uint64_t VecSize = TD->getTypePaddedSizeInBits(VTy);
-    uint64_t ValSize = TD->getTypePaddedSizeInBits(SV->getType());
+    uint64_t VecSize = TD->getTypeAllocSizeInBits(VTy);
+    uint64_t ValSize = TD->getTypeAllocSizeInBits(SV->getType());
     
     // Changing the whole vector with memset or with an access of a different
     // vector type?
     if (ValSize == VecSize)
       return Builder.CreateBitCast(SV, AllocaType, "tmp");
 
     
     // Changing the whole vector with memset or with an access of a different
     // vector type?
     if (ValSize == VecSize)
       return Builder.CreateBitCast(SV, AllocaType, "tmp");
 
-    uint64_t EltSize = TD->getTypePaddedSizeInBits(VTy->getElementType());
+    uint64_t EltSize = TD->getTypeAllocSizeInBits(VTy->getElementType());
 
     // Must be an element insertion.
     unsigned Elt = Offset/EltSize;
 
     // Must be an element insertion.
     unsigned Elt = Offset/EltSize;
@@ -1665,7 +1665,7 @@ Value *SROA::ConvertScalar_InsertValue(Value *SV, Value *Old,
   }
   
   if (const ArrayType *AT = dyn_cast<ArrayType>(SV->getType())) {
   }
   
   if (const ArrayType *AT = dyn_cast<ArrayType>(SV->getType())) {
-    uint64_t EltSize = TD->getTypePaddedSizeInBits(AT->getElementType());
+    uint64_t EltSize = TD->getTypeAllocSizeInBits(AT->getElementType());
     for (unsigned i = 0, e = AT->getNumElements(); i != e; ++i) {
       Value *Elt = Builder.CreateExtractValue(SV, i, "tmp");
       Old = ConvertScalar_InsertValue(Elt, Old, Offset+i*EltSize, Builder);
     for (unsigned i = 0, e = AT->getNumElements(); i != e; ++i) {
       Value *Elt = Builder.CreateExtractValue(SV, i, "tmp");
       Old = ConvertScalar_InsertValue(Elt, Old, Offset+i*EltSize, Builder);
index 7042144e7a79cd7a3f4229f999a90873695ea160..b820dd3f8d580af32d60c28046273f4a2b4564fb 100644 (file)
@@ -225,7 +225,7 @@ bool AddressingModeMatcher::MatchOperationAddr(User *AddrInst, unsigned Opcode,
           cast<ConstantInt>(AddrInst->getOperand(i))->getZExtValue();
         ConstantOffset += SL->getElementOffset(Idx);
       } else {
           cast<ConstantInt>(AddrInst->getOperand(i))->getZExtValue();
         ConstantOffset += SL->getElementOffset(Idx);
       } else {
-        uint64_t TypeSize = TD->getTypePaddedSize(GTI.getIndexedType());
+        uint64_t TypeSize = TD->getTypeAllocSize(GTI.getIndexedType());
         if (ConstantInt *CI = dyn_cast<ConstantInt>(AddrInst->getOperand(i))) {
           ConstantOffset += CI->getSExtValue()*TypeSize;
         } else if (TypeSize) {  // Scales of zero don't do anything.
         if (ConstantInt *CI = dyn_cast<ConstantInt>(AddrInst->getOperand(i))) {
           ConstantOffset += CI->getSExtValue()*TypeSize;
         } else if (TypeSize) {  // Scales of zero don't do anything.
index 9a7f36692fd32cc810663acdee0b561d049391c1..32498958e34f5b8fcbbb835a182ec61b0e36c7d0 100644 (file)
@@ -116,7 +116,7 @@ bool LowerAllocations::runOnBasicBlock(BasicBlock &BB) {
       Value *MallocArg;
       if (LowerMallocArgToInteger)
         MallocArg = ConstantInt::get(Type::Int64Ty,
       Value *MallocArg;
       if (LowerMallocArgToInteger)
         MallocArg = ConstantInt::get(Type::Int64Ty,
-                                     TD.getTypePaddedSize(AllocTy));
+                                     TD.getTypeAllocSize(AllocTy));
       else
         MallocArg = ConstantExpr::getSizeOf(AllocTy);
       MallocArg = ConstantExpr::getTruncOrBitCast(cast<Constant>(MallocArg), 
       else
         MallocArg = ConstantExpr::getSizeOf(AllocTy);
       MallocArg = ConstantExpr::getTruncOrBitCast(cast<Constant>(MallocArg), 
index 211ded4d9d109e2a214b4a2c5272839a917295b0..c1f87014335f733534b792aa09195bfeca307b12 100644 (file)
@@ -163,7 +163,7 @@ void CallingConvEmitter::EmitAction(Record *Action,
         O << Size << ", ";
       else
         O << "\n" << IndentStr << "  State.getTarget().getTargetData()"
         O << Size << ", ";
       else
         O << "\n" << IndentStr << "  State.getTarget().getTargetData()"
-          "->getTypePaddedSize(LocVT.getTypeForMVT()), ";
+          "->getTypeAllocSize(LocVT.getTypeForMVT()), ";
       if (Align)
         O << Align;
       else
       if (Align)
         O << Align;
       else