Charles, we have the same conceptual issue with our port of OpenVMS.
Many of our legacy languages have 32-bit pointers builtin into them and
OpenVMS itself has many existing 32-bit interfaces but we generate
64-bit code, use ELF-64 containers, etc. We provide dual-sized
pointers in our older C/C++ compilers. For our legacy compilers, our IR
conversion code simply does a whole bunch of typecasts with the 32-bit
pointers to turn them into 64-bit pointers, etc. We’re still not sure how to
properly describe this with pointer aliasing however.
For clang (the cfe-dev list would give more info), we’ve already found that
clang provides address_space(4) for 32-bits addresses. We’re looking at
leveraging that to provide our dual-sized pointers and add code to convert
between the two (sign-extend the 32 into a 64-bit pointer and chop off the
top-half of a 64-bit pointer with an optional warning message - that is
what we do today on our current Alpha and Itanium systems). That reminds
me to hop over to cfe-dev and float my issues as well since there might be
some overlap.
John