================ @@ -2653,11 +2655,39 @@ const BlockByrefInfo &CodeGenFunction::getBlockByrefInfo(const VarDecl *D) { info.FieldOffset = varOffset; info.ByrefAlignment = std::max(varAlign, getPointerAlign()); + // If we're initializing directly on the heap, then we should emit a + // no-op copy helper, both because we don't need a real one (the + // object will never move), and because a real one would break the + // pre-init _Block_object_assign. + info.ForceNoopCopy = D->needsInitOnHeap(); + auto pair = BlockByrefInfos.insert({D, info}); assert(pair.second && "info was inserted recursively?"); return pair.first->second; } +void CodeGenFunction::emitByrefInitOnHeap(llvm::Value *P) { ---------------- ille-apple wrote:
Good point. I'll change the name to `emitByrefHeapAlloc`. https://github.com/llvm/llvm-project/pull/89475 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits