================
@@ -307,8 +307,8 @@ class AMDGPUTargetCodeGenInfo : public TargetCodeGenInfo {
 
   LangAS getSRetAddrSpace(const CXXRecordDecl *RD) const override;
 
-  LangAS getGlobalVarAddressSpace(CodeGenModule &CGM,
-                                  const VarDecl *D) const override;
+  LangAS adjustGlobalVarAddressSpace(CodeGenModule &CGM, const VarDecl *D,
----------------
Pierre-vh wrote:

But LangAS is a superset of the target address space set. If I am to change 
this Target hook into the IR AS, I need to refactor a lot more things. Not all 
users of `GetGlobalVarAddressSpace` directly convert the result into the target 
AS.

Note that other Target hooks, like `getASTAllocaAddressSpace` and 
`getAddrSpaceOfCxaAtexitPtrParam` also return a LangAS.

I'm not opposed to doing this in a better way but I struggle to see how this is 
an improvement, it turns this relatively small patch into a larger refactoring 
that'll need more review. It'd also make this function very different from the 
other similar ones in this file

https://github.com/llvm/llvm-project/pull/195612
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to