[llvm-commits] [llvm] r43688 - in /llvm/trunk: include/llvm/CodeGen/ include/llvm/Target/ lib/CodeGen/ lib/Target/ARM/ lib/Target/Alpha/ lib/Target/IA64/ lib/Target/MSIL/ lib/Target/Mips/ lib/Target/PowerPC/ lib/Target/Sparc/ lib/Target/X86/

Duncan Sands baldrick at free.fr
Sun Nov 4 16:04:44 PST 2007


Author: baldrick
Date: Sun Nov  4 18:04:43 2007
New Revision: 43688

URL: http://llvm.org/viewvc/llvm-project?rev=43688&view=rev
Log:
Eliminate the remaining uses of getTypeSize.  This
should only effect x86 when using long double.  Now
12/16 bytes are output for long double globals (the
exact amount depends on the alignment).  This brings
globals in line with the rest of LLVM: the space
reserved for an object is now always the ABI size.
One tricky point is that only 10 bytes should be
output for long double if it is a field in a packed
struct, which is the reason for the additional
argument to EmitGlobalConstant.

Modified:
    llvm/trunk/include/llvm/CodeGen/AsmPrinter.h
    llvm/trunk/include/llvm/Target/TargetData.h
    llvm/trunk/lib/CodeGen/AsmPrinter.cpp
    llvm/trunk/lib/CodeGen/ELFWriter.cpp
    llvm/trunk/lib/CodeGen/MachOWriter.cpp
    llvm/trunk/lib/CodeGen/MachOWriter.h
    llvm/trunk/lib/CodeGen/MachineFunction.cpp
    llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp
    llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp
    llvm/trunk/lib/Target/Alpha/AlphaAsmPrinter.cpp
    llvm/trunk/lib/Target/IA64/IA64AsmPrinter.cpp
    llvm/trunk/lib/Target/MSIL/MSILWriter.cpp
    llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp
    llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp
    llvm/trunk/lib/Target/Sparc/SparcAsmPrinter.cpp
    llvm/trunk/lib/Target/X86/X86AsmPrinter.cpp

Modified: llvm/trunk/include/llvm/CodeGen/AsmPrinter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/AsmPrinter.h?rev=43688&r1=43687&r2=43688&view=diff

==============================================================================
--- llvm/trunk/include/llvm/CodeGen/AsmPrinter.h (original)
+++ llvm/trunk/include/llvm/CodeGen/AsmPrinter.h Sun Nov  4 18:04:43 2007
@@ -286,8 +286,8 @@
     void EmitConstantValueOnly(const Constant *CV);
 
     /// EmitGlobalConstant - Print a general LLVM constant to the .s file.
-    ///
-    void EmitGlobalConstant(const Constant* CV);
+    /// If Packed is false, pad to the ABI size.
+    void EmitGlobalConstant(const Constant* CV, bool Packed = false);
 
     virtual void EmitMachineConstantPoolValue(MachineConstantPoolValue *MCPV);
     

Modified: llvm/trunk/include/llvm/Target/TargetData.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetData.h?rev=43688&r1=43687&r2=43688&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Target/TargetData.h (original)
+++ llvm/trunk/include/llvm/Target/TargetData.h Sun Nov  4 18:04:43 2007
@@ -190,14 +190,6 @@
     return 8*getABITypeSize(Ty);
   }
 
-  /// getTypeSize - Obsolete method, do not use.  Replaced by getTypeStoreSize
-  /// and getABITypeSize.  For alias analysis of loads and stores you probably
-  /// want getTypeStoreSize.  Use getABITypeSize for GEP computations and alloca
-  /// sizing.
-  uint64_t getTypeSize(const Type *Ty) const {
-    return getTypeStoreSize(Ty);
-  }
-
   /// getABITypeAlignment - Return the minimum ABI-required alignment for the
   /// specified type.
   unsigned char getABITypeAlignment(const Type *Ty) const;

Modified: llvm/trunk/lib/CodeGen/AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter.cpp?rev=43688&r1=43687&r2=43688&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter.cpp Sun Nov  4 18:04:43 2007
@@ -192,13 +192,13 @@
     MachineConstantPoolEntry CPE = CP[i];
     const Type *Ty = CPE.getType();
     if (TAI->getFourByteConstantSection() &&
-        TM.getTargetData()->getTypeSize(Ty) == 4)
+        TM.getTargetData()->getABITypeSize(Ty) == 4)
       FourByteCPs.push_back(std::make_pair(CPE, i));
     else if (TAI->getEightByteConstantSection() &&
-             TM.getTargetData()->getTypeSize(Ty) == 8)
+             TM.getTargetData()->getABITypeSize(Ty) == 8)
       EightByteCPs.push_back(std::make_pair(CPE, i));
     else if (TAI->getSixteenByteConstantSection() &&
-             TM.getTargetData()->getTypeSize(Ty) == 16)
+             TM.getTargetData()->getABITypeSize(Ty) == 16)
       SixteenByteCPs.push_back(std::make_pair(CPE, i));
     else
       OtherCPs.push_back(std::make_pair(CPE, i));
@@ -229,7 +229,7 @@
     if (i != e-1) {
       const Type *Ty = CP[i].first.getType();
       unsigned EntSize =
-        TM.getTargetData()->getTypeSize(Ty);
+        TM.getTargetData()->getABITypeSize(Ty);
       unsigned ValEnd = CP[i].first.getOffset() + EntSize;
       // Emit inter-object padding for alignment.
       EmitZeros(CP[i+1].first.getOffset()-ValEnd);
@@ -750,7 +750,7 @@
       // 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 (Ty->isInteger() &&
-          TD->getTypeSize(Ty) >= TD->getTypeSize(Op->getType()))
+          TD->getABITypeSize(Ty) >= TD->getABITypeSize(Op->getType()))
         return EmitConstantValueOnly(Op);
       
       assert(0 && "FIXME: Don't yet support this kind of constant cast expr");
@@ -805,23 +805,21 @@
 }
 
 /// EmitGlobalConstant - Print a general LLVM constant to the .s file.
-///
-void AsmPrinter::EmitGlobalConstant(const Constant *CV) {
+/// If Packed is false, pad to the ABI size.
+void AsmPrinter::EmitGlobalConstant(const Constant *CV, bool Packed) {
   const TargetData *TD = TM.getTargetData();
+  unsigned Size = Packed ?
+    TD->getTypeStoreSize(CV->getType()) : TD->getABITypeSize(CV->getType());
 
   if (CV->isNullValue() || isa<UndefValue>(CV)) {
-    EmitZeros(TD->getTypeSize(CV->getType()));
+    EmitZeros(Size);
     return;
   } else if (const ConstantArray *CVA = dyn_cast<ConstantArray>(CV)) {
     if (CVA->isString()) {
       EmitString(CVA);
     } else { // Not a string.  Print the values in successive locations
-      for (unsigned i = 0, e = CVA->getNumOperands(); i != e; ++i) {
-        EmitGlobalConstant(CVA->getOperand(i));
-        const Type* EltTy = CVA->getType()->getElementType();
-        uint64_t padSize = TD->getABITypeSize(EltTy) - TD->getTypeSize(EltTy);
-        EmitZeros(padSize);
-      }
+      for (unsigned i = 0, e = CVA->getNumOperands(); i != e; ++i)
+        EmitGlobalConstant(CVA->getOperand(i), false);
     }
     return;
   } else if (const ConstantStruct *CVS = dyn_cast<ConstantStruct>(CV)) {
@@ -832,14 +830,14 @@
       const Constant* field = CVS->getOperand(i);
 
       // Check if padding is needed and insert one or more 0s.
-      uint64_t fieldSize = TD->getTypeSize(field->getType());
+      uint64_t fieldSize = TD->getTypeStoreSize(field->getType());
       uint64_t padSize = ((i == e-1? cvsLayout->getSizeInBytes()
                            : cvsLayout->getElementOffset(i+1))
                           - cvsLayout->getElementOffset(i)) - fieldSize;
       sizeSoFar += fieldSize + padSize;
 
       // Now print the actual field value
-      EmitGlobalConstant(field);
+      EmitGlobalConstant(field, CVS->getType()->isPacked());
 
       // Insert the field padding unless it's zero bytes...
       EmitZeros(padSize);
@@ -916,6 +914,7 @@
           << "\t" << TAI->getCommentString()
           << " long double most significant halfword\n";
       }
+      EmitZeros(Size - TD->getTypeStoreSize(Type::X86_FP80Ty));
       return;
     } else if (CFP->getType() == Type::PPC_FP128Ty) {
       // all long double variants are printed as hex
@@ -978,7 +977,7 @@
     const VectorType *PTy = CP->getType();
     
     for (unsigned I = 0, E = PTy->getNumElements(); I < E; ++I)
-      EmitGlobalConstant(CP->getOperand(I));
+      EmitGlobalConstant(CP->getOperand(I), false);
     
     return;
   }

Modified: llvm/trunk/lib/CodeGen/ELFWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ELFWriter.cpp?rev=43688&r1=43687&r2=43688&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/ELFWriter.cpp (original)
+++ llvm/trunk/lib/CodeGen/ELFWriter.cpp Sun Nov  4 18:04:43 2007
@@ -258,7 +258,7 @@
 
   const Type *GVType = (const Type*)GV->getType();
   unsigned Align = TM.getTargetData()->getPrefTypeAlignment(GVType);
-  unsigned Size  = TM.getTargetData()->getTypeSize(GVType);
+  unsigned Size  = TM.getTargetData()->getABITypeSize(GVType);
 
   // If this global has a zero initializer, it is part of the .bss or common
   // section.

Modified: llvm/trunk/lib/CodeGen/MachOWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachOWriter.cpp?rev=43688&r1=43687&r2=43688&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/MachOWriter.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachOWriter.cpp Sun Nov  4 18:04:43 2007
@@ -259,7 +259,7 @@
   // "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()->getTypeSize(Ty);
+    unsigned Size = TM.getTargetData()->getABITypeSize(Ty);
 
     MachOWriter::MachOSection *Sec = MOW.getConstSection(CP[i].Val.ConstVal);
     OutputBuffer SecDataOut(Sec->SectionData, is64Bit, isLittleEndian);
@@ -333,7 +333,7 @@
 
 void MachOWriter::AddSymbolToSection(MachOSection *Sec, GlobalVariable *GV) {
   const Type *Ty = GV->getType()->getElementType();
-  unsigned Size = TM.getTargetData()->getTypeSize(Ty);
+  unsigned Size = TM.getTargetData()->getABITypeSize(Ty);
   unsigned Align = GV->getAlignment();
   if (Align == 0)
     Align = TM.getTargetData()->getPrefTypeAlignment(Ty);
@@ -380,7 +380,7 @@
 
 void MachOWriter::EmitGlobal(GlobalVariable *GV) {
   const Type *Ty = GV->getType()->getElementType();
-  unsigned Size = TM.getTargetData()->getTypeSize(Ty);
+  unsigned Size = TM.getTargetData()->getABITypeSize(Ty);
   bool NoInit = !GV->hasInitializer();
   
   // If this global has a zero initializer, it is part of the .bss or common
@@ -803,7 +803,8 @@
     if (isa<UndefValue>(PC)) {
       continue;
     } else if (const ConstantVector *CP = dyn_cast<ConstantVector>(PC)) {
-      unsigned ElementSize = TD->getTypeSize(CP->getType()->getElementType());
+      unsigned ElementSize =
+        TD->getABITypeSize(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)) {
@@ -904,9 +905,10 @@
         abort();
       }
     } else if (isa<ConstantAggregateZero>(PC)) {
-      memset((void*)PA, 0, (size_t)TD->getTypeSize(PC->getType()));
+      memset((void*)PA, 0, (size_t)TD->getABITypeSize(PC->getType()));
     } else if (const ConstantArray *CPA = dyn_cast<ConstantArray>(PC)) {
-      unsigned ElementSize = TD->getTypeSize(CPA->getType()->getElementType());
+      unsigned ElementSize =
+        TD->getABITypeSize(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)) {

Modified: llvm/trunk/lib/CodeGen/MachOWriter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachOWriter.h?rev=43688&r1=43687&r2=43688&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/MachOWriter.h (original)
+++ llvm/trunk/lib/CodeGen/MachOWriter.h Sun Nov  4 18:04:43 2007
@@ -466,7 +466,7 @@
       
       const Type *Ty = C->getType();
       if (Ty->isPrimitiveType() || Ty->isInteger()) {
-        unsigned Size = TM.getTargetData()->getTypeSize(Ty);
+        unsigned Size = TM.getTargetData()->getABITypeSize(Ty);
         switch(Size) {
         default: break; // Fall through to __TEXT,__const
         case 4:

Modified: llvm/trunk/lib/CodeGen/MachineFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineFunction.cpp?rev=43688&r1=43687&r2=43688&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/MachineFunction.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineFunction.cpp Sun Nov  4 18:04:43 2007
@@ -435,7 +435,7 @@
   unsigned Offset = 0;
   if (!Constants.empty()) {
     Offset = Constants.back().getOffset();
-    Offset += TD->getTypeSize(Constants.back().getType());
+    Offset += TD->getABITypeSize(Constants.back().getType());
     Offset = (Offset+AlignMask)&~AlignMask;
   }
   
@@ -459,7 +459,7 @@
   unsigned Offset = 0;
   if (!Constants.empty()) {
     Offset = Constants.back().getOffset();
-    Offset += TD->getTypeSize(Constants.back().getType());
+    Offset += TD->getABITypeSize(Constants.back().getType());
     Offset = (Offset+AlignMask)&~AlignMask;
   }
   

Modified: llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp?rev=43688&r1=43687&r2=43688&view=diff

==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp Sun Nov  4 18:04:43 2007
@@ -821,7 +821,7 @@
     std::string name = Mang->getValueName(I);
     Constant *C = I->getInitializer();
     const Type *Type = C->getType();
-    unsigned Size = TD->getTypeSize(Type);
+    unsigned Size = TD->getABITypeSize(Type);
     unsigned Align = TD->getPreferredAlignmentLog(I);
 
     const char *VisibilityDirective = NULL;

Modified: llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp?rev=43688&r1=43687&r2=43688&view=diff

==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp Sun Nov  4 18:04:43 2007
@@ -298,7 +298,7 @@
   
   const TargetData &TD = *Fn.getTarget().getTargetData();
   for (unsigned i = 0, e = CPs.size(); i != e; ++i) {
-    unsigned Size = TD.getTypeSize(CPs[i].getType());
+    unsigned Size = TD.getABITypeSize(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.

Modified: llvm/trunk/lib/Target/Alpha/AlphaAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AlphaAsmPrinter.cpp?rev=43688&r1=43687&r2=43688&view=diff

==============================================================================
--- llvm/trunk/lib/Target/Alpha/AlphaAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/Alpha/AlphaAsmPrinter.cpp Sun Nov  4 18:04:43 2007
@@ -214,7 +214,7 @@
     
     std::string name = Mang->getValueName(I);
     Constant *C = I->getInitializer();
-    unsigned Size = TD->getTypeSize(C->getType());
+    unsigned Size = TD->getABITypeSize(C->getType());
     unsigned Align = TD->getPreferredAlignmentLog(I);
     
     //1: hidden?

Modified: llvm/trunk/lib/Target/IA64/IA64AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/IA64/IA64AsmPrinter.cpp?rev=43688&r1=43687&r2=43688&view=diff

==============================================================================
--- llvm/trunk/lib/Target/IA64/IA64AsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/IA64/IA64AsmPrinter.cpp Sun Nov  4 18:04:43 2007
@@ -271,7 +271,7 @@
       O << "\n\n";
       std::string name = Mang->getValueName(I);
       Constant *C = I->getInitializer();
-      unsigned Size = TD->getTypeSize(C->getType());
+      unsigned Size = TD->getABITypeSize(C->getType());
       unsigned Align = TD->getPreferredTypeAlignmentShift(C->getType());
       
       if (C->isNullValue() &&
@@ -279,11 +279,11 @@
            I->hasWeakLinkage() /* FIXME: Verify correct */)) {
         SwitchToDataSection(".data", I);
         if (I->hasInternalLinkage()) {
-          O << "\t.lcomm " << name << "#," << TD->getTypeSize(C->getType())
+          O << "\t.lcomm " << name << "#," << TD->getABITypeSize(C->getType())
           << "," << (1 << Align);
           O << "\n";
         } else {
-          O << "\t.common " << name << "#," << TD->getTypeSize(C->getType())
+          O << "\t.common " << name << "#," << TD->getABITypeSize(C->getType())
           << "," << (1 << Align);
           O << "\n";
         }

Modified: llvm/trunk/lib/Target/MSIL/MSILWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MSIL/MSILWriter.cpp?rev=43688&r1=43687&r2=43688&view=diff

==============================================================================
--- llvm/trunk/lib/Target/MSIL/MSILWriter.cpp (original)
+++ llvm/trunk/lib/Target/MSIL/MSILWriter.cpp Sun Nov  4 18:04:43 2007
@@ -368,7 +368,7 @@
   case Type::DoubleTyID:
     return "r8";
   case Type::PointerTyID:
-    return "i"+utostr(TD->getTypeSize(Ty));
+    return "i"+utostr(TD->getABITypeSize(Ty));
   default:
     cerr << "TypeID = " << Ty->getTypeID() << '\n';
     assert(0 && "Invalid type in TypeToPostfix()");
@@ -677,14 +677,14 @@
       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->getTypeSize(StrucTy->getContainedType((unsigned)F));
+        Size += TD->getABITypeSize(StrucTy->getContainedType((unsigned)F));
       printPtrLoad(Size);
       printSimpleInstruction("add");
       continue;
     } else if (const SequentialType* SeqTy = dyn_cast<SequentialType>(*I)) {
-      Size = TD->getTypeSize(SeqTy->getElementType());
+      Size = TD->getABITypeSize(SeqTy->getElementType());
     } else {
-      Size = TD->getTypeSize(*I);
+      Size = TD->getABITypeSize(*I);
     }
     // Add offset of current element to stack top.
     if (!isZeroValue(IndexValue)) {
@@ -1008,7 +1008,7 @@
 
 
 void MSILWriter::printAllocaInstruction(const AllocaInst* Inst) {
-  uint64_t Size = TD->getTypeSize(Inst->getAllocatedType());
+  uint64_t Size = TD->getABITypeSize(Inst->getAllocatedType());
   // Constant optimization.
   if (const ConstantInt* CInt = dyn_cast<ConstantInt>(Inst->getOperand(0))) {
     printPtrLoad(CInt->getZExtValue()*Size);
@@ -1426,7 +1426,7 @@
     // Print not duplicated type
     if (Printed.insert(Ty).second) {
       Out << ".class value explicit ansi sealed '" << Name << "'";
-      Out << " { .pack " << 1 << " .size " << TD->getTypeSize(Ty) << " }\n\n";
+      Out << " { .pack " << 1 << " .size " << TD->getABITypeSize(Ty)<< " }\n\n";
     }
   }
 }
@@ -1454,7 +1454,7 @@
   const Type* Ty = C->getType();
   // Print zero initialized constant.
   if (isa<ConstantAggregateZero>(C) || C->isNullValue()) {
-    TySize = TD->getTypeSize(C->getType());
+    TySize = TD->getABITypeSize(C->getType());
     Offset += TySize;
     Out << "int8 (0) [" << TySize << "]";
     return;
@@ -1462,14 +1462,14 @@
   // Print constant initializer
   switch (Ty->getTypeID()) {
   case Type::IntegerTyID: {
-    TySize = TD->getTypeSize(Ty);
+    TySize = TD->getABITypeSize(Ty);
     const ConstantInt* Int = cast<ConstantInt>(C);
     Out << getPrimitiveTypeName(Ty,true) << "(" << Int->getSExtValue() << ")";
     break;
   }
   case Type::FloatTyID:
   case Type::DoubleTyID: {
-    TySize = TD->getTypeSize(Ty);
+    TySize = TD->getABITypeSize(Ty);
     const ConstantFP* FP = cast<ConstantFP>(C);
     if (Ty->getTypeID() == Type::FloatTyID)
       Out << "int32 (" << 
@@ -1488,7 +1488,7 @@
     }
     break;
   case Type::PointerTyID:
-    TySize = TD->getTypeSize(C->getType());
+    TySize = TD->getABITypeSize(C->getType());
     // Initialize with global variable address
     if (const GlobalVariable *G = dyn_cast<GlobalVariable>(C)) {
       std::string name = getValueName(G);

Modified: llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp?rev=43688&r1=43687&r2=43688&view=diff

==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp Sun Nov  4 18:04:43 2007
@@ -419,7 +419,7 @@
       O << "\n\n";
       std::string name = Mang->getValueName(I);
       Constant *C      = I->getInitializer();
-      unsigned Size    = TD->getTypeSize(C->getType());
+      unsigned Size    = TD->getABITypeSize(C->getType());
       unsigned Align   = TD->getPrefTypeAlignment(C->getType());
 
       if (C->isNullValue() && (I->hasLinkOnceLinkage() || 
@@ -431,7 +431,7 @@
           O << "\t.local " << name << "\n";
 
         O << "\t.comm " << name << "," 
-          << TD->getTypeSize(C->getType()) 
+          << TD->getABITypeSize(C->getType())
           << "," << Align << "\n";
 
       } else {

Modified: llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp?rev=43688&r1=43687&r2=43688&view=diff

==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp Sun Nov  4 18:04:43 2007
@@ -657,7 +657,7 @@
         O << Directive << name << "\n";
     
     Constant *C = I->getInitializer();
-    unsigned Size = TD->getTypeSize(C->getType());
+    unsigned Size = TD->getABITypeSize(C->getType());
     unsigned Align = TD->getPreferredAlignmentLog(I);
 
     if (C->isNullValue() && /* FIXME: Verify correct */
@@ -909,7 +909,7 @@
     
     Constant *C = I->getInitializer();
     const Type *Type = C->getType();
-    unsigned Size = TD->getTypeSize(Type);
+    unsigned Size = TD->getABITypeSize(Type);
     unsigned Align = TD->getPreferredAlignmentLog(I);
 
     if (C->isNullValue() && /* FIXME: Verify correct */

Modified: llvm/trunk/lib/Target/Sparc/SparcAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcAsmPrinter.cpp?rev=43688&r1=43687&r2=43688&view=diff

==============================================================================
--- llvm/trunk/lib/Target/Sparc/SparcAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/Sparc/SparcAsmPrinter.cpp Sun Nov  4 18:04:43 2007
@@ -228,7 +228,7 @@
       O << "\n\n";
       std::string name = Mang->getValueName(I);
       Constant *C = I->getInitializer();
-      unsigned Size = TD->getTypeSize(C->getType());
+      unsigned Size = TD->getABITypeSize(C->getType());
       unsigned Align = TD->getPrefTypeAlignment(C->getType());
 
       if (C->isNullValue() &&
@@ -238,7 +238,7 @@
         if (I->hasInternalLinkage())
           O << "\t.local " << name << "\n";
 
-        O << "\t.comm " << name << "," << TD->getTypeSize(C->getType())
+        O << "\t.comm " << name << "," << TD->getABITypeSize(C->getType())
           << "," << Align;
         O << "\n";
       } else {

Modified: llvm/trunk/lib/Target/X86/X86AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86AsmPrinter.cpp?rev=43688&r1=43687&r2=43688&view=diff

==============================================================================
--- llvm/trunk/lib/Target/X86/X86AsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86AsmPrinter.cpp Sun Nov  4 18:04:43 2007
@@ -51,7 +51,7 @@
   for (Function::const_arg_iterator AI = F->arg_begin(), AE = F->arg_end();
        AI != AE; ++AI)
     // Size should be aligned to DWORD boundary
-    Size += ((TD->getTypeSize(AI->getType()) + 3)/4)*4;
+    Size += ((TD->getABITypeSize(AI->getType()) + 3)/4)*4;
   
   // We're not supporting tooooo huge arguments :)
   Info.setBytesToPopOnReturn((unsigned int)Size);
@@ -156,7 +156,7 @@
     std::string name = Mang->getValueName(I);
     Constant *C = I->getInitializer();
     const Type *Type = C->getType();
-    unsigned Size = TD->getTypeSize(Type);
+    unsigned Size = TD->getABITypeSize(Type);
     unsigned Align = TD->getPreferredAlignmentLog(I);
 
     if (I->hasHiddenVisibility()) {





More information about the llvm-commits mailing list