[cfe-commits] r127391 - /cfe/trunk/lib/AST/RecordLayoutBuilder.cpp

Ken Dyck kd at kendyck.com
Wed Mar 9 18:00:35 PST 2011


Author: kjdyck
Date: Wed Mar  9 20:00:35 2011
New Revision: 127391

URL: http://llvm.org/viewvc/llvm-project?rev=127391&view=rev
Log:
Instead of round up sizes to '8', round them up to the alignment of the char
type.

Modified:
    cfe/trunk/lib/AST/RecordLayoutBuilder.cpp

Modified: cfe/trunk/lib/AST/RecordLayoutBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/RecordLayoutBuilder.cpp?rev=127391&r1=127390&r2=127391&view=diff
==============================================================================
--- cfe/trunk/lib/AST/RecordLayoutBuilder.cpp (original)
+++ cfe/trunk/lib/AST/RecordLayoutBuilder.cpp Wed Mar  9 20:00:35 2011
@@ -1301,7 +1301,8 @@
 
     uint64_t NewSizeInBits = FieldOffset + FieldSize;
 
-    setDataSize(llvm::RoundUpToAlignment(NewSizeInBits, 8));
+    setDataSize(llvm::RoundUpToAlignment(NewSizeInBits, 
+                                         Context.Target.getCharAlign()));
     UnfilledBitsInLastByte = getDataSizeInBits() - NewSizeInBits;
   }
 
@@ -1378,7 +1379,8 @@
   } else {
     uint64_t NewSizeInBits = FieldOffset + FieldSize;
 
-    setDataSize(llvm::RoundUpToAlignment(NewSizeInBits, 8));
+    setDataSize(llvm::RoundUpToAlignment(NewSizeInBits, 
+                                         Context.Target.getCharAlign()));
     UnfilledBitsInLastByte = getDataSizeInBits() - NewSizeInBits;
   }
 





More information about the cfe-commits mailing list