[PATCH] D150746: [CodeGen]Translating pointer arguments can require an address space cast

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu May 18 15:51:10 PDT 2023


rjmccall added a comment.

Can you add a test?  I think we have some in-tree targets which put globals in a non-default address space.



================
Comment at: clang/lib/CodeGen/ItaniumCXXABI.cpp:1679
       CGF.GetVTTParameter(GlobalDecl(D, Type), ForVirtualBase, Delegating);
-  QualType VTTTy = getContext().getPointerType(getContext().VoidPtrTy);
+  LangAS AS = getLangASFromTargetAS(VTT->getType()->getPointerAddressSpace());
+  QualType Q = getContext().getAddrSpaceQualType(getContext().VoidPtrTy, AS);
----------------
Please just use `GetGlobalVarAddressSpace` here; we should try to avoid these reverse-mappings.


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

https://reviews.llvm.org/D150746



More information about the cfe-commits mailing list