[clang] [clang][CodeGen] `sret` args should always point to the `alloca` AS, so use that (PR #114062)

Alex Voicu via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 6 09:54:08 PST 2024


================
@@ -1780,6 +1780,14 @@ class TargetInfo : public TransferrableTargetInfo,
     return 0;
   }
 
+  /// \returns Target specific address space for indirect (e.g. sret) arguments.
+  /// If such an address space exists, it must be convertible to and from the
+  /// alloca address space. If it does not, std::nullopt is returned and the
+  /// alloca address space will be used.
+  virtual std::optional<unsigned> getIndirectArgAddressSpace() const {
----------------
AlexVlx wrote:

Err, I forgot to delete this. RE: `unsigned` vs `LangAS`, I used the former for symmetry with other interfaces. I agree with @rjmccall that `LangAS` would be safer / would make more sense, however `getIndirectAliased` already uses numeric vs typed.

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


More information about the cfe-commits mailing list