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

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 13 13:25:37 PDT 2021


dblaikie added a comment.

In D102292#2754913 <https://reviews.llvm.org/D102292#2754913>, @nlopes wrote:

> In D102292#2754879 <https://reviews.llvm.org/D102292#2754879>, @aeubanks wrote:
>
>> In D102292#2753579 <https://reviews.llvm.org/D102292#2753579>, @nlopes wrote:
>>
>>> Can you clarify if this only for data type or also for function types pls?
>>> (data and function pointer types don't have the same bit-width on all architectures)
>>
>> This should apply to all pointer types.
>> Do you have an example in LLVM of where this matters for function vs data?
>> In TargetMachine I only see the pointer size differences per address space, not function vs data. `TargetMachine::getPointerSize()`/`DataLayout::getPointerSize()`.
>
> I'm not an expert on the backend stuff. I just wanted to get it documented, while we are at it, whether LLVM supports architectures with different data/function pointer sizes or not.
> I guess the answer that you point at, is that one needs to use different address spaces if working with such architectures. I would be grateful if you could document this here as well.

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).


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