aboutsummaryrefslogtreecommitdiff
path: root/CodeGen/CodeGenTypes.cpp
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2007-12-10 18:37:40 +0000
committerDevang Patel <dpatel@apple.com>2007-12-10 18:37:40 +0000
commit0fa602357e57bc91027834d741dd5b21cbeee5b9 (patch)
tree6a280ee300799c380ada7de36c609621d2963ec4 /CodeGen/CodeGenTypes.cpp
parent14c7500b8ca27fba362a98cd5e2441be9016109d (diff)
Use getABITypeSizeInBits() instead of getTypeSizeInBits() during struct layout.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44799 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CodeGen/CodeGenTypes.cpp')
-rw-r--r--CodeGen/CodeGenTypes.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/CodeGen/CodeGenTypes.cpp b/CodeGen/CodeGenTypes.cpp
index f00413c849..0cc9516d68 100644
--- a/CodeGen/CodeGenTypes.cpp
+++ b/CodeGen/CodeGenTypes.cpp
@@ -417,15 +417,15 @@ void RecordOrganizer::layoutStructFields(const ASTRecordLayout &RL) {
// 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 @@ void RecordOrganizer::layoutStructFields(const ASTRecordLayout &RL) {
//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 @@ void RecordOrganizer::addPaddingFields(unsigned RequiredBits) {
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.