[clang] [X86_64] fix arg pass error in struct. (PR #86902)

Eli Friedman via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 5 13:01:23 PDT 2024


================
@@ -2100,8 +2100,12 @@ void X86_64ABIInfo::classify(QualType Ty, uint64_t OffsetBase, Class &Lo,
         postMerge(Size, Lo, Hi);
         return;
       }
+
+      bool InMemory = Offset % getContext().getTypeAlign(i->getType()) ||
+                      (i->getType()->getAs<BuiltinType>() &&
----------------
efriedma-quic wrote:

I don't like the use of BuiltinType here; I don't think it really captures the relevant cases.  Do we want to handle pointers? vectors? arrays?

Maybe just `bool InMemory = Offset % getContext().getTypeAlign(i->getType()->getCanonicalType())` is sufficient to handle this case without trying to reason about individual types.

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


More information about the cfe-commits mailing list