]> granicus.if.org Git - clang/commitdiff
Instead of round up sizes to '8', round them up to the alignment of the char
authorKen Dyck <kd@kendyck.com>
Thu, 10 Mar 2011 02:00:35 +0000 (02:00 +0000)
committerKen Dyck <kd@kendyck.com>
Thu, 10 Mar 2011 02:00:35 +0000 (02:00 +0000)
type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127391 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/RecordLayoutBuilder.cpp

index ecaa1f69620c1aab28856d99f26843cc075925c1..016b405fa013981be18d581b035a77d1e751877e 100644 (file)
@@ -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;
   }