================
@@ -0,0 +1,26 @@
+#include "llvm/ABI/ABIInfo.h"
+
+using namespace llvm::abi;
+bool ABIInfo::isAggregateTypeForABI(const Type *Ty) const {
+  // Member pointers are always aggregates
+  if (Ty->isMemberPointer())
+    return true;
+
+  // Check for fundamental scalar types
+  if (Ty->isInteger() || Ty->isFloat() || Ty->isPointer())
+    return false;
+
+  // Everything else is treated as aggregate
+  return true;
+}
+
+// Check if an integer type should be promoted
+bool ABIInfo::isPromotableIntegerType(const IntegerType *Ty) const {
+  unsigned BitWidth = Ty->getSizeInBits().getFixedValue();
+  return BitWidth < 32;
+}
+
+// Create indirect return with natural alignment
+ABIArgInfo ABIInfo::getNaturalAlignIndirect(const Type *Ty) const {
+  return ABIArgInfo::getIndirect(Ty->getAlignment().value(), /*ByVal=*/true);
----------------
nikic wrote:

I expect this is not going to do the right thing for types with explicit align 
attribute, but we'll see...

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

Reply via email to