[llvm] [ABI] Add default argument/return classifiers to TargetInfo (PR #225009)

Steffen Larsen via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 21 04:37:57 PDT 2026


================
@@ -71,6 +71,45 @@ const Type *TargetInfo::useFirstFieldIfTransparentUnion(const Type *Ty) const {
   return Ty;
 }
 
+ArgInfo TargetInfo::classifyDefaultArgumentType(const Type *Ty) const {
+  Ty = useFirstFieldIfTransparentUnion(Ty);
+
+  if (isAggregateTypeForABI(Ty)) {
+    // A record that must stay in memory keeps ByVal, everything else indirect.
+    if (RecordArgABI RAA = getRecordArgABI(Ty))
+      return getNaturalAlignIndirect(Ty, /*ByVal=*/RAA == RAA_DirectInMemory);
----------------
steffenlarsen wrote:

I'm a little concerned that these interfaces don't currently support address spaces. I worry that this will come back to bite us when we'll eventually have to chase down all sites that should have address spaces passed. Is this deferred functionality or are the new interfaces doing this elsewhere?

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


More information about the llvm-commits mailing list