On Tue, Nov 24, 2009 at 1:25 PM, John McCall <[email protected]> wrote:
> This implicitly assumes that arithmetic on void* is in 1-byte chunks.
Arithmetic on void* is in sizeof(char) chunks, which are "1-byte" by definition.
> --- lib/AST/ASTContext.cpp (revision 89760)
> +++ lib/AST/ASTContext.cpp (working copy)
> @@ -3085,15 +3085,15 @@
> /// getObjCEncodingTypeSize returns size of type for objective-c encoding
> /// purpose.
> int ASTContext::getObjCEncodingTypeSize(QualType type) {
> - uint64_t sz = getTypeSize(type);
> + uint64_t sz = getTypeSizeInBytes(type);
>
> // Make all integer and enum types at least as large as an int
> if (sz > 0 && type->isIntegralType())
> - sz = std::max(sz, getTypeSize(IntTy));
> + sz = std::max(sz, getTypeSizeInBytes(IntTy));
> // Treat arrays as pointers, since that's how they're passed in.
> else if (type->isArrayType())
> - sz = getTypeSize(VoidPtrTy);
> - return sz / getTypeSize(CharTy);
> + sz = getTypeSizeInBytes(VoidPtrTy);
> + return sz;
> }
>
>
> You've changed this function from returning the size in chars to the size in
> bytes. Intentional? If so, please document.
Read a bit more carefully; the returned units aren't changing.
-Eli
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits