Fix vtbl field addr space
authorYaxun (Sam) Liu <yaxun.liu@amd.com>
Wed, 15 Sep 2021 18:21:50 +0000 (14:21 -0400)
committerYaxun (Sam) Liu <yaxun.liu@amd.com>
Thu, 16 Sep 2021 14:57:31 +0000 (10:57 -0400)
commitabe8b354e37d8d6a163a6402d8e68ddcfc462dfc
tree98812df034684894d63cab8d1b7546dace464ee2
parentea79b77da3eeba926e16c3dd8a4f6626c139e185
Fix vtbl field addr space

Storing the vtable field of an object should use the same address space as
the this pointer. Currently it is assumed to be addr space 0 but this may not
be true.

This assumption (added in 054cc3b1b469de4b0cb25d1dc3af43c679c5dc44) caused
issues for the out-of-tree CHERI targets.

Reviewed by: John McCall, Alexander Richardson

Differential Revision: https://reviews.llvm.org/D109841
clang/lib/CodeGen/CGClass.cpp