aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Dyck <kd@kendyck.com>2011-03-10 02:00:35 +0000
committerKen Dyck <kd@kendyck.com>2011-03-10 02:00:35 +0000
commitd5e3ed085032def4ac875d64cb029fc3926652ed (patch)
treeb7b218a581cdb45c82234507b4bf252e1d375b35
parent90ce2dba294b8443169fe1a583914908fae0e767 (diff)
Instead of round up sizes to '8', round them up to the alignment of the char
type. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127391 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/AST/RecordLayoutBuilder.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/AST/RecordLayoutBuilder.cpp b/lib/AST/RecordLayoutBuilder.cpp
index ecaa1f6962..016b405fa0 100644
--- a/lib/AST/RecordLayoutBuilder.cpp
+++ b/lib/AST/RecordLayoutBuilder.cpp
@@ -1301,7 +1301,8 @@ void RecordLayoutBuilder::LayoutWideBitField(uint64_t FieldSize,
uint64_t NewSizeInBits = FieldOffset + FieldSize;
- setDataSize(llvm::RoundUpToAlignment(NewSizeInBits, 8));
+ setDataSize(llvm::RoundUpToAlignment(NewSizeInBits,
+ Context.Target.getCharAlign()));
UnfilledBitsInLastByte = getDataSizeInBits() - NewSizeInBits;
}
@@ -1378,7 +1379,8 @@ void RecordLayoutBuilder::LayoutBitField(const FieldDecl *D) {
} else {
uint64_t NewSizeInBits = FieldOffset + FieldSize;
- setDataSize(llvm::RoundUpToAlignment(NewSizeInBits, 8));
+ setDataSize(llvm::RoundUpToAlignment(NewSizeInBits,
+ Context.Target.getCharAlign()));
UnfilledBitsInLastByte = getDataSizeInBits() - NewSizeInBits;
}