================
@@ -312,13 +312,15 @@ class TargetCodeGenInfo {
   virtual llvm::Constant *getNullPointer(const CodeGen::CodeGenModule &CGM,
       llvm::PointerType *T, QualType QT) const;
 
-  /// Get target favored AST address space of a global variable for languages
-  /// other than OpenCL and CUDA.
-  /// If \p D is nullptr, returns the default target favored address space
-  /// for global variable.
-  virtual LangAS getGlobalVarAddressSpace(CodeGenModule &CGM,
-                                          const VarDecl *D) const;
-
+  /// Adjust the address space proposed by the code generator for \p D.
+  /// If \p AS is empty, it means language semantics did not specify any 
address
+  /// space for this \p D.
+  ///
+  /// Can be used by targets to further refine the chosen address space for a
+  /// declaration.
+  virtual LangAS adjustGlobalVarAddressSpace(CodeGenModule &CGM,
+                                             const VarDecl *D,
+                                             std::optional<LangAS> AS) const;
----------------
arsenm wrote:

I'm not sure I understand why the new parameter is necessary. Can't you infer 
from VarDecl already? 

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

Reply via email to