[PATCH] D116948: [CodeGen] Treat ObjC `__unsafe_unretained` and class types as trivial when generating copy/dispose helper functions

Akira Hatanaka via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 10 08:18:25 PST 2022


ahatanak created this revision.
ahatanak added a reviewer: rjmccall.
ahatanak added a project: clang.
Herald added a subscriber: mgrang.
ahatanak requested review of this revision.

Analyze the block captures just once before generating copy/dispose block helper functions and honor the inert `__unsafe_unretained` qualifier. This refactor fixes a bug where captures of ObjC `__unsafe_unretained` and class types were needlessly retained/released by the copy/dispose helper functions.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D116948

Files:
  clang/lib/CodeGen/CGBlocks.cpp
  clang/lib/CodeGen/CGBlocks.h
  clang/lib/CodeGen/CGObjCMac.cpp
  clang/test/CodeGenObjC/arc-blocks.m
  clang/test/CodeGenObjC/blocks.m

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D116948.398649.patch
Type: text/x-patch
Size: 32021 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220110/7d3c4bfa/attachment-0001.bin>


More information about the cfe-commits mailing list