[PATCH] D103835: [CUDA][HIP] Fix store of vtbl in ctor
Yaxun Liu via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Sep 15 10:44:51 PDT 2021
yaxunl added a comment.
In D103835#3001011 <https://reviews.llvm.org/D103835#3001011>, @rjmccall wrote:
> Hmm. I think "v-tables are in the address space of the object pointer" is not a good assumption. Probably this ought to be determined by the C++ ABI for the target. In principle it could even be class-specific, but I think we can start by assuming it's universal.
>
> It should be decided by the AST-level ABI abstraction so that it properly affects record layout, since different address spaces can have different pointer sizes.
Sorry my previous description was not accurate.
Currently vtbl addr space is assumed to be the default global addr space of LLVM IR, which is determined by the data layout of the LLVM IR. This patch did not change that.
The vtbl field of a class is a pointer to default addr space. When the vtbl field gets initialized, it is casted to a pointer to default global addr space so that the vtbl can be stored to it. The addr space of the vtbl field itself should be the same as `this` pointer. So we were talking about a pointer to the vtbl field of an object, not the addr space of vtbl.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D103835/new/
https://reviews.llvm.org/D103835
More information about the cfe-commits
mailing list