I’m working on implementing MSVC’s __ptr32, __ptr64, __sptr, and __uptr extensions, which represent native pointers on 32-bit and 64-bit systems. The implementation involves adding three address spaces that represent
- 32-bit pointers with sign extension,
- 32-bit pointers with zero extension, and
- 64-bit pointers.
This would require adding the three pointer sizes ‘-p253:32:32-p254:32:32-p255:64:64’ to the X86 datalayout. I picked 253/254/255 because they’re close to 256-258, which are the address spaces currently in use. I’m not sure if it would be better to use 1/2/3 or some large numbers.
https://reviews.llvm.org/D64931 contains the patch.
Any feedback is welcome!