[cfe-commits] r123720 - in /cfe/trunk/lib/CodeGen: CGDecl.cpp CodeGenModule.cpp

Chris Lattner clattner at apple.com
Tue Jan 18 09:13:30 PST 2011

On Jan 17, 2011, at 9:38 PM, John McCall wrote:

> On Jan 17, 2011, at 6:01 PM, Ken Dyck wrote:
>> Author: kjdyck
>> Date: Mon Jan 17 20:01:14 2011
>> New Revision: 123720
>> URL: http://llvm.org/viewvc/llvm-project?rev=123720&view=rev
>> Log:
>> Replace calls to CharUnits::fromQuantity() with ones to 
>> ASTContext::toCharUnitsFromBits() when converting from bit sizes to char units.
> Is there any good reason why TargetInfo and ASTContext compute size and alignment in bits rather than chars in the first place?  I think most consumers of this information want it in chars, and for the ones that want bits, well, a multiply is a lot cheaper than a divide.

Size in bits makes sense for bitfields etc.  Alignment in bits doesn't make sense to me, other than for consistency.


More information about the cfe-commits mailing list