One of the remaining blocking issues for merging all pointer types is that byval parameters need some way to communicate their size other than the element type of the pointer. This patch addresses the issue by adding a size function attribute, only usable with byval that encodes the information independently.
It's mostly a pretty straightforward copy/paste of the existing align handling, except I decided to allow more than 16-bits of size. It should be very rare, but I have seen people pass ridiculous structs by value and the compiler should probably be able to cope.
The main other thing I found slightly questionable was whether we could reuse the existing dereferencable or alloc_size attributes. In the end I decided the semantic contortion was just slightly too high so implemented a new keyword to be maximally compatible with the align it will sit next to.
Comment looks to be out of date (speaks of returning the size, rather than type)