[cfe-commits] r44799 - /cfe/trunk/CodeGen/CodeGenTypes.cpp
Devang Patel
dpatel at apple.com
Mon Dec 10 10:37:40 PST 2007
Author: dpatel
Date: Mon Dec 10 12:37:40 2007
New Revision: 44799
URL: http://llvm.org/viewvc/llvm-project?rev=44799&view=rev
Log:
Use getABITypeSizeInBits() instead of getTypeSizeInBits() during struct layout.
Modified:
cfe/trunk/CodeGen/CodeGenTypes.cpp
Modified: cfe/trunk/CodeGen/CodeGenTypes.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/CodeGen/CodeGenTypes.cpp?rev=44799&r1=44798&r2=44799&view=diff
==============================================================================
--- cfe/trunk/CodeGen/CodeGenTypes.cpp (original)
+++ cfe/trunk/CodeGen/CodeGenTypes.cpp Mon Dec 10 12:37:40 2007
@@ -417,15 +417,15 @@
// struct { char A; short CurrentField:2; };
const llvm::Type *Ty = CGT.ConvertType(FD->getType());
// Calculate extra bits available in this bitfield.
- ExtraBits = CGT.getTargetData().getTypeSizeInBits(Ty) - BitFieldSize;
+ ExtraBits = CGT.getTargetData().getABITypeSizeInBits(Ty) - BitFieldSize;
if (LLVMFields.empty())
// Ths is - struct { char CurrentField:2; char B:4; }
addLLVMField(Ty, BitFieldSize, FD, 0, ExtraBits);
else {
const llvm::Type *PrevTy = LLVMFields.back();
- if (CGT.getTargetData().getTypeSizeInBits(PrevTy) >=
- CGT.getTargetData().getTypeSizeInBits(Ty))
+ if (CGT.getTargetData().getABITypeSizeInBits(PrevTy) >=
+ CGT.getTargetData().getABITypeSizeInBits(Ty))
// This is - struct { char A; char CurrentField:2; };
addLLVMField(Ty, BitFieldSize, FD, 0, ExtraBits);
else {
@@ -446,8 +446,8 @@
//ExtraBits are not enough to hold entire FD.
const llvm::Type *Ty = CGT.ConvertType(FD->getType());
const llvm::Type *PrevTy = LLVMFields.back();
- uint64_t TySize = CGT.getTargetData().getTypeSizeInBits(Ty);
- if (CGT.getTargetData().getTypeSizeInBits(PrevTy) >= TySize) {
+ uint64_t TySize = CGT.getTargetData().getABITypeSizeInBits(Ty);
+ if (CGT.getTargetData().getABITypeSizeInBits(PrevTy) >= TySize) {
// Previous field does not allow sharing of ExtraBits. Use new field.
// struct { char a; char b:5; char c:4; } where c is current FD.
Cursor += ExtraBits;
@@ -472,7 +472,7 @@
unsigned RequiredBytes = RequiredBits / 8;
for (unsigned i = 0; i != RequiredBytes; ++i)
addLLVMField(llvm::Type::Int8Ty,
- CGT.getTargetData().getTypeSizeInBits(llvm::Type::Int8Ty));
+ CGT.getTargetData().getABITypeSizeInBits(llvm::Type::Int8Ty));
}
/// addLLVMField - Add llvm struct field that corresponds to llvm type Ty.
More information about the cfe-commits
mailing list