[cfe-commits] [Review] Rolling out ASTContext::getTypeSizeInChars()

Ken Dyck Ken.Dyck at onsemi.com
Mon Jan 11 13:24:12 PST 2010


On Monday, January 11, 2010 3:52 PM, Ted Kremenek wrote
>
> Thanks for tackling this.  I looked at the changes to 
> libAnalysis, and noticed the following line:
> 
> +    amt = CharUnits::fromRaw(getContext().getTypeAlign(T) / 8);
> 
> Does it make since to have a matching getTypeAlignInChars() 
> as well?  

Yes. It's on my TODO list.

> I'm also concerned about the dimensionality here.  Why did we 
> choose 'Chars' instead of 'Bytes'?

The short answer is that it reflects how getTypeSizeInChars() calculates
its value. It divides the bit size of the type by the bit size of the
char type, so calling them CharUnits seemed more accurate than
ByteUnits. The aim is to eventually support character widths other than
8.

What specifically are you concerned about?

-Ken




More information about the cfe-commits mailing list