================
@@ -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;
----------------
efriedma-quic wrote:
I suspect you need to do something different with enums; please make sure you
have an open task somewhere to address it. But that probably doesn't overlap
very much with this patch.
Please drop the isX86 check. Otherwise LGTM
https://github.com/llvm/llvm-project/pull/218786
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits