================ @@ -195,7 +195,16 @@ void CIRGenFunction::startFunction(GlobalDecl gd, QualType returnType, mlir::Location fnBodyBegin = getLoc(fd->getBody()->getBeginLoc()); builder.CIRBaseBuilderTy::createStore(fnBodyBegin, paramVal, addrVal); } + assert(builder.getInsertionBlock() && "Should be valid"); + + auto fnEndLoc = getLoc(fd->getBody()->getEndLoc()); + + // When the current function is not void, create an address to store the + // result value. + if (fnRetCIRTy.has_value()) ---------------- erichkeane wrote:
What purpose does this `fnRetCIRTy` serve? `startFunction` already has the return type in `returnType`, right? Could/should we just convert it instead? https://github.com/llvm/llvm-project/pull/129933 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits