I'm using the getIntPtrType overload that takes a pointer type, and returns the integer, not the one that takes a context and the address space (there is one place still using it in this version of the patch which I'll clean up to use the other one before committing). http://llvm-reviews.chandlerc.com/D1449