]> granicus.if.org Git - clang/commitdiff
(LLVM up) Match TargetData API change in LLVM TOT.
authorDaniel Dunbar <daniel@zuster.org>
Mon, 12 Jan 2009 21:08:18 +0000 (21:08 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Mon, 12 Jan 2009 21:08:18 +0000 (21:08 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62101 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGExprConstant.cpp
lib/CodeGen/CGObjCGNU.cpp
lib/CodeGen/CGObjCMac.cpp
lib/CodeGen/CodeGenTypes.cpp

index 71216a5d63d4fc1c51785b6d9536aaa97c3bf376..41875522ed1a22832a5aca69b71b8c602897b222 100644 (file)
@@ -238,7 +238,7 @@ public:
 
     if (curField->isBitField()) {
       // Create a dummy struct for bit-field insertion
-      unsigned NumElts = CGM.getTargetData().getABITypeSize(Ty) / 8;
+      unsigned NumElts = CGM.getTargetData().getTypePaddedSize(Ty) / 8;
       llvm::Constant* NV = llvm::Constant::getNullValue(llvm::Type::Int8Ty);
       std::vector<llvm::Constant*> Elts(NumElts, NV);
 
index 0bf3c2d1b99bfc916e5d463f7e6362f7e322f7ea..2621a8491406e4c39178add515f9326a522f2f90 100644 (file)
@@ -698,7 +698,7 @@ void CGObjCGNU::GenerateClass(const ObjCImplementationDecl *OID) {
   const llvm::Type *ObjTy = 0;
   if (!LateBoundIVars()) {
     ObjTy = CGM.getTypes().ConvertType(Context.getObjCInterfaceType(ClassDecl));
-    instanceSize = CGM.getTargetData().getABITypeSize(ObjTy);
+    instanceSize = CGM.getTargetData().getTypePaddedSize(ObjTy);
   } else {
     // This is required by newer ObjC runtimes.
     assert(0 && "Late-bound instance variables not yet supported");
index df4b2a1999d81990fb8bac1bcfa65981f5638cb8..c587ab823039d95f14a82bbcd85eaa24610bbdad 100644 (file)
@@ -767,7 +767,7 @@ CGObjCMac::EmitProtocolExtension(const ObjCProtocolDecl *PD,
                                  const ConstantVector &OptInstanceMethods,
                                  const ConstantVector &OptClassMethods) {
   uint64_t Size = 
-    CGM.getTargetData().getABITypeSize(ObjCTypes.ProtocolExtensionTy);
+    CGM.getTargetData().getTypePaddedSize(ObjCTypes.ProtocolExtensionTy);
   std::vector<llvm::Constant*> Values(4);
   Values[0] = llvm::ConstantInt::get(ObjCTypes.IntTy, Size);
   Values[1] = 
@@ -876,7 +876,7 @@ llvm::Constant *CGObjCMac::EmitPropertyList(const std::string &Name,
     return llvm::Constant::getNullValue(ObjCTypes.PropertyListPtrTy);
 
   unsigned PropertySize = 
-    CGM.getTargetData().getABITypeSize(ObjCTypes.PropertyTy);
+    CGM.getTargetData().getTypePaddedSize(ObjCTypes.PropertyTy);
   std::vector<llvm::Constant*> Values(3);
   Values[0] = llvm::ConstantInt::get(ObjCTypes.IntTy, PropertySize);
   Values[1] = llvm::ConstantInt::get(ObjCTypes.IntTy, Properties.size());
@@ -950,7 +950,7 @@ llvm::Constant *CGObjCMac::EmitMethodDescList(const std::string &Name,
   };
  */
 void CGObjCMac::GenerateCategory(const ObjCCategoryImplDecl *OCD) {
-  unsigned Size = CGM.getTargetData().getABITypeSize(ObjCTypes.CategoryTy);
+  unsigned Size = CGM.getTargetData().getTypePaddedSize(ObjCTypes.CategoryTy);
 
   // FIXME: This is poor design, the OCD should have a pointer to the
   // category decl. Additionally, note that Category can be null for
@@ -1082,7 +1082,7 @@ void CGObjCMac::GenerateClass(const ObjCImplementationDecl *ID) {
   const llvm::Type *InterfaceTy = 
    CGM.getTypes().ConvertType(CGM.getContext().getObjCInterfaceType(Interface));
   unsigned Flags = eClassFlags_Factory;
-  unsigned Size = CGM.getTargetData().getABITypeSize(InterfaceTy);
+  unsigned Size = CGM.getTargetData().getTypePaddedSize(InterfaceTy);
 
   // FIXME: Set CXX-structors flag.
   if (IsClassHidden(ID->getClassInterface()))
@@ -1165,7 +1165,7 @@ llvm::Constant *CGObjCMac::EmitMetaClass(const ObjCImplementationDecl *ID,
                                          const llvm::Type *InterfaceTy,
                                          const ConstantVector &Methods) {
   unsigned Flags = eClassFlags_Meta;
-  unsigned Size = CGM.getTargetData().getABITypeSize(ObjCTypes.ClassTy);
+  unsigned Size = CGM.getTargetData().getTypePaddedSize(ObjCTypes.ClassTy);
 
   if (IsClassHidden(ID->getClassInterface()))
     Flags |= eClassFlags_Hidden;
@@ -1268,7 +1268,7 @@ llvm::Constant *CGObjCMac::EmitMetaClassRef(const ObjCInterfaceDecl *ID) {
 llvm::Constant *
 CGObjCMac::EmitClassExtension(const ObjCImplementationDecl *ID) {
   uint64_t Size = 
-    CGM.getTargetData().getABITypeSize(ObjCTypes.ClassExtensionTy);
+    CGM.getTargetData().getTypePaddedSize(ObjCTypes.ClassExtensionTy);
 
   std::vector<llvm::Constant*> Values(3);
   Values[0] = llvm::ConstantInt::get(ObjCTypes.IntTy, Size);
@@ -1935,7 +1935,7 @@ void CGObjCMac::EmitImageInfo() {
 static const int ModuleVersion = 7;
 
 void CGObjCMac::EmitModuleInfo() {
-  uint64_t Size = CGM.getTargetData().getABITypeSize(ObjCTypes.ModuleTy);
+  uint64_t Size = CGM.getTargetData().getTypePaddedSize(ObjCTypes.ModuleTy);
   
   std::vector<llvm::Constant*> Values(4);
   Values[0] = llvm::ConstantInt::get(ObjCTypes.LongTy, ModuleVersion);
index 760e381603e903ea9fc9a6de47fa631187b7c92d..9e57aafa02a3eec531334ea952cd8e2aedddfa8f 100644 (file)
@@ -460,7 +460,7 @@ void RecordOrganizer::layoutStructFields(const ASTRecordLayout &RL) {
        Field != FieldEnd; ++Field) {
     uint64_t offset = RL.getFieldOffset(curField);
     const llvm::Type *Ty = CGT.ConvertTypeRecursive(Field->getType());
-    uint64_t size = CGT.getTargetData().getABITypeSizeInBits(Ty);
+    uint64_t size = CGT.getTargetData().getTypePaddedSizeInBits(Ty);
 
     if (Field->isBitField()) {
       Expr *BitWidth = Field->getBitWidth();
@@ -498,7 +498,7 @@ void RecordOrganizer::layoutStructFields(const ASTRecordLayout &RL) {
   }
 
   STy = llvm::StructType::get(LLVMFields, true);
-  assert(CGT.getTargetData().getABITypeSizeInBits(STy) == RL.getSize());
+  assert(CGT.getTargetData().getTypePaddedSizeInBits(STy) == RL.getSize());
 }
 
 /// layoutUnionFields - Do the actual work and lay out all fields. Create
@@ -532,5 +532,5 @@ void RecordOrganizer::layoutUnionFields(const ASTRecordLayout &RL) {
   // structures should be aligning them appropriately anyway.
   // FIXME: We can be a bit more intuitive in a lot of cases.
   STy = llvm::ArrayType::get(llvm::Type::Int8Ty, RL.getSize() / 8);
-  assert(CGT.getTargetData().getABITypeSizeInBits(STy) == RL.getSize());
+  assert(CGT.getTargetData().getTypePaddedSizeInBits(STy) == RL.getSize());
 }