================
@@ -839,6 +853,15 @@ void CallConvLoweringPass::runOnOperation() {
   llvm::MapVector<cir::FuncOp, FunctionClassification> classifications;
   bool anyFailed = false;
   moduleOp.walk([&](cir::FuncOp f) {
+    // C++ requires a complete type at any call or definition, so only a
+    // declaration can carry an incomplete-by-value parameter or return
+    // type, and no translation unit can ever call or define it with real
+    // argument data.  Leave it unclassified, mirroring classic CodeGen.
+    cir::FuncType fnTy = f.getFunctionType();
+    if (isX86 && f.isDeclaration() &&
+        (hasIncompleteRecordByValue(fnTy.getReturnType()) ||
+         llvm::any_of(fnTy.getInputs(), hasIncompleteRecordByValue)))
+      return;
----------------
adams381 wrote:

@efriedma-quic Are you satisfied with this PR, or do you have any more 
questions?

https://github.com/llvm/llvm-project/pull/218786
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to