[cfe-commits] [Review] rollingout ASTContext::getTypeSizeInBytes()

John McCall rjmccall at apple.com
Sun Nov 29 18:04:53 PST 2009


Ken Dyck wrote:
> On Wednesday, November 25, 2009 4:09 PM, John McCall wrote:
>   
>> Ken Dyck wrote: 
>>     
>>> Okay. I'll take a stab at implementing this. 
>>> 		
>>> As I understand it, these are the changes that need to happen:
>>>
>>> [snipped]
>>> 		
>>> Is this what you had in mind?
>>>       
>> 		  
>> I was thinking more along the lines of a type that represented a 
>> size/offset in bytes;  call it bytes_t for the sake of argument.  
>> [snipped]
>>     
>
> Okay. As a nested class in ASTContext? Or as a stand-alone class? 
>   

Standalone and in its own header file.

> Since we're making changes to the API anyways, what do you think of the
> units being bytes? The getTypeSizeInBytes() method returns the size of
> the type in characters, so it would be more accurate to call the units
> chars_t. And if we're doing that, we might as well change the method
> names to 'getTypeSizeInChars()' and 'getCharWidth()', too.
>   

I agree that 'chars' would be way better than 'bytes'.  For consistency 
with LLVM, the type name should probably be in CamelCase;  whether that 
name is 'Chars' or 'CharCount' or 'CharUnits' or 'CharWidth', I don't 
really care;  use your judgment, and hopefully this won't get 
bike-shedded. :)

John.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20091129/a74510cc/attachment.html>


More information about the cfe-commits mailing list