================
@@ -21,9 +21,12 @@ ABIArgInfo DefaultABIInfo::classifyArgumentType(QualType Ty) 
const {
     // Records with non-trivial destructors/copy-constructors should not be
     // passed by value.
     if (CGCXXABI::RecordArgABI RAA = getRecordArgABI(Ty, getCXXABI()))
-      return getNaturalAlignIndirect(Ty, RAA == CGCXXABI::RAA_DirectInMemory);
+      return getNaturalAlignIndirect(
+          Ty, getContext().getTargetAddressSpace(LangAS::Default),
+          RAA == CGCXXABI::RAA_DirectInMemory);
 
-    return getNaturalAlignIndirect(Ty);
+    return getNaturalAlignIndirect(
+        Ty, getContext().getTargetAddressSpace(LangAS::Default));
----------------
AlexVlx wrote:

Eventually they should, this ties into what @rjmccall was saying elsewhere re: 
specifying and encoding an actual rule for indirects, which this initial change 
was trying to avoid. The other contexts are for indirect returns, where with 
the current Clang implementation you can only get `alloca`d storage.

This is for indirect, non-aliased args, which in the past didn't actually carry 
an AS, so this is just trying to keep existing (implicit) behaviour; for the 
time being there's no use of the AS for non-aliased indirect args, as it'd not 
have been available before. Probably for args we want what was suggested 
elsewhere, which is what you are saying, namely just use the `alloca` AS, I 
just didn't do it in this change / was going to follow up. Guess it cannot hurt 
to just bite the bullet, which would also remove the need for the helper?

https://github.com/llvm/llvm-project/pull/114062
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to