[llvm] [ABI] Add DefaultTargetInfo for default argument/return classification (PR #225009)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 23 03:21:59 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);
----------------
skc7 wrote:
#225301 is merged. So, rebased and updated this PR to use `getNaturalAlignIndirect()` with alloca AS.
https://github.com/llvm/llvm-project/pull/225009
More information about the llvm-commits
mailing list