[LLVMdev] Proposal: intp type
Chris Lattner
clattner at apple.com
Wed Nov 11 11:11:17 PST 2009
On Nov 10, 2009, at 4:10 PM, Talin wrote:
> I realize that most users of LLVM aren't affected by this, because most frontends aren't target-neutral, and thus know in advance how big a pointer is. At least, that's my impression.
I believe that.
> There's only a tiny handful of fairly esoteric cases which require selecting a target before you generate IR. Unfortunately, the "pointer the same size as an int" is one of these rare cases - it is something that is very painful to try and work around. (A similar esoteric use case is: "which of the following two types is larger, 3 x int32 or 2 x {}*? -- i.e. the union problem.)
With this explanation, the idea of adding a union type seems a lot more compelling to me. For the record, I'm not opposed to an intptr_t type or a union type, but the semantics have to be clean and well specified.
-Chris
More information about the llvm-dev
mailing list