[PATCH] D102292: [docs] Add page on opaque pointer types

Arthur Eubanks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 14 10:46:47 PDT 2021


aeubanks added a comment.

In D102292#2759011 <https://reviews.llvm.org/D102292#2759011>, @theraven wrote:

> In D102292#2757941 <https://reviews.llvm.org/D102292#2757941>, @dblaikie wrote:
>
>> Yeah, that seems out of scope for this document. https://llvm.org/docs/LangRef.html#pointer-type documents that pointers to functions and pointers to other things are all roughly the same sort of thing - and we're changing all of them over to the opaque pointer type. & other wording generally treats all pointers as having the same size, etc. I think that's best left elsewhere than this doc if there's no interesting distinction between function pointers and data pointers currently (which it doesn't seem like there is).
>
> Note that we have support for different code and data representations with the `P` flag in the DataLayout.  We can also differentiate between pointers to globals with G and there's an under-review patch for a specified address space for allocas.  I think it's worth highlighting in this document that address spaces are the recommended way of representing different kinds of pointers (with potentially different sizes, access to different types of memory, representations of null, and so on).  We retain the distinction between pointer types where the semantics matter for lowering, we lose the distinction when the distinction doesn't convey any useful meaning.

This is good information to know (I didn't know about it before), but IMO address spaces should have their own documentation (that I'd be happy to link to here). This seems orthogonal to opaque pointers.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102292/new/

https://reviews.llvm.org/D102292



More information about the llvm-commits mailing list