[LLVMdev] Generating target dependent function calls

Eric Christopher echristo at apple.com
Sat Dec 25 22:54:01 PST 2010


> 
> thanks for this hint. This seems to be a reasonable approach.
> 
> However, is TD.getPointerSizeInBits() always equivalent to the number of bits a long has on a platform? It might be correct on Linux, however I do not think this is true on Windows.
> 

It's the size of a pointer which is, I think, what they meant there, but yeah, it's the size of a pointer and not necessarily size of long.

> I believe together with Peter's ideas I can create something that will be correct on Linux and that will warn if used on any other platform.

It should be correct on OSX as well.

You could also add a configure check that verifies that sizeof(ptrdiff_t) == sizeof(long) and disable support otherwise.

-eric



More information about the llvm-dev mailing list