[clang] [CIR] Use the global address space for the VTT parameter (PR #240548)

Steffen Larsen via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 10 02:42:19 PST 2026


================
@@ -524,6 +524,16 @@ class CIRGenModule : public CIRGenTypeCache {
   /// space, which may lead to type mismatches in other parts of the IR.
   LangAS getLangTempAllocaAddressSpace() const;
 
+  /// Return the AST address space of the underlying global variable for D, as
+  /// determined by its declaration. Normally this is the same as the address
+  /// space of D's type, but in CUDA, address spaces are associated with
+  /// declarations, not types. If D is nullptr, return the default address
+  /// space for global variable.
+  ///
+  /// For languages without explicit address spaces, if D has default address
+  /// space, target-specific global or constant address space may be returned.
+  LangAS getGlobalVarAddressSpace(const VarDecl *decl);
----------------
steffenlarsen wrote:

Is this move to make it a public member? Would it be cleaner to add `nullptr` as the default parameter of this function, since `nullptr` becomes a relatively normal argument value for it?

https://github.com/llvm/llvm-project/pull/240548


More information about the cfe-commits mailing list