[cfe-commits] r62101 - in /cfe/trunk/lib/CodeGen: CGExprConstant.cpp CGObjCGNU.cpp CGObjCMac.cpp CodeGenTypes.cpp
Daniel Dunbar
daniel at zuster.org
Mon Jan 12 13:08:19 PST 2009
Author: ddunbar
Date: Mon Jan 12 15:08:18 2009
New Revision: 62101
URL: http://llvm.org/viewvc/llvm-project?rev=62101&view=rev
Log:
(LLVM up) Match TargetData API change in LLVM TOT.
Modified:
cfe/trunk/lib/CodeGen/CGExprConstant.cpp
cfe/trunk/lib/CodeGen/CGObjCGNU.cpp
cfe/trunk/lib/CodeGen/CGObjCMac.cpp
cfe/trunk/lib/CodeGen/CodeGenTypes.cpp
Modified: cfe/trunk/lib/CodeGen/CGExprConstant.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprConstant.cpp?rev=62101&r1=62100&r2=62101&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExprConstant.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExprConstant.cpp Mon Jan 12 15:08:18 2009
@@ -238,7 +238,7 @@
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);
Modified: cfe/trunk/lib/CodeGen/CGObjCGNU.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjCGNU.cpp?rev=62101&r1=62100&r2=62101&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjCGNU.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjCGNU.cpp Mon Jan 12 15:08:18 2009
@@ -698,7 +698,7 @@
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");
Modified: cfe/trunk/lib/CodeGen/CGObjCMac.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjCMac.cpp?rev=62101&r1=62100&r2=62101&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjCMac.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjCMac.cpp Mon Jan 12 15:08:18 2009
@@ -767,7 +767,7 @@
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 @@
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 @@
};
*/
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 @@
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 @@
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::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 @@
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);
Modified: cfe/trunk/lib/CodeGen/CodeGenTypes.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenTypes.cpp?rev=62101&r1=62100&r2=62101&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenTypes.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenTypes.cpp Mon Jan 12 15:08:18 2009
@@ -460,7 +460,7 @@
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 @@
}
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 @@
// 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());
}
More information about the cfe-commits
mailing list