aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-01-12 21:08:18 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-01-12 21:08:18 +0000
commit491c7b77cd8ec8570f646d43b937a5aec688bcbf (patch)
tree5ad04dc2067b2c3bdabf1be36ce0c8ce18f08d78
parentd1fa6449e9dbdd667466e9e1e971aa17c9793e8a (diff)
(LLVM up) Match TargetData API change in LLVM TOT.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62101 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/CGExprConstant.cpp2
-rw-r--r--lib/CodeGen/CGObjCGNU.cpp2
-rw-r--r--lib/CodeGen/CGObjCMac.cpp14
-rw-r--r--lib/CodeGen/CodeGenTypes.cpp6
4 files changed, 12 insertions, 12 deletions
diff --git a/lib/CodeGen/CGExprConstant.cpp b/lib/CodeGen/CGExprConstant.cpp
index 71216a5d63..41875522ed 100644
--- a/lib/CodeGen/CGExprConstant.cpp
+++ b/lib/CodeGen/CGExprConstant.cpp
@@ -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);
diff --git a/lib/CodeGen/CGObjCGNU.cpp b/lib/CodeGen/CGObjCGNU.cpp
index 0bf3c2d1b9..2621a84914 100644
--- a/lib/CodeGen/CGObjCGNU.cpp
+++ b/lib/CodeGen/CGObjCGNU.cpp
@@ -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");
diff --git a/lib/CodeGen/CGObjCMac.cpp b/lib/CodeGen/CGObjCMac.cpp
index df4b2a1999..c587ab8230 100644
--- a/lib/CodeGen/CGObjCMac.cpp
+++ b/lib/CodeGen/CGObjCMac.cpp
@@ -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);
diff --git a/lib/CodeGen/CodeGenTypes.cpp b/lib/CodeGen/CodeGenTypes.cpp
index 760e381603..9e57aafa02 100644
--- a/lib/CodeGen/CodeGenTypes.cpp
+++ b/lib/CodeGen/CodeGenTypes.cpp
@@ -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());
}